Less compiler warnings

This commit is contained in:
UnknownShadow200 2021-05-19 07:27:29 +10:00
parent ed43827a4e
commit 763a7e23eb
3 changed files with 20 additions and 21 deletions

View File

@ -169,9 +169,9 @@ Further information (e.g. style) for the game's source code can be found in the
## Open source technologies ## Open source technologies
* curl - HTTP/HTTPS for linux and macOS * [curl](https://curl.se/) - HTTP/HTTPS for linux and macOS
* FreeType - Font handling for all platforms * [FreeType](https://www.freetype.org/) - Font handling for all platforms
* GCC - Compiles client for linux * [GCC](https://gcc.gnu.org/) - Compiles client for linux
* MinGW-w64 - Compiles client for windows * [MinGW-w64](http://mingw-w64.org/doku.php) - Compiles client for windows
* Clang - Compiles client for macOS * [Clang](https://clang.llvm.org/) - Compiles client for macOS
* Emscripten - Compiles client for web * [Emscripten](https://emscripten.org/) - Compiles client for web

View File

@ -17,8 +17,6 @@ int Math_AbsI(int x) { return abs(x); /* MSVC intrinsic */ }
double Math_Sin(double x) { return sin(x); } double Math_Sin(double x) { return sin(x); }
double Math_Cos(double x) { return cos(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_SinF(float x) { return (float)Math_Sin(x); }
float Math_CosF(float x) { return (float)Math_Cos(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; return value != 0 && (value & (value - 1)) == 0;
} }
double Math_FastLog(double x) { double Math_Log(double x) {
/* x = 2^exp * mantissa */ /* x = 2^exp * mantissa */
/* so log(x) = log(2^exp) + log(mantissa) */ /* so log(x) = log(2^exp) + log(mantissa) */
/* so log(x) = exp*log(2) + log(mantissa) */ /* so log(x) = exp*log(2) + log(mantissa) */
/* now need to work out 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 */ /* let x = k*log(2) + f, where k is integer */
/* so exp(x) = exp(k*log(2)) * exp(f) */ /* so exp(x) = exp(k*log(2)) * exp(f) */
/* so exp(x) = exp(log(2^k)) * exp(f) */ /* so exp(x) = exp(log(2^k)) * exp(f) */
/* so exp(x) = 2^k * exp(f) */ /* so exp(x) = 2^k * exp(f) */
/* now need to work out exp(f) */ /* now need to work out exp(f) */
return 0;
return exp(x);
} }

View File

@ -1092,8 +1092,9 @@ cc_result Process_StartOpen(const cc_string* args) {
cc_uintptr res; cc_uintptr res;
Platform_EncodeUtf16(str, args); Platform_EncodeUtf16(str, args);
res = ShellExecuteW(NULL, NULL, str, NULL, NULL, SW_SHOWNORMAL); 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" */ /* 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; return res > 32 ? 0 : (cc_result)res;
} }
#elif defined CC_BUILD_WEB #elif defined CC_BUILD_WEB