From 763a7e23eb2148879b004f0e3dda9f855672bc08 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Wed, 19 May 2021 07:27:29 +1000 Subject: [PATCH] Less compiler warnings --- readme.md | 12 ++++++------ src/ExtMath.c | 24 +++++++++++------------- src/Platform.c | 5 +++-- 3 files changed, 20 insertions(+), 21 deletions(-) diff --git a/readme.md b/readme.md index bcf57a05f..6e44530c6 100644 --- a/readme.md +++ b/readme.md @@ -169,9 +169,9 @@ Further information (e.g. style) for the game's source code can be found in the ## Open source technologies -* curl - HTTP/HTTPS for linux and macOS -* FreeType - Font handling for all platforms -* GCC - Compiles client for linux -* MinGW-w64 - Compiles client for windows -* Clang - Compiles client for macOS -* Emscripten - Compiles client for web +* [curl](https://curl.se/) - HTTP/HTTPS for linux and macOS +* [FreeType](https://www.freetype.org/) - Font handling for all platforms +* [GCC](https://gcc.gnu.org/) - Compiles client for linux +* [MinGW-w64](http://mingw-w64.org/doku.php) - Compiles client for windows +* [Clang](https://clang.llvm.org/) - Compiles client for macOS +* [Emscripten](https://emscripten.org/) - Compiles client for web diff --git a/src/ExtMath.c b/src/ExtMath.c index b37fa472b..376fb4060 100644 --- a/src/ExtMath.c +++ b/src/ExtMath.c @@ -17,8 +17,6 @@ int Math_AbsI(int x) { return abs(x); /* MSVC intrinsic */ } double Math_Sin(double x) { return sin(x); } double Math_Cos(double x) { return cos(x); } -double Math_Log(double x) { return log(x); } -double Math_Exp(double x) { return exp(x); } float Math_SinF(float x) { return (float)Math_Sin(x); } float Math_CosF(float x) { return (float)Math_Cos(x); } @@ -76,23 +74,23 @@ cc_bool Math_IsPowOf2(int value) { return value != 0 && (value & (value - 1)) == 0; } -double Math_FastLog(double x) { +double Math_Log(double x) { /* x = 2^exp * mantissa */ - /* so log(x) = log(2^exp) + log(mantissa) */ - /* so log(x) = exp*log(2) + log(mantissa) */ - + /* so log(x) = log(2^exp) + log(mantissa) */ + /* so log(x) = exp*log(2) + log(mantissa) */ /* now need to work out log(mantissa) */ - return 0; + + return log(x); } -double Math_FastExp(double x) { +double Math_Exp(double x) { /* let x = k*log(2) + f, where k is integer */ - /* so exp(x) = exp(k*log(2)) * exp(f) */ - /* so exp(x) = exp(log(2^k)) * exp(f) */ - /* so exp(x) = 2^k * exp(f) */ - + /* so exp(x) = exp(k*log(2)) * exp(f) */ + /* so exp(x) = exp(log(2^k)) * exp(f) */ + /* so exp(x) = 2^k * exp(f) */ /* now need to work out exp(f) */ - return 0; + + return exp(x); } diff --git a/src/Platform.c b/src/Platform.c index d08fb9586..bd789c1fc 100644 --- a/src/Platform.c +++ b/src/Platform.c @@ -1092,8 +1092,9 @@ cc_result Process_StartOpen(const cc_string* args) { cc_uintptr res; Platform_EncodeUtf16(str, args); - res = ShellExecuteW(NULL, NULL, str, NULL, NULL, SW_SHOWNORMAL); - /* MSDN: "If the function succeeds, it returns a value greater than 32. If the function fails, it returns an error value that indicates the cause of the failure" */ + res = (cc_uintptr)ShellExecuteW(NULL, NULL, str, NULL, NULL, SW_SHOWNORMAL); + /* MSDN: "If the function succeeds, it returns a value greater than 32. If the function fails, */ + /* it returns an error value that indicates the cause of the failure" */ return res > 32 ? 0 : (cc_result)res; } #elif defined CC_BUILD_WEB