summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2021-03-04 20:22:58 +0100
committerRay <[email protected]>2021-03-04 20:22:58 +0100
commit7ad1370193cf963b4142f480130a77803e9e682e (patch)
treef5d55609a1faa672ec318f606cfa2a18dc48de40
parent1ed72b7812ba1749107d1f20fbfe331e54acf1a2 (diff)
downloadraylib-7ad1370193cf963b4142f480130a77803e9e682e.tar.gz
raylib-7ad1370193cf963b4142f480130a77803e9e682e.zip
Some naming tweaks
-rw-r--r--src/rlgl.h14
-rw-r--r--src/utils.c16
2 files changed, 15 insertions, 15 deletions
diff --git a/src/rlgl.h b/src/rlgl.h
index 4fba9736..d77608d8 100644
--- a/src/rlgl.h
+++ b/src/rlgl.h
@@ -4915,21 +4915,21 @@ char *LoadFileText(const char *fileName)
if (fileName != NULL)
{
- FILE *textFile = fopen(fileName, "rt");
+ FILE *file = fopen(fileName, "rt");
- if (textFile != NULL)
+ if (file != NULL)
{
// WARNING: When reading a file as 'text' file,
// text mode causes carriage return-linefeed translation...
// ...but using fseek() should return correct byte-offset
- fseek(textFile, 0, SEEK_END);
- int size = ftell(textFile);
- fseek(textFile, 0, SEEK_SET);
+ fseek(file, 0, SEEK_END);
+ int size = ftell(file);
+ fseek(file, 0, SEEK_SET);
if (size > 0)
{
text = (char *)RL_MALLOC((size + 1)*sizeof(char));
- int count = (int)fread(text, sizeof(char), size, textFile);
+ int count = (int)fread(text, sizeof(char), size, file);
// WARNING: \r\n is converted to \n on reading, so,
// read bytes count gets reduced by the number of lines
@@ -4942,7 +4942,7 @@ char *LoadFileText(const char *fileName)
}
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read text file", fileName);
- fclose(textFile);
+ fclose(file);
}
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open text file", fileName);
}
diff --git a/src/utils.c b/src/utils.c
index 7c9fa41d..000be373 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -45,7 +45,7 @@
#include <android/asset_manager.h> // Required for: Android assets manager: AAsset, AAssetManager_open(), ...
#endif
-#include <stdlib.h> // Required for: exit()
+#include <stdlib.h> // Required for: exit(), FILE, fopen(), fseek(), ftell(), fread(), fwrite(), fprintf(), fclose()
#include <stdio.h> // Required for: vprintf()
#include <stdarg.h> // Required for: va_list, va_start(), va_end()
#include <string.h> // Required for: strcpy(), strcat()
@@ -289,21 +289,21 @@ char *LoadFileText(const char *fileName)
if (fileName != NULL)
{
- FILE *textFile = fopen(fileName, "rt");
+ FILE *file = fopen(fileName, "rt");
- if (textFile != NULL)
+ if (file != NULL)
{
// WARNING: When reading a file as 'text' file,
// text mode causes carriage return-linefeed translation...
// ...but using fseek() should return correct byte-offset
- fseek(textFile, 0, SEEK_END);
- unsigned int size = (unsigned int)ftell(textFile);
- fseek(textFile, 0, SEEK_SET);
+ fseek(file, 0, SEEK_END);
+ unsigned int size = (unsigned int)ftell(file);
+ fseek(file, 0, SEEK_SET);
if (size > 0)
{
text = (char *)RL_MALLOC((size + 1)*sizeof(char));
- unsigned int count = (unsigned int)fread(text, sizeof(char), size, textFile);
+ unsigned int count = (unsigned int)fread(text, sizeof(char), size, file);
// WARNING: \r\n is converted to \n on reading, so,
// read bytes count gets reduced by the number of lines
@@ -316,7 +316,7 @@ char *LoadFileText(const char *fileName)
}
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to read text file", fileName);
- fclose(textFile);
+ fclose(file);
}
else TRACELOG(LOG_WARNING, "FILEIO: [%s] Failed to open text file", fileName);
}