This commit is contained in:
Ray 2024-06-09 13:16:29 +02:00
parent 6b3c1148bf
commit 8cbde7f84c
2 changed files with 6 additions and 15 deletions

View file

@ -2251,7 +2251,7 @@ bool IsFileNameValid(const char *fileName)
if ((fileName != NULL) && (fileName[0] != '\0')) if ((fileName != NULL) && (fileName[0] != '\0'))
{ {
int length = strlen(fileName); int length = (int)strlen(fileName);
bool allPeriods = true; bool allPeriods = true;
for (int i = 0; i < length; i++) for (int i = 0; i < length; i++)

View file

@ -1807,10 +1807,7 @@ const char *TextToSnake(const char *text)
} }
buffer[i] = text[j] + 32; buffer[i] = text[j] + 32;
} }
else else buffer[i] = text[j];
{
buffer[i] = text[j];
}
} }
} }
@ -1827,23 +1824,17 @@ const char *TextToCamel(const char *text)
if (text != NULL) if (text != NULL)
{ {
// Lower case first character // Lower case first character
if ((text[0] >= 'A') && (text[0] <= 'Z')) if ((text[0] >= 'A') && (text[0] <= 'Z')) buffer[0] = text[0] + 32;
buffer[0] = text[0] + 32; else buffer[0] = text[0];
else
buffer[0] = text[0];
// Check for next separator to upper case another character // Check for next separator to upper case another character
for (int i = 1, j = 1; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++) for (int i = 1, j = 1; (i < MAX_TEXT_BUFFER_LENGTH - 1) && (text[j] != '\0'); i++, j++)
{ {
if (text[j] != '_') if (text[j] != '_') buffer[i] = text[j];
buffer[i] = text[j];
else else
{ {
j++; j++;
if ((text[j] >= 'a') && (text[j] <= 'z')) if ((text[j] >= 'a') && (text[j] <= 'z')) buffer[i] = text[j] - 32;
{
buffer[i] = text[j] - 32;
}
} }
} }
} }