[cppcheck] Fix minor warnings in models.c and raudio.c (#1162)

Errores fixes:
models.c,2843 Either the condition 'fileData!=NULL' is redundant or there is possible null pointer dereference: fileData.
raudio.c,805, 806, 807, 808, %d in format string (no. 2) requires 'int' but the argument type is 'unsigned int'.
This commit is contained in:
Dani Martin 2020-03-30 17:08:01 +02:00 committed by GitHub
parent bba10504e2
commit 1a948849f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -2840,10 +2840,10 @@ static Model LoadOBJ(const char *fileName)
unsigned int materialCount = 0;
char *fileData = LoadFileText(fileName);
int dataSize = strlen(fileData);
if (fileData != NULL)
{
int dataSize = strlen(fileData);
char currentDir[1024] = { 0 };
strcpy(currentDir, GetWorkingDirectory());
chdir(GetDirectoryPath(fileName));

View File

@ -802,10 +802,10 @@ void ExportWaveAsCode(Wave wave, const char *fileName)
#endif
fprintf(txtFile, "// Wave data information\n");
fprintf(txtFile, "#define %s_SAMPLE_COUNT %d\n", varFileName, wave.sampleCount);
fprintf(txtFile, "#define %s_SAMPLE_RATE %d\n", varFileName, wave.sampleRate);
fprintf(txtFile, "#define %s_SAMPLE_SIZE %d\n", varFileName, wave.sampleSize);
fprintf(txtFile, "#define %s_CHANNELS %d\n\n", varFileName, wave.channels);
fprintf(txtFile, "#define %s_SAMPLE_COUNT %u\n", varFileName, wave.sampleCount);
fprintf(txtFile, "#define %s_SAMPLE_RATE %u\n", varFileName, wave.sampleRate);
fprintf(txtFile, "#define %s_SAMPLE_SIZE %u\n", varFileName, wave.sampleSize);
fprintf(txtFile, "#define %s_CHANNELS %u\n\n", varFileName, wave.channels);
// Write byte data as hexadecimal text
fprintf(txtFile, "static unsigned char %s_DATA[%i] = { ", varFileName, dataSize);