-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java doesn't have unsigned shorts, bitmasks occur instead #14
Comments
@austinarrowsmith, looking through the EntityID and EE PDU classes, I'm seeing the proper masking during unmarshalling (& 0xFFFF) occurring for unsignedShorts in the src. Do you have another a specific reference in the src for where this is not occurring? |
brutzman
changed the title
Java doesn't have unsigned shorts
Java doesn't have unsigned shorts, bitmasks occur instead
Dec 29, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think there might be an issue with some of the fields being read out / unmarshaled using .readShort(), as this results in high end shorts (>32k) being negative. This could cause a few issues with lookups of enumerations - if they were populated that high.
So far in various simulation tools, I've encountered issues with
ElectronicEmitterPdu
,EntityStatePdu
and the classes used within (EntityID
, etc) but I'm sure any part of the standard that references 2-bytes needs to be unsigned, so probably stored internally as anint
that's masked (0xFFFF
). Some are, but some aren't. Unsure on the lack of uniformity.Raising this for further discussion on resolution or my use-case. :-)
The text was updated successfully, but these errors were encountered: