Cleanup: more int->bool.

This commit is contained in:
2014-12-01 17:11:18 +01:00
parent 9c782c17ba
commit 20a1778148
25 changed files with 190 additions and 186 deletions

View File

@@ -494,10 +494,11 @@ bool BKE_read_file_from_memory(
BLO_update_defaults_startup_blend(bfd->main);
setup_app_data(C, bfd, "<memory2>");
}
else
else {
BKE_reports_prepend(reports, "Loading failed: ");
}
return (bfd ? 1 : 0);
return (bfd != NULL);
}
/* memfile is the undo buffer */
@@ -517,10 +518,11 @@ bool BKE_read_file_from_memfile(
setup_app_data(C, bfd, "<memory1>");
}
else
else {
BKE_reports_prepend(reports, "Loading failed: ");
}
return (bfd ? 1 : 0);
return (bfd != NULL);
}
/* only read the userdef from a .blend */
@@ -835,13 +837,13 @@ bool BKE_undo_save_file(const char *filename)
int file, oflags;
if ((U.uiflag & USER_GLOBALUNDO) == 0) {
return 0;
return false;
}
uel = curundo;
if (uel == NULL) {
fprintf(stderr, "No undo buffer to save recovery file\n");
return 0;
return false;
}
/* note: This is currently used for autosave and 'quit.blend', where _not_ following symlinks is OK,
@@ -863,7 +865,7 @@ bool BKE_undo_save_file(const char *filename)
if (file == -1) {
fprintf(stderr, "Unable to save '%s': %s\n",
filename, errno ? strerror(errno) : "Unknown error opening file");
return 0;
return false;
}
for (chunk = uel->memfile.chunks.first; chunk; chunk = chunk->next) {
@@ -877,9 +879,9 @@ bool BKE_undo_save_file(const char *filename)
if (chunk) {
fprintf(stderr, "Unable to save '%s': %s\n",
filename, errno ? strerror(errno) : "Unknown error writing file");
return 0;
return false;
}
return 1;
return true;
}
/* sets curscene */