Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-04-04 06:05:11 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-04-04 06:05:11 +0400
commit7bbaf4853ae81344761fceac90b08785520c18d0 (patch)
treefdfb403a573188312e43bf134a13c9a2e0d36e7e /source/blender/windowmanager/intern
parent47fffc86bc94318aa34f50c035c99cfe8c7bad42 (diff)
code cleanup: use bools in UI and WM code, quiet some shadow warnings, remove unused function uiEmboss()
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r--source/blender/windowmanager/intern/wm.c4
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c2
-rw-r--r--source/blender/windowmanager/intern/wm_draw.c4
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c14
-rw-r--r--source/blender/windowmanager/intern/wm_init_exit.c7
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c12
-rw-r--r--source/blender/windowmanager/intern/wm_window.c6
8 files changed, 26 insertions, 25 deletions
diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c
index 29e0fcf302f..f7b7aa87cf8 100644
--- a/source/blender/windowmanager/intern/wm.c
+++ b/source/blender/windowmanager/intern/wm.c
@@ -179,7 +179,7 @@ void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot)
static GHash *uilisttypes_hash = NULL;
-uiListType *WM_uilisttype_find(const char *idname, int quiet)
+uiListType *WM_uilisttype_find(const char *idname, bool quiet)
{
uiListType *ult;
@@ -234,7 +234,7 @@ void WM_uilisttype_free(void)
static GHash *menutypes_hash = NULL;
-MenuType *WM_menutype_find(const char *idname, int quiet)
+MenuType *WM_menutype_find(const char *idname, bool quiet)
{
MenuType *mt;
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index 2e15d6158e8..f8081cb8012 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -164,7 +164,7 @@ void WM_cursor_restore(wmWindow *win)
}
/* to allow usage all over, we do entire WM */
-void WM_cursor_wait(int val)
+void WM_cursor_wait(bool val)
{
if (!G.background) {
wmWindowManager *wm = G.main->wm.first;
diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c
index 173a8237c02..1e3c2479e66 100644
--- a/source/blender/windowmanager/intern/wm_draw.c
+++ b/source/blender/windowmanager/intern/wm_draw.c
@@ -769,12 +769,12 @@ static int wm_automatic_draw_method(wmWindow *win)
return win->drawmethod;
}
-int WM_is_draw_triple(wmWindow *win)
+bool WM_is_draw_triple(wmWindow *win)
{
/* function can get called before this variable is set in drawing code below */
if (win->drawmethod != U.wmdrawmethod)
win->drawmethod = U.wmdrawmethod;
- return USER_DRAW_TRIPLE == wm_automatic_draw_method(win);
+ return (USER_DRAW_TRIPLE == wm_automatic_draw_method(win));
}
void wm_tag_redraw_overlay(wmWindow *win, ARegion *ar)
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 6c129ec0a92..d7b642fc5cf 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -796,10 +796,10 @@ static void wm_region_mouse_co(bContext *C, wmEvent *event)
}
}
-#if 1 /* disabling for 2.63 release, since we keep getting reports some menu items are leaving props undefined */
-int WM_operator_last_properties_init(wmOperator *op)
+#if 1 /* may want to disable operator remembering previous state for testing */
+bool WM_operator_last_properties_init(wmOperator *op)
{
- int change = FALSE;
+ bool change = false;
if (op->type->last_properties) {
PropertyRNA *iterprop;
@@ -825,7 +825,7 @@ int WM_operator_last_properties_init(wmOperator *op)
idp_dst->flag |= IDP_FLAG_GHOST;
IDP_ReplaceInGroup(op->properties, idp_dst);
- change = TRUE;
+ change = true;
}
}
}
@@ -836,7 +836,7 @@ int WM_operator_last_properties_init(wmOperator *op)
return change;
}
-int WM_operator_last_properties_store(wmOperator *op)
+bool WM_operator_last_properties_store(wmOperator *op)
{
if (op->type->last_properties) {
IDP_FreeProperty(op->type->last_properties);
@@ -849,10 +849,10 @@ int WM_operator_last_properties_store(wmOperator *op)
printf("%s: storing properties for '%s'\n", __func__, op->type->idname);
}
op->type->last_properties = IDP_CopyProperty(op->properties);
- return TRUE;
+ return true;
}
else {
- return FALSE;
+ return false;
}
}
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 193af2f92c6..16afad88069 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -248,7 +248,7 @@ void WM_init_splash(bContext *C)
}
}
-int WM_init_game(bContext *C)
+bool WM_init_game(bContext *C)
{
wmWindowManager *wm = CTX_wm_manager(C);
wmWindow *win;
@@ -318,7 +318,7 @@ int WM_init_game(bContext *C)
sound_exit();
- return 1;
+ return true;
}
else {
ReportTimerInfo *rti;
@@ -333,8 +333,9 @@ int WM_init_game(bContext *C)
rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
wm->reports.reporttimer->customdata = rti;
+
+ return false;
}
- return 0;
}
/* free strings of open recent files */
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 20e715c18d0..ff711c5ca4d 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -958,7 +958,7 @@ static wmKeyMapItem *wm_keymap_item_find(
RNA_pointer_create(NULL, ot->srna, properties_default, &opptr);
- if (WM_operator_properties_default(&opptr, TRUE)) {
+ if (WM_operator_properties_default(&opptr, true)) {
found = wm_keymap_item_find_props(C, opname, opcontext, properties_default, 0, hotkey, keymap_r);
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index b4a4e4612e3..d0f258dc375 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -115,7 +115,7 @@ static GHash *global_ops_hash = NULL;
/* ************ operator API, exported ********** */
-wmOperatorType *WM_operatortype_find(const char *idname, int quiet)
+wmOperatorType *WM_operatortype_find(const char *idname, bool quiet)
{
if (idname[0]) {
wmOperatorType *ot;
@@ -779,7 +779,7 @@ void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, con
}
-void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context)
+void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
{
RNA_STRUCT_BEGIN(ptr, prop)
{
@@ -815,7 +815,7 @@ void WM_operator_properties_sanitize(PointerRNA *ptr, const short no_context)
* \note, theres nothing specific to operators here.
* this could be made a general function.
*/
-int WM_operator_properties_default(PointerRNA *ptr, const int do_update)
+int WM_operator_properties_default(PointerRNA *ptr, const bool do_update)
{
int is_change = FALSE;
RNA_STRUCT_BEGIN(ptr, prop)
@@ -831,7 +831,7 @@ int WM_operator_properties_default(PointerRNA *ptr, const int do_update)
break;
}
default:
- if ((do_update == FALSE) || (RNA_property_is_set(ptr, prop) == FALSE)) {
+ if ((do_update == false) || (RNA_property_is_set(ptr, prop) == FALSE)) {
if (RNA_property_reset(ptr, prop, -1)) {
is_change = 1;
}
@@ -964,7 +964,7 @@ static void operator_enum_search_cb(const struct bContext *C, void *arg_ot, cons
for (item = item_array; item->identifier; item++) {
/* note: need to give the index rather than the identifier because the enum can be freed */
if (BLI_strcasestr(item->name, str))
- if (0 == uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0))
+ if (false == uiSearchItemAdd(items, item->name, SET_INT_IN_POINTER(item->value), 0))
break;
}
@@ -1226,7 +1226,7 @@ int WM_operator_winactive(bContext *C)
}
/* return FALSE, if the UI should be disabled */
-int WM_operator_check_ui_enabled(const bContext *C, const char *idname)
+bool WM_operator_check_ui_enabled(const bContext *C, const char *idname)
{
wmWindowManager *wm = CTX_wm_manager(C);
Scene *scene = CTX_data_scene(C);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 53698ca7e9e..70cb10476d7 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -97,8 +97,8 @@ static struct WMInitStruct {
int windowstate;
WinOverrideFlag override_flag;
- int native_pixels;
-} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, 1};
+ bool native_pixels;
+} wm_init_state = {0, 0, 0, 0, GHOST_kWindowStateNormal, 0, true};
/* ******** win open & close ************ */
@@ -1332,7 +1332,7 @@ void WM_init_state_normal_set(void)
wm_init_state.override_flag |= WIN_OVERRIDE_WINSTATE;
}
-void WM_init_native_pixels(int do_it)
+void WM_init_native_pixels(bool do_it)
{
wm_init_state.native_pixels = do_it;
}