cuberite/Tools
Ash d82a6afd9e
Overhaul endian handling in ByteBuffer and FastNBT (#5543)
* Overhaul endian handling in ByteBuffer and FastNBT

Rather than juggling "swapped" and "unswapped" versions of integers, different library functions, #defines, etc., simply always read everything byte-by-byte.

This works regardless of host CPU endian, got optimised down to either a normal load or a byteswap on every compiler I tested - only 1 instruction on most CPU architectures.

This commit introduces a "Bytes" array type to keep endian-sensitive data seperate from host data, alongside the needed C++ template machinery for it to work seamlessly. This approach is a little bit safer as well since you get length- and type-checking for most callsites.

* Remove remaining references to old-style endianness conversion, remove functions themselves.

---------

Co-authored-by: Alexander Harkness <me@bearbin.net>
2024-11-03 16:33:40 +01:00
..
AnvilStats Address comments 2020-07-12 22:00:07 +01:00
BlockTypePaletteGenerator Added an UpgradeBlockTypePalette check script. 2020-01-13 22:43:01 +01:00
BlockZapper cppcheck found an out of bound array access. (#4182) 2018-02-04 20:41:49 +00:00
GeneratorPerformanceTest Fix style of Tools 2017-12-24 14:23:23 +00:00
GrownBiomeGenVisualiser Removed all Printf-family functions from StringUtils. 2023-05-16 23:50:37 +02:00
MCADefrag cIsThread cleanup 2021-03-29 23:36:15 +01:00
MemDumpAnalysis Fix style of Tools 2017-12-24 14:23:23 +00:00
NoiseSpeedTest zlib -> libdeflate (#5085) 2021-01-11 16:39:43 +00:00
ProtoProxy Removed all Printf-family functions from StringUtils. 2023-05-16 23:50:37 +02:00
QtBiomeVisualiser Overhaul endian handling in ByteBuffer and FastNBT (#5543) 2024-11-03 16:33:40 +01:00
RCONClient Cleanup unneeded globals (#4736) 2020-05-10 16:16:38 +00:00
ToLuaDoxy Cleanup unneeded globals (#4736) 2020-05-10 16:16:38 +00:00
.gitignore Added new Qt-based biome visualiser. 2014-09-14 01:33:05 +02:00