I'm writing a c program which utilizes someone else's function. This function takes in a bit vector by "unsigned short * " pointer. However, the corresponding bit vector I pass to this function is constructed with "unsigned long * " pointer. Therefore, in Linux and Windows, because of the endian convention, the bit vector passed over is not what I want. For example, under unsigned long pointer, I have 0x12345678. But when casted into unsigned short, it becomes 0x5678 0x1234.
Now, the only thing I can think of is to either change my own program (which needs quite a lot of changes) or change that person's program (which needs just as much changes, and the code is hard to understand).
So I'm wondering, does any of the wizards here have better ways of dealing with this?