Christoph Mallon: Remove pointless if (x) before SDL_free(x)
This commit is contained in:
parent
edc88be724
commit
08dfaaa2e6
63 changed files with 157 additions and 349 deletions
|
@ -113,12 +113,8 @@ main(int argc, char *argv[])
|
|||
}
|
||||
|
||||
/* Clean up */
|
||||
if (userRunSeed != NULL) {
|
||||
SDL_free(userRunSeed);
|
||||
}
|
||||
if (filter != NULL) {
|
||||
SDL_free(filter);
|
||||
}
|
||||
SDL_free(userRunSeed);
|
||||
SDL_free(filter);
|
||||
|
||||
/* Shutdown everything */
|
||||
quit(result);
|
||||
|
|
|
@ -747,11 +747,9 @@ int audio_convertAudio()
|
|||
SDLTest_AssertCheck(cvt.len_ratio > 0.0, "Verify conversion length ratio; expected: >0; got: %f", cvt.len_ratio);
|
||||
|
||||
/* Free converted buffer */
|
||||
if (cvt.buf != NULL) {
|
||||
SDL_free(cvt.buf);
|
||||
cvt.buf = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ clipboard_testGetClipboardText(void *arg)
|
|||
charResult = SDL_GetClipboardText();
|
||||
SDLTest_AssertPass("Call to SDL_GetClipboardText succeeded");
|
||||
|
||||
if (charResult) SDL_free(charResult);
|
||||
SDL_free(charResult);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
@ -69,8 +69,8 @@ clipboard_testSetClipboardText(void *arg)
|
|||
textRef, text);
|
||||
|
||||
/* Cleanup */
|
||||
if (textRef) SDL_free(textRef);
|
||||
if (text) SDL_free(text);
|
||||
SDL_free(textRef);
|
||||
SDL_free(text);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
@ -145,9 +145,9 @@ clipboard_testClipboardTextFunctions(void *arg)
|
|||
textRef, charResult);
|
||||
|
||||
/* Cleanup */
|
||||
if (textRef) SDL_free(textRef);
|
||||
if (text) SDL_free(text);
|
||||
if (charResult) SDL_free(charResult);
|
||||
SDL_free(textRef);
|
||||
SDL_free(text);
|
||||
SDL_free(charResult);
|
||||
|
||||
return TEST_COMPLETED;
|
||||
}
|
||||
|
|
|
@ -995,9 +995,7 @@ _compare(SDL_Surface *referenceSurface, int allowable_error)
|
|||
SDLTest_AssertCheck(result == 0, "Validate result from SDLTest_CompareSurfaces, expected: 0, got: %i", result);
|
||||
|
||||
/* Clean up. */
|
||||
if (pixels != NULL) {
|
||||
SDL_free(pixels);
|
||||
}
|
||||
SDL_free(pixels);
|
||||
if (testSurface != NULL) {
|
||||
SDL_FreeSurface(testSurface);
|
||||
}
|
||||
|
|
|
@ -1714,10 +1714,10 @@ video_getSetWindowData(void *arg)
|
|||
_destroyVideoSuiteTestWindow(window);
|
||||
|
||||
cleanup:
|
||||
if (referenceUserdata != NULL) SDL_free(referenceUserdata);
|
||||
if (referenceUserdata2 != NULL) SDL_free(referenceUserdata2);
|
||||
if (userdata != NULL) SDL_free(userdata);
|
||||
if (userdata2 != NULL) SDL_free(userdata2);
|
||||
SDL_free(referenceUserdata);
|
||||
SDL_free(referenceUserdata2);
|
||||
SDL_free(userdata);
|
||||
SDL_free(userdata2);
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
|
|
@ -75,12 +75,8 @@ main(int argc, char *argv[])
|
|||
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "FAIL: %s\n", formats[i]);
|
||||
++errors;
|
||||
}
|
||||
if (test[0]) {
|
||||
SDL_free(test[0]);
|
||||
}
|
||||
if (test[1]) {
|
||||
SDL_free(test[1]);
|
||||
}
|
||||
SDL_free(test[0]);
|
||||
SDL_free(test[1]);
|
||||
}
|
||||
test[0] = SDL_iconv_string("UTF-8", "UCS-4", ucs4, len);
|
||||
SDL_free(ucs4);
|
||||
|
|
|
@ -42,15 +42,9 @@ static int iterations = -1;
|
|||
static void
|
||||
quit(int rc)
|
||||
{
|
||||
if (sprites) {
|
||||
SDL_free(sprites);
|
||||
}
|
||||
if (positions) {
|
||||
SDL_free(positions);
|
||||
}
|
||||
if (velocities) {
|
||||
SDL_free(velocities);
|
||||
}
|
||||
SDL_free(sprites);
|
||||
SDL_free(positions);
|
||||
SDL_free(velocities);
|
||||
SDLTest_CommonQuit(state);
|
||||
exit(rc);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue