Some code tweaks for consistency

This commit is contained in:
Ray
2021-05-22 16:54:04 +02:00
parent cb698dd37d
commit 03710c9d8e
6 changed files with 24 additions and 24 deletions

View File

@@ -2179,8 +2179,8 @@ Shader LoadShader(const char *vsFileName, const char *fsFileName)
shader.id = rlLoadShaderCode(vShaderStr, fShaderStr);
if (vShaderStr != NULL) RL_FREE(vShaderStr);
if (fShaderStr != NULL) RL_FREE(fShaderStr);
if (vShaderStr != NULL) UnloadFileText(vShaderStr);
if (fShaderStr != NULL) UnloadFileText(fShaderStr);
// After shader loading, we TRY to set default location names
if (shader.id > 0)
@@ -2801,8 +2801,8 @@ char **GetDirectoryFiles(const char *dirPath, int *fileCount)
ClearDirectoryFiles();
// Memory allocation for MAX_DIRECTORY_FILES
dirFilesPath = (char **)RL_MALLOC(sizeof(char *)*MAX_DIRECTORY_FILES);
for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH);
dirFilesPath = (char **)RL_MALLOC(MAX_DIRECTORY_FILES*sizeof(char *));
for (int i = 0; i < MAX_DIRECTORY_FILES; i++) dirFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char));
int counter = 0;
struct dirent *entity;
@@ -5151,11 +5151,11 @@ static void WindowDropCallback(GLFWwindow *window, int count, const char **paths
{
ClearDroppedFiles();
CORE.Window.dropFilesPath = (char **)RL_MALLOC(sizeof(char *)*count);
CORE.Window.dropFilesPath = (char **)RL_MALLOC(count*sizeof(char *));
for (int i = 0; i < count; i++)
{
CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(sizeof(char)*MAX_FILEPATH_LENGTH);
CORE.Window.dropFilesPath[i] = (char *)RL_MALLOC(MAX_FILEPATH_LENGTH*sizeof(char));
strcpy(CORE.Window.dropFilesPath[i], paths[i]);
}