REVIEWED: Some compilation warnings (for strict rules)

This commit is contained in:
Ray
2022-11-28 14:16:59 +01:00
parent 2fd6d7e8c0
commit fc5894e734
2 changed files with 22 additions and 20 deletions

View File

@@ -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;