summaryrefslogtreecommitdiffhomepage
path: root/src/rcore.c
diff options
context:
space:
mode:
authorRay <[email protected]>2024-02-04 11:33:38 +0100
committerRay <[email protected]>2024-02-04 11:33:38 +0100
commitf033b307030f00e1ae3875fb22de3f86cc4282c3 (patch)
tree00d72e28a9a0836b8605c3eab6cc8ac0cac0d52a /src/rcore.c
parentd91e9104aab9ef329ac946d37033578c6becec78 (diff)
downloadraylib-f033b307030f00e1ae3875fb22de3f86cc4282c3.tar.gz
raylib-f033b307030f00e1ae3875fb22de3f86cc4282c3.zip
Review formating and some defines naming consistency
Diffstat (limited to 'src/rcore.c')
-rw-r--r--src/rcore.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/rcore.c b/src/rcore.c
index 8dc14c3b..784b9b62 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -1840,7 +1840,7 @@ bool FileExists(const char *fileName)
// NOTE: Extensions checking is not case-sensitive
bool IsFileExtension(const char *fileName, const char *ext)
{
- #define MAX_FILE_EXTENSION_SIZE 16
+ #define MAX_FILE_EXTENSION_LENGTH 16
bool result = false;
const char *fileExt = GetFileExtension(fileName);
@@ -1851,8 +1851,8 @@ bool IsFileExtension(const char *fileName, const char *ext)
int extCount = 0;
const char **checkExts = TextSplit(ext, ';', &extCount); // WARNING: Module required: rtext
- char fileExtLower[MAX_FILE_EXTENSION_SIZE + 1] = { 0 };
- strncpy(fileExtLower, TextToLower(fileExt), MAX_FILE_EXTENSION_SIZE); // WARNING: Module required: rtext
+ char fileExtLower[MAX_FILE_EXTENSION_LENGTH + 1] = { 0 };
+ strncpy(fileExtLower, TextToLower(fileExt), MAX_FILE_EXTENSION_LENGTH); // WARNING: Module required: rtext
for (int i = 0; i < extCount; i++)
{
@@ -1946,16 +1946,17 @@ const char *GetFileName(const char *filePath)
// Get filename string without extension (uses static string)
const char *GetFileNameWithoutExt(const char *filePath)
{
- #define MAX_FILENAMEWITHOUTEXT_LENGTH 256
+ #define MAX_FILENAME_LENGTH 256
- static char fileName[MAX_FILENAMEWITHOUTEXT_LENGTH] = { 0 };
- memset(fileName, 0, MAX_FILENAMEWITHOUTEXT_LENGTH);
+ static char fileName[MAX_FILENAME_LENGTH] = { 0 };
+ memset(fileName, 0, MAX_FILENAME_LENGTH);
if (filePath != NULL)
{
strcpy(fileName, GetFileName(filePath)); // Get filename.ext without path
int size = (int)strlen(fileName); // Get size in bytes
- for (int i = size; i>0; i--) // Reverse search '.'
+
+ for (int i = size; i > 0; i--) // Reverse search '.'
{
if (fileName[i] == '.')
{
@@ -1965,6 +1966,7 @@ const char *GetFileNameWithoutExt(const char *filePath)
}
}
}
+
return fileName;
}