- uint16 getUnsignedShort ()
- {
- if ( pos + 1 >= length )
- return -1;
- uint16 v = *(uint16 *) (bits + pos);
- pos += 2;
- return v;
- }
It seems to be a lot more fussy than the lite versions that you can get for free.
I just had a look at one of the first warnings in the list
This code gets this warning
Warning 4 warning C4245: 'return' : conversion from 'int' to 'uint16', signed/unsigned mismatch
I see why too. If you assign the output of the function as uint16 then how can you return a -1?
It should not actually cause an error since the -1 will just be returned in uint16 format but I don't really see how this could not give a warning in any version