minetest/minetest — pull request #1847 by rafael7 (2014-11-17 16:19:19+00:00)
Title: Use native byte-swapping for de/serialization

Tests for and enables native byte-swapping instructions for de/serialization routines. These normally reduce to 1 machine op instead of a series of bit-shifts and bitwise ops as currently done. For big-endian machines these reduce to no-ops. Optimization works for GGC-like systems with endian.h header. Also do some minor cleanup in other serialization code.

Changes
serialize.h:
use machine native byte swapping if available, fall-back to previous generic method if not
commented out unused de/serialization functions for signed bytes (S8)
write/readARGB8() - just write 32-bit color in one op, instead of 4 1-byte ops
cleanup: removed unnecessary buffer inits for some serialize-out functions
use a #define for the fixed point factor in read/writeF1000()

staticobject.cpp:
cleanup: use util/serialize.h inlines instead of its own de/serialization

nodemetadata.cpp, nodetimer.cpp
minor optimzation/cleanup: slightly simpler deserialize node position method

serialize.cpp:
minor optimization/cleanup: avoid generation of unneeded string temporary

CMakeLists.txt, cmake_config.h.in: added detection of endian.h