Cleanup: use EXIT_SUCCESS/FAILURE from calls to exit()

This commit is contained in:
Campbell Barton 2023-05-31 14:01:39 +10:00
parent bd23eb4742
commit 4408fea092
3 changed files with 7 additions and 8 deletions

View File

@ -364,8 +364,7 @@ DO_INLINE void inverse_fmatrix(float to[3][3], float from[3][3])
float d;
if ((d = det_fmatrix(from)) == 0) {
printf("can't build inverse");
exit(0);
// printf("can't build inverse");
}
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {

View File

@ -1507,7 +1507,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
}
else {
printf("%s: no filepath argument given\n", __func__);
exit(1);
exit(EXIT_FAILURE);
}
if (IMB_isanim(filepath)) {
@ -1522,7 +1522,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
}
else if (!IMB_ispic(filepath)) {
printf("%s: '%s' not an image file\n", __func__, filepath);
exit(1);
exit(EXIT_FAILURE);
}
if (ibuf == NULL) {
@ -1532,7 +1532,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
if (ibuf == NULL) {
printf("%s: '%s' couldn't open\n", __func__, filepath);
exit(1);
exit(EXIT_FAILURE);
}
{
@ -1547,7 +1547,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
/* GHOST will have reported the back-ends that failed to load. */
fprintf(stderr, "GHOST: unable to initialize, exiting!\n");
/* This will leak memory, it's preferable to crashing. */
exit(1);
exit(EXIT_FAILURE);
}
GHOST_AddEventConsumer(g_WS.ghost_system, consumer);
@ -1708,7 +1708,7 @@ static char *wm_main_playanim_intern(int argc, const char **argv)
} /* else delete */
else {
printf("error: can't play this image type\n");
exit(0);
exit(EXIT_SUCCESS);
}
if (ps.once) {

View File

@ -1677,7 +1677,7 @@ void wm_ghost_init(bContext *C)
/* GHOST will have reported the back-ends that failed to load. */
fprintf(stderr, "GHOST: unable to initialize, exiting!\n");
/* This will leak memory, it's preferable to crashing. */
exit(1);
exit(EXIT_FAILURE);
}
#if !(defined(WIN32) || defined(__APPLE__))
g_system_backend_id = GHOST_SystemBackend();