HTTPS clone URL
Subversion checkout URL
Please sign in to comment.
[GH #807] Refactor native_pbc endianness, bswap64. Add header argumen…
…t to converters Convert endianness upfront does not work. Some converters work on native floats, to do compiler casts. They need to know the packfile byteorder. Other bitfiddling converters work only on little-endian, so we also need to know the packfile byteorder, and they also need to convert endianness back to to the target format. Refactor bswap64, as it only works with 64bit registers. Tested with HAS_INT64. So there are two bswap64 API's, one for fast native conversion via a register and one with two unsigned char * args, which might point to the same buffer, for easier in-place conversion. Added dummy ROUND_NUM_TO macro, which needs to round a long number down to the given precision (when converting upwards). Can be done with sprintf, but need to find a better way. Simplify converter casts with unions. Replace SWAB_12 with SWAB_10. TODO: Need to check the last two bytes.
- Loading branch information...
Showing with 509 additions and 278 deletions.