[Bf-blender-cvs] [7cd9926fd87] master: Cleanup: use const for events

Campbell Barton noreply at git.blender.org
Sat Oct 14 08:32:52 CEST 2017


Commit: 7cd9926fd876c457fce925f68e3d641015c2f978
Author: Campbell Barton
Date:   Sat Oct 14 17:29:54 2017 +1100
Branches: master
https://developer.blender.org/rB7cd9926fd876c457fce925f68e3d641015c2f978

Cleanup: use const for events

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

M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/interface/interface_panel.c
M	source/blender/editors/object/object_add.c
M	source/blender/editors/screen/screen_edit.c
M	source/blender/windowmanager/intern/wm_dragdrop.c
M	source/blender/windowmanager/intern/wm_operators.c
M	source/blender/windowmanager/wm.h
M	source/blender/windowmanager/wm_event_system.h

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

diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index ec09add56b8..4253e214537 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -107,7 +107,7 @@ bool    ED_screen_set(struct bContext *C, struct bScreen *sc);
 bool    ED_screen_delete(struct bContext *C, struct bScreen *sc);
 void    ED_screen_set_scene(struct bContext *C, struct bScreen *screen, struct Scene *scene);
 bool    ED_screen_delete_scene(struct bContext *C, struct Scene *scene);
-void    ED_screen_set_subwinactive(struct bContext *C, struct wmEvent *event);
+void    ED_screen_set_subwinactive(struct bContext *C, const struct wmEvent *event);
 void    ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
 void    ED_screen_animation_timer(struct bContext *C, int redraws, int refresh, int sync, int enable);
 void    ED_screen_animation_timer_update(struct bScreen *screen, int redraws, int refresh);
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index d53cdddb26f..d9685d7281b 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1281,7 +1281,7 @@ static int ui_panel_drag_collapse_handler(bContext *C, const wmEvent *event, voi
 static void ui_panel_drag_collapse_handler_add(const bContext *C, const bool was_open)
 {
 	wmWindow *win = CTX_wm_window(C);
-	wmEvent *event = win->eventstate;
+	const wmEvent *event = win->eventstate;
 	uiPanelDragCollapseHandle *dragcol_data = MEM_mallocN(sizeof(*dragcol_data), __func__);
 
 	dragcol_data->was_first_open = was_open;
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 74da6817185..a0bb5ce3fc9 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -979,7 +979,7 @@ static int group_instance_add_exec(bContext *C, wmOperator *op)
 		group = (Group *)BKE_libblock_find_name(ID_GR, name);
 		
 		if (0 == RNA_struct_property_is_set(op->ptr, "location")) {
-			wmEvent *event = CTX_wm_window(C)->eventstate;
+			const wmEvent *event = CTX_wm_window(C)->eventstate;
 			ARegion *ar = CTX_wm_region(C);
 			const int mval[2] = {event->x - ar->winrct.xmin,
 			                     event->y - ar->winrct.ymin};
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c
index c99e452b755..8f1132dc1e5 100644
--- a/source/blender/editors/screen/screen_edit.c
+++ b/source/blender/editors/screen/screen_edit.c
@@ -1363,7 +1363,7 @@ void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen)
 /* *********************************** */
 
 /* case when on area-edge or in azones, or outside window */
-static void screen_cursor_set(wmWindow *win, wmEvent *event)
+static void screen_cursor_set(wmWindow *win, const wmEvent *event)
 {
 	const int winsize_x = WM_window_pixels_x(win);
 	const int winsize_y = WM_window_pixels_y(win);
@@ -1402,7 +1402,7 @@ static void screen_cursor_set(wmWindow *win, wmEvent *event)
 
 /* called in wm_event_system.c. sets state vars in screen, cursors */
 /* event type is mouse move */
-void ED_screen_set_subwinactive(bContext *C, wmEvent *event)
+void ED_screen_set_subwinactive(bContext *C, const wmEvent *event)
 {
 	wmWindow *win = CTX_wm_window(C);
 	
diff --git a/source/blender/windowmanager/intern/wm_dragdrop.c b/source/blender/windowmanager/intern/wm_dragdrop.c
index 3a53906a8e8..dd01efdb4c4 100644
--- a/source/blender/windowmanager/intern/wm_dragdrop.c
+++ b/source/blender/windowmanager/intern/wm_dragdrop.c
@@ -185,7 +185,7 @@ void WM_drag_free_list(struct ListBase *lb)
 	}
 }
 
-static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, wmEvent *event)
+static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag, const wmEvent *event)
 {
 	wmEventHandler *handler = handlers->first;
 	for (; handler; handler = handler->next) {
@@ -203,7 +203,7 @@ static const char *dropbox_active(bContext *C, ListBase *handlers, wmDrag *drag,
 }
 
 /* return active operator name when mouse is in box */
-static const char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
+static const char *wm_dropbox_active(bContext *C, wmDrag *drag, const wmEvent *event)
 {
 	wmWindow *win = CTX_wm_window(C);
 	ScrArea *sa = CTX_wm_area(C);
@@ -223,7 +223,7 @@ static const char *wm_dropbox_active(bContext *C, wmDrag *drag, wmEvent *event)
 }
 
 
-static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
+static void wm_drop_operator_options(bContext *C, wmDrag *drag, const wmEvent *event)
 {
 	wmWindow *win = CTX_wm_window(C);
 	const int winsize_x = WM_window_pixels_x(win);
@@ -253,7 +253,7 @@ static void wm_drop_operator_options(bContext *C, wmDrag *drag, wmEvent *event)
 }
 
 /* called in inner handler loop, region context */
-void wm_drags_check_ops(bContext *C, wmEvent *event)
+void wm_drags_check_ops(bContext *C, const wmEvent *event)
 {
 	wmWindowManager *wm = CTX_wm_manager(C);
 	wmDrag *drag;
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 51c551cd9a5..ae5a8319b00 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2595,7 +2595,7 @@ static void tweak_gesture_modal(bContext *C, const wmEvent *event)
 }
 
 /* standard tweak, called after window handlers passed on event */
-void wm_tweakevent_test(bContext *C, wmEvent *event, int action)
+void wm_tweakevent_test(bContext *C, const wmEvent *event, int action)
 {
 	wmWindow *win = CTX_wm_window(C);
 	
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h
index e8485359490..1206c2b194a 100644
--- a/source/blender/windowmanager/wm.h
+++ b/source/blender/windowmanager/wm.h
@@ -57,7 +57,7 @@ void wm_operatortype_free(void);
 void wm_operatortype_init(void);
 void wm_window_keymap(wmKeyConfig *keyconf);
 
-void wm_tweakevent_test(bContext *C, wmEvent *event, int action);
+void wm_tweakevent_test(bContext *C, const wmEvent *event, int action);
 
 /* wm_gesture.c */
 #define WM_LASSO_MIN_POINTS		1024
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index 3fb9cd617bf..ae04aa5c51b 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -94,7 +94,7 @@ void        wm_event_do_notifiers(bContext *C);
 
 /* wm_dropbox.c */
 void        wm_dropbox_free(void);
-void        wm_drags_check_ops(bContext *C, wmEvent *event);
+void        wm_drags_check_ops(bContext *C, const wmEvent *event);
 void        wm_drags_draw(bContext *C, wmWindow *win, rcti *rect);
 
 #endif /* __WM_EVENT_SYSTEM_H__ */



More information about the Bf-blender-cvs mailing list