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>2014-01-16 12:15:53 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-16 12:15:53 +0400
commitaf93ebcb503293e382f74c2d33554504269d4815 (patch)
treee4490d7be44e3532e1655f82c7a7aeb11cc5785c /source/blender/windowmanager
parentbb1a7e4d8722fda09a3294eea56a537b6f043dd3 (diff)
Code Cleanup: style and redundant casts
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_cursors.c2
-rw-r--r--source/blender/windowmanager/intern/wm_dragdrop.c2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c6
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c18
4 files changed, 17 insertions, 11 deletions
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index e6fc2cf6bb2..09a83834610 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -146,7 +146,7 @@ void WM_cursor_set(wmWindow *win, int curs)
if (curs == SYSCURSOR) { /* System default Cursor */
GHOST_SetCursorShape(win->ghostwin, convert_cursor(CURSOR_STD));
}
- else if ( (U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL) ) {
+ else if ((U.curssize == 0) || (BlenderCursor[curs]->big_bm == NULL)) {
window_set_custom_cursor_ex(win, BlenderCursor[curs], 0);
}
else {
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index dad8e7bdde0..12e23c3d0c7 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -227,7 +227,7 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
drag->opname[0] = 0;
/* check buttons (XXX todo rna and value) */
- if (UI_but_active_drop_name(C) ) {
+ if (UI_but_active_drop_name(C)) {
BLI_strncpy(drag->opname, IFACE_("Paste name"), sizeof(drag->opname));
}
else {
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index e4dfae284fe..f8488b63c85 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3040,7 +3040,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
/* double click test */
if (wm_event_is_double_click(&event, evt)) {
- if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+ if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
printf("%s Send double click\n", __func__);
event.val = KM_DBL_CLICK;
}
@@ -3147,7 +3147,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
/* double click test */
/* if previous event was same type, and previous was release, and now it presses... */
if (wm_event_is_double_click(&event, evt)) {
- if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+ if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
printf("%s Send double click\n", __func__);
evt->val = event.val = KM_DBL_CLICK;
}
@@ -3216,7 +3216,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
attach_ndof_data(&event, customdata);
wm_event_add(win, &event);
- if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS) )
+ if (G.debug & (G_DEBUG_HANDLERS | G_DEBUG_EVENTS))
printf("%s sending NDOF_MOTION, prev = %d %d\n", __func__, event.x, event.y);
break;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 99437479df1..fc36290b0db 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2897,8 +2897,9 @@ static int border_apply(bContext *C, wmOperator *op, int gesture_mode)
return 0;
/* XXX weak; border should be configured for this without reading event types */
- if (RNA_struct_find_property(op->ptr, "gesture_mode") )
+ if (RNA_struct_find_property(op->ptr, "gesture_mode")) {
RNA_int_set(op->ptr, "gesture_mode", gesture_mode);
+ }
retval = op->type->exec(C, op);
OPERATOR_RETVAL_CHECK(retval);
@@ -2915,8 +2916,9 @@ static void wm_gesture_end(bContext *C, wmOperator *op)
ED_area_tag_redraw(CTX_wm_area(C));
- if (RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor")) {
WM_cursor_modal_restore(CTX_wm_window(C));
+ }
}
int WM_border_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@@ -3194,8 +3196,9 @@ void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
if (win->tweak == NULL) {
if (CTX_wm_region(C)) {
if (event->val == KM_PRESS) {
- if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE) )
+ if (ELEM3(event->type, LEFTMOUSE, MIDDLEMOUSE, RIGHTMOUSE)) {
win->tweak = WM_gesture_new(C, event, WM_GESTURE_TWEAK);
+ }
}
}
}
@@ -3220,8 +3223,9 @@ int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wm_gesture_tag_redraw(C);
- if (RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor")) {
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
+ }
return OPERATOR_RUNNING_MODAL;
}
@@ -3235,8 +3239,9 @@ int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event)
wm_gesture_tag_redraw(C);
- if (RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor")) {
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
+ }
return OPERATOR_RUNNING_MODAL;
}
@@ -3448,8 +3453,9 @@ int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *e
wm_gesture_tag_redraw(C);
- if (RNA_struct_find_property(op->ptr, "cursor") )
+ if (RNA_struct_find_property(op->ptr, "cursor")) {
WM_cursor_modal_set(CTX_wm_window(C), RNA_int_get(op->ptr, "cursor"));
+ }
return OPERATOR_RUNNING_MODAL;
}