aboutsummaryrefslogtreecommitdiff
path: root/src/util
AgeCommit message (Collapse)Author
2015-11-02Rename and move basicmacros.h to util/basic_macros.hest31
2015-10-27Move basic, non-numeric macros from util/numeric.h to basicmacros.hkwolekr
2015-10-15Add BufReader and vector-based serialization methodskwolekr
2015-10-14Rename macros with two leading underscoresShadowNinja
These names are reserved for the compiler/library implementations.
2015-10-14Always use errorstream for DEBUG_EXCEPTION_HANDLERShadowNinja
2015-09-30Fix some SRP issuesest31
-> Remove memory allocation bugs -> Merge changes from upstream, enabling customizeable memory allocation
2015-08-23Clean up threadingShadowNinja
* Rename everything. * Strip J prefix. * Change UpperCamelCase functions to lowerCamelCase. * Remove global (!) semaphore count mutex on OSX. * Remove semaphore count getter (unused, unsafe, depended on internal API functions on Windows, and used a hack on OSX). * Add `Atomic<type>`. * Make `Thread` handle thread names. * Add support for C++11 multi-threading. * Combine pthread and win32 sources. * Remove `ThreadStarted` (unused, unneeded). * Move some includes from the headers to the sources. * Move all of `Event` into its header (allows inlining with no new includes). * Make `Event` use `Semaphore` (except on Windows). * Move some porting functions into `Thread`. * Integrate logging with `Thread`. * Add threading test.
2015-08-19Fix indianred and indigo of color-stringRui
2015-08-19Android: bypass broken wide_to_utf8 with wide_to_narrow (again)est31
This bypass had to be re-enabled as some users reported issues, even after the iconv build fix. While utf8_to_wide works well, wide_to_utf8 is quite broken on android, for some reason, and some devices (unrelated from build configuration).
2015-08-06Fix BufferedPacket race condition (fixes #2983)kwolekr
This was caused by the use the non-threadsafe SharedBuffer in a threaded context.
2015-08-06Initialize random for verification key generation tooest31
2015-08-02src/util/numeric.{cpp,h}: Fix FacePositionCache data raceBřetislav Štec
2015-08-01Improve accuracy and safety of float serializationkwolekr
Multiplying by a factor of 1/1000.f (rather than dividing by 1000.f) directly introduces an error of 1 ULP. With this patch, an exact comparison of a floating point literal with the deserialized F1000 form representing it is now guaranteed to be successful. In addition, the maxmium and minimum safely representible floating point numbers are now well-defined as constants.
2015-08-01Clean up util/serialization.{cpp,h} and add unit testskwolekr
2015-07-29Android: fix horrible libiconv buildest31
Before, our libiconv build was a joke. We first called configure for our own build host system, then called make, before we executed a Android.mk script we provided as patch. The first "native make" always failed, and the LIBICONV_LIB file setting in our Makefile didn't match the built one, resulting in an always-rebuild of iconv. This commit cleans up this total mess, removes the double-build, and the Android.mk, and properly calls ./configure with the according target platform, and uses a built toolchain. As we have to deal with the android bug "NDK: Support for prebuild libs with full sonames" https://code.google.com/p/android/issues/detail?id=55868 as the 2013 patch https://lists.gnu.org/archive/html/libtool-patches/2013-06/msg00002.html by Google's David Turner wasn't inside the 2011 libtool, we pass -avoid-version to libtool. Thanks to the proper build, wide_to_utf8 works for android now, removing us of the need to disable it.
2015-07-27Add AreaStore data structureest31
2015-07-24Check output of mpz_set_str and fix leak on error conditionest31
Also add static identifier as upstream did
2015-07-24Remove some old dead code. Fix some Clang warnings in SRP (ng->N... willLoic Blot
always evaluate to true.
2015-07-21Clarify docs for auth.cpp methodest31
2015-07-14Increase limit of serialized long stringskwolekr
2015-07-13Add more robust error checking to deSerialize*String routineskwolekr
Add serializeHexString() Clean up util/serialize.cpp
2015-07-10Misc. minor fixeskwolekr
2015-07-08Use UTF-8 instead of narrowest31
Use wide_to_utf8 and utf8_to_wide instead of wide_to_narrow and narrow_to_wide at almost all places. Only exceptions: test functions for narrow conversion, and chat, which is done in a separate commit.
2015-06-29Add UpdateThread and use it for minimap and mesh threadsest31
2015-06-29Fix *BSD build with GNU iconvkwolekr
2015-06-23Fix string conversion error messageest31
2015-06-20More correct wrap_rows implementationfigec
2015-06-18Fix wrap_rows at inner byte of multibyte sequencefigec
Also fix UTF-8 inner byte bounds and make unittest for case this fixes.
2015-06-17Make wrap_rows not wrap inside utf-8 multibyte sequencesest31
Also count multibyte sequences as "one" character. Adds unittest for the bug reporter's case. Fixes #2796.
2015-06-17Fail iconv call gracefullyest31
No freezing when inbuf_size doesn't decrease over time.
2015-06-14Android: bypass broken wide_to_utf8 with wide_to_narrowest31
While utf8_to_wide works well, wide_to_utf8 is quite broken on android, for some reason.
2015-06-13Add utf-8 conversion utilities and re-add intlGUIEditBoxest31
2015-05-18Split ObjDef/ObjDefManager out to objdef.cppkwolekr
2015-05-11Make early protocol auth mechanism generic, and add SRPest31
Adds everything needed for SRP (and everything works too), but still deactivated, as protocol v25 init packets aren't final yet. Can be activated by changing the LATEST_PROTOCOL_VERSION header to 25 inside networkprotocol.h.
2015-05-01Fix several MSVC issues numeric.hSmallJoker
-> Round negative numbers correctly CMakeLists.txt -> Link Json with the static run-time library
2015-04-26Fix fast leaves with texture_clean_transparent enabled.Aaron Suen
2015-04-17Refactor around translatePasswordest31
Change types for passed password from wstring to string, which removes converting back and forth in most cases. Move the narrow_to_wide conversion, where its neccessary, closer to irrlicht. Remove trailing spaces in guiPasswordChange.cpp. Make parameters for translatePassword passed as const reference.
2015-04-01Clean scaling pre-filter for formspec/HUD.Aaron Suen
2015-03-31Fix set_bitskwolekr
2015-03-31GenElementManager: Pass opaque handles to Lua and rename to ObjDefManagerkwolekr
Add core.clear_registered_schematics() and refactor schematics somewhat
2015-03-27Clean up and tweak build systemShadowNinja
* Combine client and server man pages. * Update unit test options and available databases in man page. * Add `--worldname` to man page. * Fix a bunch of places where `"Minetest"` was used directly instead of `PROJECT_NAME`. * Disable server build by default on all operating systems. * Make `ENABLE_FREETYPE` not fail if FreeType isn't found. * Enable LevelDB, Redis, and FreeType detection by default. * Remove the `VERSION_PATCH_ORIG` hack. * Add option to search for and use system JSONCPP. * Remove broken LuaJIT version detection. * Rename `DISABLE_LUAJIT` to `ENABLE_LUAJIT`. * Rename `minetest_*` variables in `version.{h,cpp}` to `g_*`. * Clean up style of CMake files.
2015-03-22Add support for the PCG32 PRNG algo (and associated script APIs)kwolekr
2015-03-17MutexedQueue inherits must use std::deque instead of std::listLoic Blot
2015-03-07For usages of assert() that are meant to persist in Release builds (when ↵Craig Robbins
NDEBUG is defined), replace those usages with persistent alternatives
2015-03-07Fix Android text bug (no text displaying)Craig Robbins
2015-03-05Remove Queue class which uses std::list and use native std::queueLoic Blot
2015-03-04Use std::vector instead of std::list in StaticObjectList and ↵Loic Blot
MutexedMap::getValues()
2015-03-02Fix narrow_to_wide_c (ANDROID)Craig Robbins
* Ensure converted string is NUL terminated * Restore logic to that used prior to 9e2a9b5
2015-02-27Fix minor memory leak (Android)Craig Robbins
2015-02-23Fix wrapDegrees family of functionsCraig Robbins
wrapDegrees() (renamed to modulo360f) wrapDegrees_0_360 wrapDegrees_180 Minor errors were present in previous versions; see issue #2328