diff options
Diffstat (limited to 'redist')
-rw-r--r-- | redist/WinDriver.c | 2 | ||||
-rw-r--r-- | redist/json_helpers.c | 6 | ||||
-rw-r--r-- | redist/json_helpers.h | 2 | ||||
-rw-r--r-- | redist/linmath.c | 16 | ||||
-rw-r--r-- | redist/os_generic.c | 1 | ||||
-rw-r--r-- | redist/symbol_enumerator.c | 10 |
6 files changed, 21 insertions, 16 deletions
diff --git a/redist/WinDriver.c b/redist/WinDriver.c index a6dd1e6..3613150 100644 --- a/redist/WinDriver.c +++ b/redist/WinDriver.c @@ -220,7 +220,7 @@ void CNFGHandleInput() case WM_MBUTTONUP: HandleButton( (msg.lParam & 0xFFFF), (msg.lParam>>16) & 0xFFFF, 3, 0 ); break; case WM_KEYDOWN: case WM_KEYUP: - HandleKey( tolower( msg.wParam ), (msg.message==WM_KEYDOWN) ); + HandleKey( tolower( (int)msg.wParam ), (msg.message==WM_KEYDOWN) ); break; default: DispatchMessage(&msg); diff --git a/redist/json_helpers.c b/redist/json_helpers.c index e0b86f4..1e2f43e 100644 --- a/redist/json_helpers.c +++ b/redist/json_helpers.c @@ -107,7 +107,7 @@ void json_write_str(FILE* f, const char* tag, const char* v) { void (*json_begin_object)(char* tag) = NULL; void (*json_end_object)() = NULL; -void (*json_tag_value)(char* tag, char** values, uint16_t count) = NULL; +void (*json_tag_value)(char* tag, char** values, uint8_t count) = NULL; uint32_t JSON_STRING_LEN; @@ -146,7 +146,7 @@ static uint16_t json_load_array(const char* JSON_STRING, jsmntok_t* tokens, uint values[i] = substr(JSON_STRING, t->start, t->end, JSON_STRING_LEN); } - if (json_tag_value != NULL) json_tag_value(tag, values, i); + if (json_tag_value != NULL) json_tag_value(tag, values, (uint8_t)i); for (i=0;i<size;++i) free(values[i]); @@ -159,7 +159,7 @@ void json_load_file(const char* path) { char* JSON_STRING = load_file_to_mem(path); if (JSON_STRING==NULL) return; - JSON_STRING_LEN = strlen(JSON_STRING); + JSON_STRING_LEN = (uint32_t)strlen(JSON_STRING); jsmn_parser parser; jsmn_init(&parser); diff --git a/redist/json_helpers.h b/redist/json_helpers.h index 1670058..1cccfe3 100644 --- a/redist/json_helpers.h +++ b/redist/json_helpers.h @@ -14,7 +14,7 @@ void json_write_str(FILE* f, const char* tag, const char* v); void json_load_file(const char* path); extern void (*json_begin_object)(char* tag); extern void (*json_end_object)(); -extern void (*json_tag_value)(char* tag, char** values, uint16_t count); +extern void (*json_tag_value)(char* tag, char** values, uint8_t count); #endif
\ No newline at end of file diff --git a/redist/linmath.c b/redist/linmath.c index dd6bd15..eefcd5f 100644 --- a/redist/linmath.c +++ b/redist/linmath.c @@ -207,28 +207,28 @@ void quattomatrix(FLT * matrix44, const FLT * qin) void quatfrommatrix( FLT * q, const FLT * matrix44 ) { //Algorithm from http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/ - float tr = matrix44[0] + matrix44[5] + matrix44[10]; + FLT tr = matrix44[0] + matrix44[5] + matrix44[10]; if (tr > 0) { - float S = sqrt(tr+1.0) * 2; // S=4*qw - q[0] = 0.25 * S; + FLT S = FLT_SQRT(tr+1.0) * 2.; // S=4*qw + q[0] = 0.25f * S; q[1] = (matrix44[9] - matrix44[6]) / S; q[2] = (matrix44[2] - matrix44[8]) / S; q[3] = (matrix44[4] - matrix44[1]) / S; } else if ((matrix44[0] > matrix44[5])&(matrix44[0] > matrix44[10])) { - float S = sqrt(1.0 + matrix44[0] - matrix44[5] - matrix44[10]) * 2; // S=4*qx + FLT S = FLT_SQRT(1.0 + matrix44[0] - matrix44[5] - matrix44[10]) * 2.; // S=4*qx q[0] = (matrix44[9] - matrix44[6]) / S; - q[1] = 0.25 * S; + q[1] = 0.25f * S; q[2] = (matrix44[1] + matrix44[4]) / S; q[3] = (matrix44[2] + matrix44[8]) / S; } else if (matrix44[5] > matrix44[10]) { - float S = sqrt(1.0 + matrix44[5] - matrix44[0] - matrix44[10]) * 2; // S=4*qy + FLT S = FLT_SQRT(1.0 + matrix44[5] - matrix44[0] - matrix44[10]) * 2.; // S=4*qy q[0] = (matrix44[2] - matrix44[8]) / S; q[1] = (matrix44[1] + matrix44[4]) / S; - q[2] = 0.25 * S; + q[2] = 0.25f * S; q[3] = (matrix44[6] + matrix44[9]) / S; } else { - float S = sqrt(1.0 + matrix44[10] - matrix44[0] - matrix44[5]) * 2; // S=4*qz + FLT S = FLT_SQRT(1.0 + matrix44[10] - matrix44[0] - matrix44[5]) * 2.; // S=4*qz q[0] = (matrix44[4] - matrix44[1]) / S; q[1] = (matrix44[2] + matrix44[8]) / S; q[2] = (matrix44[6] + matrix44[9]) / S; diff --git a/redist/os_generic.c b/redist/os_generic.c index 0993d7a..1ab4863 100644 --- a/redist/os_generic.c +++ b/redist/os_generic.c @@ -55,6 +55,7 @@ void * OGJoinThread( og_thread_t ot ) { WaitForSingleObject( ot, INFINITE ); CloseHandle( ot ); + return 0; } void OGCancelThread( og_thread_t ot ) diff --git a/redist/symbol_enumerator.c b/redist/symbol_enumerator.c index 7d33900..fcb3727 100644 --- a/redist/symbol_enumerator.c +++ b/redist/symbol_enumerator.c @@ -51,9 +51,13 @@ BOOL WINAPI SymEnumSymbols( ); BOOL WINAPI SymInitialize( - HANDLE hProcess, - PCTSTR UserSearchPath, - BOOL fInvadeProcess + HANDLE hProcess, + PCTSTR UserSearchPath, + BOOL fInvadeProcess +); + +BOOL WINAPI SymCleanup( + HANDLE hProcess ); BOOL CALLBACK __cdecl mycb( |