[SDL2] pointer boolean (#8523)

This commit is contained in:
Sylvain Becker
2023-11-10 15:30:56 +01:00
committed by GitHub
parent 4a3a9f3ad8
commit a14b948b6c
394 changed files with 2564 additions and 2559 deletions

View File

@@ -107,25 +107,25 @@ int main(int argc, char *argv[])
RWOP_ERR_QUIT(rwops);
}
rwops = SDL_RWFromFile(FBASENAME2, "wb");
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
rwops->close(rwops);
unlink(FBASENAME2);
rwops = SDL_RWFromFile(FBASENAME2, "wb+");
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
rwops->close(rwops);
unlink(FBASENAME2);
rwops = SDL_RWFromFile(FBASENAME2, "ab");
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
rwops->close(rwops);
unlink(FBASENAME2);
rwops = SDL_RWFromFile(FBASENAME2, "ab+");
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
rwops->close(rwops);
@@ -136,7 +136,7 @@ int main(int argc, char *argv[])
test : w mode, r mode, w+ mode
*/
rwops = SDL_RWFromFile(FBASENAME1, "wb"); /* write only */
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
@@ -158,7 +158,7 @@ int main(int argc, char *argv[])
rwops->close(rwops);
rwops = SDL_RWFromFile(FBASENAME1, "rb"); /* read mode, file must exists */
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
if (0 != rwops->seek(rwops, 0L, RW_SEEK_SET)) {
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
/* test 3: same with w+ mode */
rwops = SDL_RWFromFile(FBASENAME1, "wb+"); /* write + read + truncation */
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
@@ -247,7 +247,7 @@ int main(int argc, char *argv[])
/* test 4: same in r+ mode */
rwops = SDL_RWFromFile(FBASENAME1, "rb+"); /* write + read + file must exists, no truncation */
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {
@@ -298,7 +298,7 @@ int main(int argc, char *argv[])
/* test5 : append mode */
rwops = SDL_RWFromFile(FBASENAME1, "ab+"); /* write + read + append */
if (rwops == NULL) {
if (!rwops) {
RWOP_ERR_QUIT(rwops);
}
if (1 != rwops->write(rwops, "1234567890", 10, 1)) {