aboutsummaryrefslogtreecommitdiff
path: root/src/util/serialize.cpp
Commit message (Collapse)AuthorAge
* Move files to subdirectories (#6599)Vitaliy2017-11-08
| | | | * Move files around
* serialize: use a temporary for SerializeExceptionLoïc Blot2017-08-21
| | | | Exception must always use temporary instead of global copied exception instances, it's not recommended and should have undefined issues
* Code modernization: subfolders (#6283)Loïc Blot2017-08-19
| | | | | | | | | | | | | * Code modernization: subfolders Modernize various code on subfolders client, network, script, threading, unittests, util * empty function * default constructor/destructor * for range-based loops * use emplace_back instead of push_back * C++ STL header style * Make connection.cpp readable in a pointed place + typo
* C++11 cleanup on constructors (#6000)Vincent Glize2017-06-19
| | | | * C++11 cleanup on constructors dir script
* Add ItemStack key-value meta storagerubenwardy2017-02-04
|
* Fix misc. MinGW and Valgrind warningskwolekr2015-11-08
|
* Add BufReader and vector-based serialization methodskwolekr2015-10-15
|
* Clean up util/serialization.{cpp,h} and add unit testskwolekr2015-08-01
|
* Increase limit of serialized long stringskwolekr2015-07-14
|
* Add more robust error checking to deSerialize*String routineskwolekr2015-07-13
| | | | | Add serializeHexString() Clean up util/serialize.cpp
* For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins2015-03-07
| | | | NDEBUG is defined), replace those usages with persistent alternatives
* serialize.h: use machine native byte swapping if available, fall-back to ↵Rafael Reilova2014-11-21
| | | | | | | | | | | | | | | | | | | | | previous generic method if not (supported for GCC using endian.h, detection done in cmake) write/readARGB8() - just write 32-bit color in one op, instead of 4 1-byte ops cleanup: removed unneeded buffer init for some serialize-out functions use a #define for the fixed point factor in read/writeF1000() nodemetadata.cpp, nodetimer.cpp optimzation: simpler deserialize node position method staticobject.cpp: cleanup: use util/serialize.h inlines instead of its own de/serialization serialize.cpp: minor optimization/cleanup: avoid generation of unneeded string temporary CMakeLists.txt, cmake_config.h.in: detection of endian.h config.h: added HAVE_ENDIAN_H Commits due to feedback squashed Signed-off-by: Craig Robbins <kde.psych@gmail.com>
* Fix serializing of signed numbers in serializeStructToStringShadowNinja2014-03-21
|
* Make serializeStructToString use an ostringstreamShadowNinja2014-03-15
|
* Revert "Use fixed-width format specifiers in serializeStructToString"ShadowNinja2014-03-14
| | | | | This reverts commit 875f1327a47f78d783c3abc7f7acc3977dc286ec. Fixed width format specifiers are only officially availale in C99 and C++11.
* Use fixed-width format specifiers in serializeStructToStringShadowNinja2014-03-13
|
* Replace usage of long long with u64/s64ShadowNinja2014-03-12
|
* Add minetest.set_noiseparam_defaults() Lua APIkwolekr2014-02-15
|
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
|
* Update Copyright YearsSfan52013-02-24
|
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
|
* Initially split utility.h to multiple files in util/Perttu Ahola2012-06-17
com"> LuaPseudoRandom */ class LuaPseudoRandom : public ModApiBase { private: PseudoRandom m_pseudo; static const char className[]; static const luaL_Reg methods[]; // Exported functions // garbage collector static int gc_object(lua_State *L); // next(self, min=0, max=32767) -> get next value static int l_next(lua_State *L); public: LuaPseudoRandom(s32 seed) : m_pseudo(seed) {} // LuaPseudoRandom(seed) // Creates an LuaPseudoRandom and leaves it on top of stack static int create_object(lua_State *L); static LuaPseudoRandom *checkobject(lua_State *L, int narg); static void Register(lua_State *L); }; /* LuaPcgRandom */ class LuaPcgRandom : public ModApiBase { private: PcgRandom m_rnd; static const char className[]; static const luaL_Reg methods[]; // Exported functions // garbage collector static int gc_object(lua_State *L); // next(self, min=-2147483648, max=2147483647) -> get next value static int l_next(lua_State *L); // rand_normal_dist(self, min=-2147483648, max=2147483647, num_trials=6) -> // get next normally distributed random value static int l_rand_normal_dist(lua_State *L); public: LuaPcgRandom(u64 seed) : m_rnd(seed) {} LuaPcgRandom(u64 seed, u64 seq) : m_rnd(seed, seq) {} // LuaPcgRandom(seed) // Creates an LuaPcgRandom and leaves it on top of stack static int create_object(lua_State *L); static LuaPcgRandom *checkobject(lua_State *L, int narg); static void Register(lua_State *L); }; /* LuaSecureRandom */ class LuaSecureRandom : public ModApiBase { private: static const size_t RAND_BUF_SIZE = 2048; static const char className[]; static const luaL_Reg methods[]; u32 m_rand_idx; char m_rand_buf[RAND_BUF_SIZE]; // Exported functions // garbage collector static int gc_object(lua_State *L); // next_bytes(self, count) -> get count many bytes static int l_next_bytes(lua_State *L); public: bool fillRandBuf(); // LuaSecureRandom() // Creates an LuaSecureRandom and leaves it on top of stack static int create_object(lua_State *L); static LuaSecureRandom *checkobject(lua_State *L, int narg); static void Register(lua_State *L); };