mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-16 08:18:14 +00:00
REVIEWED: Some compilation warnings (for strict rules)
This commit is contained in:
12
src/rcore.c
12
src/rcore.c
@@ -2755,8 +2755,9 @@ float GetFrameTime(void)
|
||||
// NOTE: On PLATFORM_DESKTOP, timer is initialized on glfwInit()
|
||||
double GetTime(void)
|
||||
{
|
||||
double time = 0.0;
|
||||
#if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
|
||||
return glfwGetTime(); // Elapsed time since glfwInit()
|
||||
time = glfwGetTime(); // Elapsed time since glfwInit()
|
||||
#endif
|
||||
|
||||
#if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_DRM)
|
||||
@@ -2764,8 +2765,9 @@ double GetTime(void)
|
||||
clock_gettime(CLOCK_MONOTONIC, &ts);
|
||||
unsigned long long int time = (unsigned long long int)ts.tv_sec*1000000000LLU + (unsigned long long int)ts.tv_nsec;
|
||||
|
||||
return (double)(time - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
|
||||
time = (double)(time - CORE.Time.base)*1e-9; // Elapsed time since InitTimer()
|
||||
#endif
|
||||
return time;
|
||||
}
|
||||
|
||||
// Setup window configuration flags (view FLAGS)
|
||||
@@ -3291,12 +3293,12 @@ unsigned char *DecompressData(const unsigned char *compData, int compDataSize, i
|
||||
|
||||
#if defined(SUPPORT_COMPRESSION_API)
|
||||
// Decompress data from a valid DEFLATE stream
|
||||
data = RL_CALLOC(MAX_DECOMPRESSION_SIZE*1024*1024, 1);
|
||||
data = (unsigned char *)RL_CALLOC(MAX_DECOMPRESSION_SIZE*1024*1024, 1);
|
||||
int length = sinflate(data, MAX_DECOMPRESSION_SIZE*1024*1024, compData, compDataSize);
|
||||
|
||||
// WARNING: RL_REALLOC can make (and leave) data copies in memory, be careful with sensitive compressed data!
|
||||
// TODO: Use a different approach, create another buffer, copy data manually to it and wipe original buffer memory
|
||||
unsigned char *temp = RL_REALLOC(data, length);
|
||||
unsigned char *temp = (unsigned char *)RL_REALLOC(data, length);
|
||||
|
||||
if (temp != NULL) data = temp;
|
||||
else TRACELOG(LOG_WARNING, "SYSTEM: Failed to re-allocate required decompression memory");
|
||||
@@ -3322,7 +3324,7 @@ char *EncodeDataBase64(const unsigned char *data, int dataSize, int *outputSize)
|
||||
|
||||
*outputSize = 4*((dataSize + 2)/3);
|
||||
|
||||
char *encodedData = RL_MALLOC(*outputSize);
|
||||
char *encodedData = (char *)RL_MALLOC(*outputSize);
|
||||
|
||||
if (encodedData == NULL) return NULL;
|
||||
|
||||
|
Reference in New Issue
Block a user