[Bf-blender-cvs] [56fb2a5ed0f] master: Cleanup: use proper `bool` variables in Main, instead of `char`.

Bastien Montagne noreply at git.blender.org
Wed Sep 14 15:49:25 CEST 2022


Commit: 56fb2a5ed0f54af198d450542c3536be516d7214
Author: Bastien Montagne
Date:   Wed Sep 14 15:48:49 2022 +0200
Branches: master
https://developer.blender.org/rB56fb2a5ed0f54af198d450542c3536be516d7214

Cleanup: use proper `bool` variables in Main, instead of `char`.

===================================================================

M	source/blender/blenkernel/BKE_main.h
M	source/blender/blenkernel/intern/blendfile.c
M	source/blender/windowmanager/intern/wm_files.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index 4d26ed11f1b..b741489d929 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -116,25 +116,25 @@ typedef struct Main {
   uint64_t build_commit_timestamp; /* commit's timestamp from buildinfo */
   char build_hash[16];             /* hash from buildinfo */
   /** Indicate the #Main.filepath (file) is the recovered one. */
-  char recovered;
+  bool recovered;
   /** All current ID's exist in the last memfile undo step. */
-  char is_memfile_undo_written;
+  bool is_memfile_undo_written;
   /**
    * An ID needs its data to be flushed back.
    * use "needs_flush_to_id" in edit data to flag data which needs updating.
    */
-  char is_memfile_undo_flush_needed;
+  bool is_memfile_undo_flush_needed;
   /**
    * Indicates that next memfile undo step should not allow reusing old bmain when re-read, but
    * instead do a complete full re-read/update from stored memfile.
    */
-  char use_memfile_full_barrier;
+  bool use_memfile_full_barrier;
 
   /**
    * When linking, disallow creation of new data-blocks.
    * Make sure we don't do this by accident, see T76738.
    */
-  char is_locked_for_linking;
+  bool is_locked_for_linking;
 
   BlendThumbnail *blen_thumb;
 
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index d7f30c99397..bf40d07054d 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -364,7 +364,7 @@ static void setup_app_data(bContext *C,
     BKE_lib_override_library_main_hierarchy_root_ensure(bmain);
   }
 
-  bmain->recovered = 0;
+  bmain->recovered = false;
 
   /* startup.blend or recovered startup */
   if (is_startup) {
@@ -372,7 +372,7 @@ static void setup_app_data(bContext *C,
   }
   else if (recover) {
     /* In case of autosave or quit.blend, use original filepath instead. */
-    bmain->recovered = 1;
+    bmain->recovered = true;
     STRNCPY(bmain->filepath, bfd->filepath);
   }
 
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 0e43ed5509a..9d6687eaa9c 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1838,7 +1838,7 @@ static bool wm_file_write(bContext *C,
   ED_editors_flush_edits(bmain);
 
   /* XXX(ton): temp solution to solve bug, real fix coming. */
-  bmain->recovered = 0;
+  bmain->recovered = false;
 
   if (BLO_write_file(bmain,
                      filepath,



More information about the Bf-blender-cvs mailing list