Skip to content

Commit f033b30

Browse files
committed
Review formating and some defines naming consistency
1 parent d91e910 commit f033b30

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/rcore.c

+9-7
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ bool FileExists(const char *fileName)
18401840
// NOTE: Extensions checking is not case-sensitive
18411841
bool IsFileExtension(const char *fileName, const char *ext)
18421842
{
1843-
#define MAX_FILE_EXTENSION_SIZE 16
1843+
#define MAX_FILE_EXTENSION_LENGTH 16
18441844

18451845
bool result = false;
18461846
const char *fileExt = GetFileExtension(fileName);
@@ -1851,8 +1851,8 @@ bool IsFileExtension(const char *fileName, const char *ext)
18511851
int extCount = 0;
18521852
const char **checkExts = TextSplit(ext, ';', &extCount); // WARNING: Module required: rtext
18531853

1854-
char fileExtLower[MAX_FILE_EXTENSION_SIZE + 1] = { 0 };
1855-
strncpy(fileExtLower, TextToLower(fileExt), MAX_FILE_EXTENSION_SIZE); // WARNING: Module required: rtext
1854+
char fileExtLower[MAX_FILE_EXTENSION_LENGTH + 1] = { 0 };
1855+
strncpy(fileExtLower, TextToLower(fileExt), MAX_FILE_EXTENSION_LENGTH); // WARNING: Module required: rtext
18561856

18571857
for (int i = 0; i < extCount; i++)
18581858
{
@@ -1946,16 +1946,17 @@ const char *GetFileName(const char *filePath)
19461946
// Get filename string without extension (uses static string)
19471947
const char *GetFileNameWithoutExt(const char *filePath)
19481948
{
1949-
#define MAX_FILENAMEWITHOUTEXT_LENGTH 256
1949+
#define MAX_FILENAME_LENGTH 256
19501950

1951-
static char fileName[MAX_FILENAMEWITHOUTEXT_LENGTH] = { 0 };
1952-
memset(fileName, 0, MAX_FILENAMEWITHOUTEXT_LENGTH);
1951+
static char fileName[MAX_FILENAME_LENGTH] = { 0 };
1952+
memset(fileName, 0, MAX_FILENAME_LENGTH);
19531953

19541954
if (filePath != NULL)
19551955
{
19561956
strcpy(fileName, GetFileName(filePath)); // Get filename.ext without path
19571957
int size = (int)strlen(fileName); // Get size in bytes
1958-
for (int i = size; i>0; i--) // Reverse search '.'
1958+
1959+
for (int i = size; i > 0; i--) // Reverse search '.'
19591960
{
19601961
if (fileName[i] == '.')
19611962
{
@@ -1965,6 +1966,7 @@ const char *GetFileNameWithoutExt(const char *filePath)
19651966
}
19661967
}
19671968
}
1969+
19681970
return fileName;
19691971
}
19701972

0 commit comments

Comments
 (0)