浏览代码

Review formating and signegness issues

raysan5 5 年之前
父节点
当前提交
e8a8d544c5
共有 3 个文件被更改,包括 14 次插入14 次删除
  1. 10 10
      src/core.c
  2. 1 1
      src/text.c
  3. 3 3
      src/textures.c

+ 10 - 10
src/core.c

@@ -16,7 +16,7 @@
 *
 *
 *   #define PLATFORM_DESKTOP
 *   #define PLATFORM_DESKTOP
 *       Windowing and input system configured for desktop platforms: Windows, Linux, OSX, FreeBSD, OpenBSD, NetBSD, DragonFly
 *       Windowing and input system configured for desktop platforms: Windows, Linux, OSX, FreeBSD, OpenBSD, NetBSD, DragonFly
-*       NOTE: Oculus Ritf CV1 requires PLATFORM_DESKTOP for mirror rendering - View [rlgl] module to enable it
+*       NOTE: Oculus Rift CV1 requires PLATFORM_DESKTOP for mirror rendering - View [rlgl] module to enable it
 *
 *
 *   #define PLATFORM_ANDROID
 *   #define PLATFORM_ANDROID
 *       Windowing and input system configured for Android device, app activity managed internally in this module.
 *       Windowing and input system configured for Android device, app activity managed internally in this module.
@@ -2226,19 +2226,18 @@ void SaveStorageValue(unsigned int position, int value)
             else
             else
             {
             {
                 // RL_REALLOC failed
                 // RL_REALLOC failed
-                TRACELOG(LOG_WARNING, "FILEIO: Position in bytes (%u) bigger than actual size of file [%s] (%u) Realloc function FAIL",position*sizeof(int),path,dataSize);  
+                TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to realloc data (%u), position in bytes (%u) bigger than actual file size", path, dataSize, position*sizeof(int));  
                 
                 
-                // We store the old size of the file.
-                newFileData=fileData;
-                newDataSize=dataSize;
+                // We store the old size of the file
+                newFileData = fileData;
+                newDataSize = dataSize;
             }
             }
-            
         }
         }
         else
         else
         {
         {
-            // We store the old size of the file.
-            newFileData=fileData;
-            newDataSize=dataSize;
+            // Store the old size of the file
+            newFileData = fileData;
+            newDataSize = dataSize;
 
 
             // Replace value on selected position
             // Replace value on selected position
             int *dataPtr = (int *)newFileData;
             int *dataPtr = (int *)newFileData;
@@ -2250,7 +2249,8 @@ void SaveStorageValue(unsigned int position, int value)
     }
     }
     else
     else
     {
     {
-        TRACELOG(LOG_INFO, "FILEIO: [%s] File not found, creating it.",path);  
+        TRACELOG(LOG_INFO, "FILEIO: [%s] File not found, creating it", path);
+
         dataSize = (position + 1)*sizeof(int);
         dataSize = (position + 1)*sizeof(int);
         fileData = (unsigned char *)RL_MALLOC(dataSize);
         fileData = (unsigned char *)RL_MALLOC(dataSize);
         int *dataPtr = (int *)fileData;
         int *dataPtr = (int *)fileData;

+ 1 - 1
src/text.c

@@ -495,7 +495,7 @@ CharInfo *LoadFontData(const char *fileName, int fontSize, int *fontChars, int c
     // Load font data (including pixel data) from TTF file
     // Load font data (including pixel data) from TTF file
     // NOTE: Loaded information should be enough to generate
     // NOTE: Loaded information should be enough to generate
     // font image atlas, using any packaging method
     // font image atlas, using any packaging method
-    int dataSize = 0;
+    unsigned int dataSize = 0;
     unsigned char *fileData = LoadFileData(fileName, &dataSize);
     unsigned char *fileData = LoadFileData(fileName, &dataSize);
 
 
     if (fileData != NULL)
     if (fileData != NULL)

+ 3 - 3
src/textures.c

@@ -235,7 +235,7 @@ Image LoadImage(const char *fileName)
 #if defined(STBI_REQUIRED)
 #if defined(STBI_REQUIRED)
         // NOTE: Using stb_image to load images (Supports multiple image formats)
         // NOTE: Using stb_image to load images (Supports multiple image formats)
 
 
-        int dataSize = 0;
+        unsigned int dataSize = 0;
         unsigned char *fileData = LoadFileData(fileName, &dataSize);
         unsigned char *fileData = LoadFileData(fileName, &dataSize);
 
 
         if (fileData != NULL)
         if (fileData != NULL)
@@ -354,7 +354,7 @@ Image LoadImageRaw(const char *fileName, int width, int height, int format, int
 {
 {
     Image image = { 0 };
     Image image = { 0 };
 
 
-    int dataSize = 0;
+    unsigned int dataSize = 0;
     unsigned char *fileData = LoadFileData(fileName, &dataSize);
     unsigned char *fileData = LoadFileData(fileName, &dataSize);
 
 
     if (fileData != NULL)
     if (fileData != NULL)
@@ -3059,7 +3059,7 @@ static Image LoadAnimatedGIF(const char *fileName, int *frames, int **delays)
 {
 {
     Image image = { 0 };
     Image image = { 0 };
 
 
-    int dataSize = 0;
+    unsigned int dataSize = 0;
     unsigned char *fileData = LoadFileData(fileName, &dataSize);
     unsigned char *fileData = LoadFileData(fileName, &dataSize);
 
 
     if (fileData != NULL)
     if (fileData != NULL)