aboutsummaryrefslogtreecommitdiff
path: root/src/util/numeric.h
Commit message (Expand)AuthorAge
* Add Lua methods 'set_rotation()' and 'get_rotation()' (#7395)CoderForTheBetter2018-11-28
* Light curve: Simplify and improve code, fix darkened daytime sky (#7693)Vitaliy2018-09-16
* Smoothed yaw rotation for objects (#6825)SmallJoker2018-08-02
* Revert "Add an active object step time budget #6721"Lars Hofhansl2018-01-12
* Fix rounding error in g/set_node caused by truncation to floatrubenwardy2017-12-26
* Add an active object step time budget #6721Lars Hofhansl2017-12-06
* Allow zoom to actually show more data.Lars Hofhansl2017-11-15
* Move files to subdirectories (#6599)Vitaliy2017-11-08
* Change BS constant from implicit double to float (#6286)Jens Rottmann2017-08-20
* Modernize source code: last part (#6285)Loïc Blot2017-08-20
* C++ modernize: Pragma once (#6264)Loïc Blot2017-08-17
* C++11 cleanup on constructors (#6000)Vincent Glize2017-06-19
* Use C++11 mutexes only (remove compat code) (#5922)Loïc Blot2017-06-06
* Fix myfloor(0.0)ShadowNinja2017-05-06
* Clean up numeric.h and split FacePositionCache from itShadowNinja2017-05-06
* Minimap: Optimisenumber Zero2017-03-11
* use unordered containers where possible (patch 4 on X)Loic Blot2016-10-06
* v2d & aabbox3d<f32> & sky cleanupsnerzhul2016-02-11
* Rename and move basicmacros.h to util/basic_macros.hest312015-11-02
* Move basic, non-numeric macros from util/numeric.h to basicmacros.hkwolekr2015-10-27
* Clean up threadingShadowNinja2015-08-23
* src/util/numeric.{cpp,h}: Fix FacePositionCache data raceBřetislav Štec2015-08-02
* Fix several MSVC issues numeric.hSmallJoker2015-05-01
* Clean scaling pre-filter for formspec/HUD.Aaron Suen2015-04-01
* Fix set_bitskwolekr2015-03-31
* GenElementManager: Pass opaque handles to Lua and rename to ObjDefManagerkwolekr2015-03-31
* Add support for the PCG32 PRNG algo (and associated script APIs)kwolekr2015-03-22
* Fix wrapDegrees family of functionsCraig Robbins2015-02-23
* Performance Improvement: Use a cache which caches result for getFacePositions.Loic Blot2015-02-16
* Water fixesgregorycu2015-01-18
* Remove unused rangelim function (the macro still exists)Kahrl2014-11-19
* Implement WieldMeshSceneNode which improves wield mesh renderingKahrl2014-11-08
* Refactor decoration-related codekwolekr2014-10-29
* Accept hexadecimal and string values for seedskwolekr2013-11-04
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
* Weather supportproller2013-07-27
* Decoration: Add Schematic decoration typekwolekr2013-06-22
* Migrate to STL containers/algorithms.Ilya Zhuravlev2013-03-11
* Update Copyright YearsSfan52013-02-24
* Change Minetest-c55 to MinetestPilzAdam2013-02-24
* The new mapgen, noise functions, et al.kwolekr2013-01-21
* Optimize headersPerttu Ahola2012-06-17
* Initially split utility.h to multiple files in util/Perttu Ahola2012-06-17
s="hl opt">::endl; errorstream << file << ":" << line << ": " << function << ": A fatal error occurred: " << msg << std::endl; abort(); } #ifdef _MSC_VER const char *Win32ExceptionCodeToString(DWORD exception_code) { switch (exception_code) { case EXCEPTION_ACCESS_VIOLATION: return "Access violation"; case EXCEPTION_DATATYPE_MISALIGNMENT: return "Misaligned data access"; case EXCEPTION_BREAKPOINT: return "Breakpoint reached"; case EXCEPTION_SINGLE_STEP: return "Single debug step"; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: return "Array access out of bounds"; case EXCEPTION_FLT_DENORMAL_OPERAND: return "Denormal floating point operand"; case EXCEPTION_FLT_DIVIDE_BY_ZERO: return "Floating point division by zero"; case EXCEPTION_FLT_INEXACT_RESULT: return "Inaccurate floating point result"; case EXCEPTION_FLT_INVALID_OPERATION: return "Invalid floating point operation"; case EXCEPTION_FLT_OVERFLOW: return "Floating point exponent overflow"; case EXCEPTION_FLT_STACK_CHECK: return "Floating point stack overflow or underflow"; case EXCEPTION_FLT_UNDERFLOW: return "Floating point exponent underflow"; case EXCEPTION_INT_DIVIDE_BY_ZERO: return "Integer division by zero"; case EXCEPTION_INT_OVERFLOW: return "Integer overflow"; case EXCEPTION_PRIV_INSTRUCTION: return "Privileged instruction executed"; case EXCEPTION_IN_PAGE_ERROR: return "Could not access or load page"; case EXCEPTION_ILLEGAL_INSTRUCTION: return "Illegal instruction encountered"; case EXCEPTION_NONCONTINUABLE_EXCEPTION: return "Attempted to continue after fatal exception"; case EXCEPTION_STACK_OVERFLOW: return "Stack overflow"; case EXCEPTION_INVALID_DISPOSITION: return "Invalid disposition returned to the exception dispatcher"; case EXCEPTION_GUARD_PAGE: return "Attempted guard page access"; case EXCEPTION_INVALID_HANDLE: return "Invalid handle"; } return "Unknown exception"; } long WINAPI Win32ExceptionHandler(struct _EXCEPTION_POINTERS *pExceptInfo) { char buf[512]; MINIDUMP_EXCEPTION_INFORMATION mdei; MINIDUMP_USER_STREAM_INFORMATION mdusi; MINIDUMP_USER_STREAM mdus; bool minidump_created = false; std::string dumpfile = porting::path_user + DIR_DELIM PROJECT_NAME ".dmp"; std::string version_str(PROJECT_NAME " "); version_str += g_version_hash; HANDLE hFile = CreateFileA(dumpfile.c_str(), GENERIC_WRITE, FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) goto minidump_failed; if (SetEndOfFile(hFile) == FALSE) goto minidump_failed; mdei.ClientPointers = NULL; mdei.ExceptionPointers = pExceptInfo; mdei.ThreadId = GetCurrentThreadId(); mdus.Type = CommentStreamA; mdus.BufferSize = version_str.size(); mdus.Buffer = (PVOID)version_str.c_str(); mdusi.UserStreamArray = &mdus; mdusi.UserStreamCount = 1; if (MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, MiniDumpNormal, &mdei, &mdusi, NULL) == FALSE) goto minidump_failed; minidump_created = true; minidump_failed: CloseHandle(hFile); DWORD excode = pExceptInfo->ExceptionRecord->ExceptionCode; _snprintf(buf, sizeof(buf), " >> === FATAL ERROR ===\n" " >> %s (Exception 0x%08X) at 0x%p\n", Win32ExceptionCodeToString(excode), excode, pExceptInfo->ExceptionRecord->ExceptionAddress); dstream << buf; if (minidump_created) dstream << " >> Saved dump to " << dumpfile << std::endl; else dstream << " >> Failed to save dump" << std::endl; return EXCEPTION_EXECUTE_HANDLER; } #endif void debug_set_exception_handler() { #ifdef _MSC_VER SetUnhandledExceptionFilter(Win32ExceptionHandler); #endif }