diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-03 03:45:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-03 03:45:08 +0400 |
commit | b2b4f2c033c9e1df15aae6265390d519f55375d2 (patch) | |
tree | 58f7d1834970f45eb301e73b8cf273cce810f222 /source/blender | |
parent | f38331adefde74c5748a6823ba7f00304d12c8dc (diff) |
Code cleanup: use BKE_BIT_TEST_SET to set flags
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/windowmanager/intern/wm_files.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c index 850e4e13b75..a3aa76dfd3a 100644 --- a/source/blender/windowmanager/intern/wm_files.c +++ b/source/blender/windowmanager/intern/wm_files.c @@ -70,6 +70,7 @@ #include "DNA_screen_types.h" #include "DNA_windowmanager_types.h" +#include "BKE_utildefines.h" #include "BKE_autoexec.h" #include "BKE_blender.h" #include "BKE_context.h" @@ -293,14 +294,12 @@ static void wm_init_userdef(bContext *C, const bool from_memory) sound_init(CTX_data_main(C)); /* needed so loading a file from the command line respects user-pref [#26156] */ - if (U.flag & USER_FILENOUI) G.fileflags |= G_FILE_NO_UI; - else G.fileflags &= ~G_FILE_NO_UI; + BKE_BIT_TEST_SET(G.fileflags, U.flag & USER_FILENOUI, G_FILE_NO_UI); /* set the python auto-execute setting from user prefs */ /* enabled by default, unless explicitly enabled in the command line which overrides */ if ((G.f & G_SCRIPT_OVERRIDE_PREF) == 0) { - if ((U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0) G.f |= G_SCRIPT_AUTOEXEC; - else G.f &= ~G_SCRIPT_AUTOEXEC; + BKE_BIT_TEST_SET(G.f, (U.flag & USER_SCRIPT_AUTOEXEC_DISABLE) == 0, G_SCRIPT_AUTOEXEC); } /* avoid re-saving for every small change to our prefs, allow overrides */ @@ -954,11 +953,8 @@ int wm_file_write(bContext *C, const char *filepath, int fileflags, ReportList * G.save_over = 1; /* disable untitled.blend convention */ } - if (fileflags & G_FILE_COMPRESS) G.fileflags |= G_FILE_COMPRESS; - else G.fileflags &= ~G_FILE_COMPRESS; - - if (fileflags & G_FILE_AUTOPLAY) G.fileflags |= G_FILE_AUTOPLAY; - else G.fileflags &= ~G_FILE_AUTOPLAY; + BKE_BIT_TEST_SET(G.fileflags, fileflags & G_FILE_COMPRESS, G_FILE_COMPRESS); + BKE_BIT_TEST_SET(G.fileflags, fileflags & G_FILE_AUTOPLAY, G_FILE_AUTOPLAY); /* prevent background mode scripts from clobbering history */ if (!G.background) { |