mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-11 22:42:31 +02:00
[SDL2] pointer boolean (#8523)
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user