I'm sorry it's not working out as hoped. It's a bit strange since "port0000" would be the GPIO_NONE pin and that an attempt has been made to use it more than once. I'm thinking maybe the cast returns zero for some reason? This occurs while in the loop creating one of the output ports right? EDIT #1: Pin numbers can be given in any numeric format, the binary value will be the same either way.
EDIT #2: Made a few small updates to the code, probably nothing but you could try updating.
EDIT #3: What does your main chip and port creation code look like at this point?