diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-28 23:10:11 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-28 23:10:20 +0300 |
commit | 611157057b5f8bb7760ffc9f253786e5413c44b2 (patch) | |
tree | efd205996016d2359424bff679765ee4bfac7dce /source/blender/blenloader | |
parent | 7c3a5da04b384868699e577ccbaef96197d3712f (diff) |
Cleanup: Use bool instead of int
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 495054923f9..490328106ca 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -580,7 +580,7 @@ static WriteData *mywrite_begin(WriteWrap *ww, MemFile *compare, MemFile *curren /** * END the mywrite wrapper - * \return 1 if write failed + * \return True if write failed * \return unknown global variable otherwise * \warning Talks to other functions with global parameters */ @@ -1256,12 +1256,12 @@ static bool do_history(const char *name, ReportList *reports) int hisnr = U.versions; if (U.versions == 0) { - return 0; + return false; } if (strlen(name) < 2) { BKE_report(reports, RPT_ERROR, "Unable to make version backup: filename too short"); - return 1; + return true; } while (hisnr > 1) { @@ -1287,7 +1287,7 @@ static bool do_history(const char *name, ReportList *reports) } } - return 0; + return false; } /** \} */ @@ -1334,7 +1334,7 @@ bool BLO_write_file(Main *mainvar, if (ww.open(&ww, tempname) == false) { BKE_reportf( reports, RPT_ERROR, "Cannot open file %s for writing: %s", tempname, strerror(errno)); - return 0; + return false; } if (remap_mode == BLO_WRITE_PATH_REMAP_ABSOLUTE) { @@ -1426,7 +1426,7 @@ bool BLO_write_file(Main *mainvar, BKE_report(reports, RPT_ERROR, strerror(errno)); remove(tempname); - return 0; + return false; } /* file save to temporary file was successful */ @@ -1435,13 +1435,13 @@ bool BLO_write_file(Main *mainvar, const bool err_hist = do_history(filepath, reports); if (err_hist) { BKE_report(reports, RPT_ERROR, "Version backup failed (file saved with @)"); - return 0; + return false; } } if (BLI_rename(tempname, filepath) != 0) { BKE_report(reports, RPT_ERROR, "Cannot change old file (file saved with @)"); - return 0; + return false; } if (G.debug & G_DEBUG_IO && mainvar->lock != NULL) { @@ -1449,7 +1449,7 @@ bool BLO_write_file(Main *mainvar, BLO_main_validate_libraries(mainvar, reports); } - return 1; + return true; } bool BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int write_flags) |