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>2015-04-04 23:22:49 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-04-04 23:54:34 +0300
commitcedd7cde442edc57b3aa1a562b3c0855a2db8d8b (patch)
treee92c61f9382aceeeeccf8b81fe0cd8243a8b29d5
parent8eac4085be42f01d09843e918936a01d3615d518 (diff)
WM: prefer define over zero wmEvent.val
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/screen/screen_ops.c2
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c6
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
4 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 0c5d381ed27..3a564cc6ddb 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1887,7 +1887,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
* (Disabling RIGHTMOUSE case here results in bugs like [#32647])
* also making sure we have a valid event value, to not exit too early
*/
- if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && event->val != 0) {
+ if (ELEM(event->type, LEFTMOUSE, RIGHTMOUSE) && (event->val != KM_NOTHING)) {
/* if painting, end stroke */
if (p->status == GP_STATUS_PAINTING) {
int sketch = 0;
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 2064555f27e..894a801b677 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -717,7 +717,7 @@ static void actionzone_apply(bContext *C, wmOperator *op, int type)
else
event.type = EVT_ACTIONZONE_REGION;
- event.val = 0;
+ event.val = KM_NOTHING;
event.customdata = op->customdata;
event.customdatafree = true;
op->customdata = NULL;
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 5fd6342b95e..8c013eb7cd4 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -3116,7 +3116,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.x = evt->x = pd->x;
event.y = evt->y = pd->y;
- event.val = 0;
+ event.val = KM_NOTHING;
/* Use prevx/prevy so we can calculate the delta later */
event.prevx = event.x - pd->deltaX;
@@ -3323,7 +3323,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
event.type = TIMER;
event.custom = EVT_DATA_TIMER;
event.customdata = customdata;
- event.val = 0;
+ event.val = KM_NOTHING;
event.keymodifier = 0;
wm_event_add(win, &event);
@@ -3333,7 +3333,7 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, int U
case GHOST_kEventNDOFMotion:
{
event.type = NDOF_MOTION;
- event.val = 0;
+ event.val = KM_NOTHING;
attach_ndof_data(&event, customdata);
wm_event_add(win, &event);
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 98766f35006..5c05d86da57 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1202,7 +1202,7 @@ static int wm_window_timer(const bContext *C)
wm_event_init_from_window(win, &event);
event.type = wt->event_type;
- event.val = 0;
+ event.val = KM_NOTHING;
event.keymodifier = 0;
event.custom = EVT_DATA_TIMER;
event.customdata = wt;