remove return argument from wmOperatorType->cancel, was only ever returning OPERATOR_...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 Oct 2013 23:08:53 +0000 (23:08 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 Oct 2013 23:08:53 +0000 (23:08 +0000)
47 files changed:
intern/rigidbody/CMakeLists.txt
release/scripts/templates_py/operator_modal_timer.py
source/blender/editors/animation/anim_markers.c
source/blender/editors/armature/editarmature_sketch.c
source/blender/editors/armature/pose_lib.c
source/blender/editors/armature/pose_slide.c
source/blender/editors/curve/editfont.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/interface/interface_eyedropper.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/mesh/editmesh_bevel.c
source/blender/editors/mesh/editmesh_inset.c
source/blender/editors/mesh/editmesh_knife.c
source/blender/editors/mesh/editmesh_loopcut.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/screen/screen_ops.c
source/blender/editors/screen/screendump.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_intern.h
source/blender/editors/sculpt_paint/paint_ops.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sound/sound_ops.c
source/blender/editors/space_buttons/buttons_ops.c
source/blender/editors/space_clip/clip_ops.c
source/blender/editors/space_console/console_ops.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_relationships.c
source/blender/editors/space_node/node_view.c
source/blender/editors/space_sequencer/sequencer_view.c
source/blender/editors/space_text/text_autocomplete.c
source/blender/editors/space_text/text_ops.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_fly.c
source/blender/editors/space_view3d/view3d_ruler.c
source/blender/editors/transform/transform_ops.c
source/blender/editors/uvedit/uvedit_smart_stitch.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c
source/blender/makesrna/intern/rna_wm.c
source/blender/makesrna/intern/rna_wm_api.c
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_operators.c

index bea3075..3a2edba 100644 (file)
 
 set(INC
        .
-       ../../extern/bullet2/src
 )
 
 set(INC_SYS
-
+       ../../extern/bullet2/src
 )
 
 set(SRC
index b821112..4d36860 100644 (file)
@@ -29,7 +29,6 @@ class ModalTimerOperator(bpy.types.Operator):
     def cancel(self, context):
         wm = context.window_manager
         wm.event_timer_remove(self._timer)
-        return {'CANCELLED'}
 
 
 def register():
index 1e8f2bf..b057ea2 100644 (file)
@@ -711,13 +711,11 @@ static void ed_marker_move_apply(bContext *C, wmOperator *op)
 }
 
 /* only for modal */
-static int ed_marker_move_cancel(bContext *C, wmOperator *op)
+static void ed_marker_move_cancel(bContext *C, wmOperator *op)
 {
        RNA_int_set(op->ptr, "frames", 0);
        ed_marker_move_apply(C, op);
        ed_marker_move_exit(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 
index 8ae1b95..36999c1 100644 (file)
@@ -2339,7 +2339,7 @@ static int sketch_convert(bContext *C, wmOperator *UNUSED(op), const wmEvent *UN
        return OPERATOR_FINISHED;
 }
 
-static int sketch_cancel(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
+static int sketch_cancel_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
 {
        SK_Sketch *sketch = contextSketch(C, 0);
        if (sketch != NULL) {
@@ -2374,12 +2374,11 @@ static int sketch_select(bContext *C, wmOperator *UNUSED(op), const wmEvent *eve
        return OPERATOR_FINISHED;
 }
 
-static int sketch_draw_stroke_cancel(bContext *C, wmOperator *op)
+static void sketch_draw_stroke_cancel(bContext *C, wmOperator *op)
 {
        SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */
        sk_cancelStroke(sketch);
        MEM_freeN(op->customdata);
-       return OPERATOR_CANCELLED;
 }
 
 static int sketch_draw_stroke(bContext *C, wmOperator *op, const wmEvent *event)
@@ -2400,12 +2399,11 @@ static int sketch_draw_stroke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int sketch_draw_gesture_cancel(bContext *C, wmOperator *op)
+static void sketch_draw_gesture_cancel(bContext *C, wmOperator *op)
 {
        SK_Sketch *sketch = contextSketch(C, 1); /* create just to be sure */
        sk_cancelStroke(sketch);
        MEM_freeN(op->customdata);
-       return OPERATOR_CANCELLED;
 }
 
 static int sketch_draw_gesture(bContext *C, wmOperator *op, const wmEvent *event)
@@ -2622,7 +2620,7 @@ void SKETCH_OT_cancel_stroke(wmOperatorType *ot)
        ot->description = "Cancel the current sketch stroke";
 
        /* api callbacks */
-       ot->invoke = sketch_cancel;
+       ot->invoke = sketch_cancel_invoke;
 
        ot->poll = ED_operator_sketch_mode_active_stroke;
 
index 182f94b..4a40eff 100644 (file)
@@ -1532,10 +1532,9 @@ static int poselib_preview_exit(bContext *C, wmOperator *op)
 }
 
 /* Cancel previewing operation (called when exiting Blender) */
-static int poselib_preview_cancel(bContext *C, wmOperator *op)
+static void poselib_preview_cancel(bContext *C, wmOperator *op)
 {
        poselib_preview_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 /* main modal status check */
index d0e1b15..8265270 100644 (file)
@@ -682,11 +682,10 @@ static int pose_slide_modal(bContext *C, wmOperator *op, const wmEvent *event)
 }
 
 /* common code for cancel() */
-static int pose_slide_cancel(bContext *UNUSED(C), wmOperator *op)
+static void pose_slide_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        /* cleanup and done */
        pose_slide_exit(op);
-       return OPERATOR_CANCELLED;
 }
 
 /* common code for exec() methods */
index ac9c338..dc58e84 100644 (file)
@@ -1613,11 +1613,10 @@ static void font_ui_template_init(bContext *C, wmOperator *op)
        uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
 }
 
-static int font_open_cancel(bContext *UNUSED(C), wmOperator *op)
+static void font_open_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-       return OPERATOR_CANCELLED;
 }
 
 static int font_open_exec(bContext *C, wmOperator *op)
index 98fff3d..4491737 100644 (file)
@@ -1456,11 +1456,10 @@ static void gpencil_draw_exit(bContext *C, wmOperator *op)
        op->customdata = NULL;
 }
 
-static int gpencil_draw_cancel(bContext *C, wmOperator *op)
+static void gpencil_draw_cancel(bContext *C, wmOperator *op)
 {
        /* this is just a wrapper around exit() */
        gpencil_draw_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 /* ------------------------------- */
index 783a777..01e53d5 100644 (file)
@@ -122,10 +122,9 @@ static void eyedropper_exit(bContext *C, wmOperator *op)
        }
 }
 
-static int eyedropper_cancel(bContext *C, wmOperator *op)
+static void eyedropper_cancel(bContext *C, wmOperator *op)
 {
        eyedropper_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 /* *** eyedropper_color_ helper functions *** */
@@ -243,7 +242,8 @@ static int eyedropper_modal(bContext *C, wmOperator *op, const wmEvent *event)
        switch (event->type) {
                case ESCKEY:
                case RIGHTMOUSE:
-                       return eyedropper_cancel(C, op);
+                       eyedropper_cancel(C, op);
+                       return OPERATOR_CANCELLED;
                case LEFTMOUSE:
                        if (event->val == KM_RELEASE) {
                                if (eye->accum_tot == 0) {
@@ -447,10 +447,9 @@ static void datadropper_exit(bContext *C, wmOperator *op)
        }
 }
 
-static int datadropper_cancel(bContext *C, wmOperator *op)
+static void datadropper_cancel(bContext *C, wmOperator *op)
 {
        datadropper_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 /* *** datadropper id helper functions *** */
@@ -552,7 +551,8 @@ static int datadropper_modal(bContext *C, wmOperator *op, const wmEvent *event)
        switch (event->type) {
                case ESCKEY:
                case RIGHTMOUSE:
-                       return datadropper_cancel(C, op);
+                       datadropper_cancel(C, op);
+                       return OPERATOR_CANCELLED;
                case LEFTMOUSE:
                        if (event->val == KM_RELEASE) {
                                bool success;
index 0011366..c5c9b1c 100644 (file)
@@ -284,10 +284,9 @@ static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int view_pan_cancel(bContext *UNUSED(C), wmOperator *op)
+static void view_pan_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        view_pan_exit(op);
-       return OPERATOR_CANCELLED;
 }
 
 static void VIEW2D_OT_pan(wmOperatorType *ot)
@@ -906,11 +905,9 @@ static void view_zoomdrag_exit(bContext *C, wmOperator *op)
        }
 } 
 
-static int view_zoomdrag_cancel(bContext *C, wmOperator *op)
+static void view_zoomdrag_cancel(bContext *C, wmOperator *op)
 {
        view_zoomdrag_exit(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 /* for 'redo' only, with no user input */
@@ -1579,11 +1576,9 @@ static void scroller_activate_exit(bContext *C, wmOperator *op)
        }
 }
 
-static int scroller_activate_cancel(bContext *C, wmOperator *op)
+static void scroller_activate_cancel(bContext *C, wmOperator *op)
 {
        scroller_activate_exit(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 /* apply transform to view (i.e. adjust 'cur' rect) */
index 97da004..dd3aacb 100644 (file)
@@ -185,7 +185,7 @@ static void edbm_bevel_exit(bContext *C, wmOperator *op)
        op->customdata = NULL;
 }
 
-static int edbm_bevel_cancel(bContext *C, wmOperator *op)
+static void edbm_bevel_cancel(bContext *C, wmOperator *op)
 {
        BevelData *opdata = op->customdata;
        if (opdata->is_modal) {
@@ -197,7 +197,6 @@ static int edbm_bevel_cancel(bContext *C, wmOperator *op)
 
        /* need to force redisplay or we may still view the modified result */
        ED_region_tag_redraw(CTX_wm_region(C));
-       return OPERATOR_CANCELLED;
 }
 
 /* bevel! yay!!*/
index eb66cf5..1375544 100644 (file)
@@ -166,7 +166,7 @@ static void edbm_inset_exit(bContext *C, wmOperator *op)
        MEM_freeN(op->customdata);
 }
 
-static int edbm_inset_cancel(bContext *C, wmOperator *op)
+static void edbm_inset_cancel(bContext *C, wmOperator *op)
 {
        InsetData *opdata;
 
@@ -180,7 +180,6 @@ static int edbm_inset_cancel(bContext *C, wmOperator *op)
 
        /* need to force redisplay or we may still view the modified result */
        ED_region_tag_redraw(CTX_wm_region(C));
-       return OPERATOR_CANCELLED;
 }
 
 static bool edbm_inset_calc(wmOperator *op)
index 5d88516..306aeda 100644 (file)
@@ -3195,11 +3195,10 @@ static void knifetool_init(bContext *C, KnifeTool_OpData *kcd,
        }
 }
 
-static int knifetool_cancel(bContext *C, wmOperator *op)
+static void knifetool_cancel(bContext *C, wmOperator *op)
 {
        /* this is just a wrapper around exit() */
        knifetool_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 static int knifetool_invoke(bContext *C, wmOperator *op, const wmEvent *event)
index 3066fb8..9223f6d 100644 (file)
@@ -418,11 +418,10 @@ static int ringsel_init(bContext *C, wmOperator *op, bool do_cut)
        return 1;
 }
 
-static int ringcut_cancel(bContext *C, wmOperator *op)
+static void ringcut_cancel(bContext *C, wmOperator *op)
 {
        /* this is just a wrapper around exit() */
        ringsel_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 static void loopcut_update_edge(RingSelOpData *lcd, BMEdge *e, const int previewlines)
@@ -549,7 +548,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                        ringsel_exit(C, op);
                                }
                                else {
-                                       return ringcut_cancel(C, op);
+                                       ringcut_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
 
                                return OPERATOR_FINISHED;
@@ -569,7 +569,8 @@ static int loopcut_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                ED_region_tag_redraw(lcd->ar);
                                ED_area_headerprint(CTX_wm_area(C), NULL);
                                
-                               return ringcut_cancel(C, op);
+                               ringcut_cancel(C, op);
+                               return OPERATOR_CANCELLED;
                        }
                        
                        ED_region_tag_redraw(lcd->ar);
index b0e19d0..65a3e5b 100644 (file)
@@ -3880,11 +3880,9 @@ static int brush_edit_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int brush_edit_cancel(bContext *UNUSED(C), wmOperator *op)
+static void brush_edit_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        brush_edit_exit(op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void PARTICLE_OT_brush_edit(wmOperatorType *ot)
index df8d5ec..a472350 100644 (file)
@@ -564,15 +564,13 @@ static int screen_render_modal(bContext *C, wmOperator *op, const wmEvent *event
        return OPERATOR_PASS_THROUGH;
 }
 
-static int screen_render_cancel(bContext *C, wmOperator *op)
+static void screen_render_cancel(bContext *C, wmOperator *op)
 {
        wmWindowManager *wm = CTX_wm_manager(C);
        Scene *scene = (Scene *) op->customdata;
 
        /* kill on cancel, because job is using op->reports */
        WM_jobs_kill_type(wm, scene, WM_JOB_TYPE_RENDER);
-
-       return OPERATOR_CANCELLED;
 }
 
 /* using context, starts job */
index 21074bd..107674b 100644 (file)
@@ -485,11 +485,9 @@ static void screen_opengl_render_end(bContext *C, OGLRender *oglrender)
        MEM_freeN(oglrender);
 }
 
-static int screen_opengl_render_cancel(bContext *C, wmOperator *op)
+static void screen_opengl_render_cancel(bContext *C, wmOperator *op)
 {
        screen_opengl_render_end(C, op->customdata);
-
-       return OPERATOR_CANCELLED;
 }
 
 /* share between invoke and exec */
index 3cecbbb..b226104 100644 (file)
@@ -750,11 +750,9 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int actionzone_cancel(bContext *UNUSED(C), wmOperator *op)
+static void actionzone_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        actionzone_exit(op);
-
-       return OPERATOR_CANCELLED;
 }
 
 static void SCREEN_OT_actionzone(wmOperatorType *ot)
@@ -825,10 +823,9 @@ static void area_swap_exit(bContext *C, wmOperator *op)
        op->customdata = NULL;
 }
 
-static int area_swap_cancel(bContext *C, wmOperator *op)
+static void area_swap_cancel(bContext *C, wmOperator *op)
 {
        area_swap_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 static int area_swap_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@@ -857,8 +854,8 @@ static int area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event)
                case LEFTMOUSE: /* release LMB */
                        if (event->val == KM_RELEASE) {
                                if (!sad->sa2 || sad->sa1 == sad->sa2) {
-                                       
-                                       return area_swap_cancel(C, op);
+                                       area_swap_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
 
                                ED_area_tag_redraw(sad->sa1);
@@ -875,7 +872,8 @@ static int area_swap_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        break;
                        
                case ESCKEY:
-                       return area_swap_cancel(C, op);
+                       area_swap_cancel(C, op);
+                       return OPERATOR_CANCELLED;
        }
        return OPERATOR_RUNNING_MODAL;
 }
@@ -1148,14 +1146,12 @@ static int area_move_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int area_move_cancel(bContext *C, wmOperator *op)
+static void area_move_cancel(bContext *C, wmOperator *op)
 {
        
        RNA_int_set(op->ptr, "delta", 0);
        area_move_apply(C, op);
        area_move_exit(C, op);
-       
-       return OPERATOR_CANCELLED;
 }
 
 /* modal callback for while moving edges */
@@ -1186,7 +1182,8 @@ static int area_move_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                        return OPERATOR_FINISHED;
                                        
                                case KM_MODAL_CANCEL:
-                                       return area_move_cancel(C, op);
+                                       area_move_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                        
                                case KM_MODAL_STEP10:
                                        md->step = 10;
@@ -1530,7 +1527,7 @@ static int area_split_exec(bContext *C, wmOperator *op)
 }
 
 
-static int area_split_cancel(bContext *C, wmOperator *op)
+static void area_split_cancel(bContext *C, wmOperator *op)
 {
        sAreaSplitData *sd = (sAreaSplitData *)op->customdata;
        
@@ -1546,8 +1543,6 @@ static int area_split_cancel(bContext *C, wmOperator *op)
                }
        }
        area_split_exit(C, op);
-       
-       return OPERATOR_CANCELLED;
 }
 
 static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
@@ -1640,7 +1635,8 @@ static int area_split_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        
                case RIGHTMOUSE: /* cancel operation */
                case ESCKEY:
-                       return area_split_cancel(C, op);
+                       area_split_cancel(C, op);
+                       return OPERATOR_CANCELLED;
        }
        
        return OPERATOR_RUNNING_MODAL;
@@ -1915,12 +1911,10 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int region_scale_cancel(bContext *UNUSED(C), wmOperator *op)
+static void region_scale_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-
-       return OPERATOR_CANCELLED;
 }
 
 static void SCREEN_OT_region_scale(wmOperatorType *ot)
@@ -2449,7 +2443,7 @@ static int area_join_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int area_join_cancel(bContext *C, wmOperator *op)
+static void area_join_cancel(bContext *C, wmOperator *op)
 {
        sAreaJoinData *jd = (sAreaJoinData *)op->customdata;
        
@@ -2465,8 +2459,6 @@ static int area_join_cancel(bContext *C, wmOperator *op)
        WM_event_add_notifier(C, NC_WINDOW, NULL);
        
        area_join_exit(C, op);
-       
-       return OPERATOR_CANCELLED;
 }
 
 /* modal callback while selecting area (space) that will be removed */
@@ -2554,7 +2546,8 @@ static int area_join_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        
                case RIGHTMOUSE:
                case ESCKEY:
-                       return area_join_cancel(C, op);
+                       area_join_cancel(C, op);
+                       return OPERATOR_CANCELLED;
        }
        
        return OPERATOR_RUNNING_MODAL;
index 06581fb..0153d60 100644 (file)
@@ -237,10 +237,9 @@ static bool screenshot_check(bContext *UNUSED(C), wmOperator *op)
        return WM_operator_filesel_ensure_ext_imtype(op, &scd->im_format);
 }
 
-static int screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
+static void screenshot_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        screenshot_data_free(op);
-       return OPERATOR_CANCELLED;
 }
 
 static bool screenshot_draw_check_prop(PointerRNA *UNUSED(ptr), PropertyRNA *prop)
index 9e8a8fd..003db8a 100644 (file)
@@ -898,10 +898,9 @@ static int grab_clone_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int grab_clone_cancel(bContext *UNUSED(C), wmOperator *op)
+static void grab_clone_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
-       return OPERATOR_CANCELLED;
 }
 
 void PAINT_OT_grab_clone(wmOperatorType *ot)
index f276e68..5fff02f 100644 (file)
@@ -80,7 +80,7 @@ bool paint_supports_jitter(enum PaintMode mode);
 struct wmKeyMap *paint_stroke_modal_keymap(struct wmKeyConfig *keyconf);
 int paint_stroke_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
 int paint_stroke_exec(struct bContext *C, struct wmOperator *op);
-int paint_stroke_cancel(struct bContext *C, struct wmOperator *op);
+void paint_stroke_cancel(struct bContext *C, struct wmOperator *op);
 struct ViewContext *paint_stroke_view_context(struct PaintStroke *stroke);
 void *paint_stroke_mode_data(struct PaintStroke *stroke);
 void paint_stroke_set_mode_data(struct PaintStroke *stroke, void *mode_data);
index 03c0636..55ea036 100644 (file)
@@ -613,13 +613,12 @@ static void stencil_restore(StencilControlData *scd)
        *scd->rot_target = scd->init_rot;
 }
 
-static int stencil_control_cancel(bContext *UNUSED(C), wmOperator *op)
+static void stencil_control_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        StencilControlData *scd = op->customdata;
 
        stencil_restore(scd);
        MEM_freeN(op->customdata);
-       return OPERATOR_CANCELLED;
 }
 
 static void stencil_control_calculate(StencilControlData *scd, const int mval[2])
index b00b1c3..397baea 100644 (file)
@@ -718,10 +718,13 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event)
 
        /* Cancel */
        if (event->type == EVT_MODAL_MAP && event->val == PAINT_STROKE_MODAL_CANCEL) {
-               if (op->type->cancel)
-                       return op->type->cancel(C, op);
-               else
-                       return paint_stroke_cancel(C, op);
+               if (op->type->cancel) {
+                       op->type->cancel(C, op);
+               }
+               else {
+                       paint_stroke_cancel(C, op);
+               }
+               return OPERATOR_CANCELLED;
        }
 
        if (event->type == stroke->event_type && event->val == KM_RELEASE && !first_modal) {
@@ -787,10 +790,9 @@ int paint_stroke_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-int paint_stroke_cancel(bContext *C, wmOperator *op)
+void paint_stroke_cancel(bContext *C, wmOperator *op)
 {
        stroke_done(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 ViewContext *paint_stroke_view_context(PaintStroke *stroke)
index 1c3caf5..db71ca1 100644 (file)
@@ -2593,11 +2593,9 @@ static int wpaint_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int wpaint_cancel(bContext *C, wmOperator *op)
+static void wpaint_cancel(bContext *C, wmOperator *op)
 {
        paint_stroke_cancel(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void PAINT_OT_weight_paint(wmOperatorType *ot)
@@ -3144,11 +3142,9 @@ static int vpaint_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int vpaint_cancel(bContext *C, wmOperator *op)
+static void vpaint_cancel(bContext *C, wmOperator *op)
 {
        paint_stroke_cancel(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void PAINT_OT_vertex_paint(wmOperatorType *ot)
index 488504b..6bd935a 100644 (file)
@@ -4567,7 +4567,7 @@ static int sculpt_brush_stroke_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
+static void sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
 {
        Object *ob = CTX_data_active_object(C);
        SculptSession *ss = ob->sculpt;
@@ -4585,8 +4585,6 @@ static int sculpt_brush_stroke_cancel(bContext *C, wmOperator *op)
        }
 
        sculpt_brush_exit_tex(sd);
-
-       return OPERATOR_CANCELLED;
 }
 
 static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
index a2189f6..81b0992 100644 (file)
 
 /******************** open sound operator ********************/
 
-static int sound_open_cancel(bContext *UNUSED(C), wmOperator *op)
+static void sound_open_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-       return OPERATOR_CANCELLED;
 }
 
 static void sound_open_init(bContext *C, wmOperator *op)
index cf27795..4fbf5aa 100644 (file)
@@ -158,12 +158,10 @@ static int file_browse_exec(bContext *C, wmOperator *op)
        return OPERATOR_FINISHED;
 }
 
-static int file_browse_cancel(bContext *UNUSED(C), wmOperator *op)
+static void file_browse_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-
-       return OPERATOR_CANCELLED;
 }
 
 static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
index a76f436..9aa6eab 100644 (file)
@@ -159,12 +159,10 @@ static void open_init(bContext *C, wmOperator *op)
        uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
 }
 
-static int open_cancel(bContext *UNUSED(C), wmOperator *op)
+static void open_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-
-       return OPERATOR_CANCELLED;
 }
 
 static int open_exec(bContext *C, wmOperator *op)
@@ -444,11 +442,9 @@ static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int view_pan_cancel(bContext *C, wmOperator *op)
+static void view_pan_cancel(bContext *C, wmOperator *op)
 {
-       view_pan_exit(C, op, 1);
-
-       return OPERATOR_CANCELLED;
+       view_pan_exit(C, op, true);
 }
 
 void CLIP_OT_view_pan(wmOperatorType *ot)
@@ -578,11 +574,9 @@ static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int view_zoom_cancel(bContext *C, wmOperator *op)
+static void view_zoom_cancel(bContext *C, wmOperator *op)
 {
-       view_zoom_exit(C, op, 1);
-
-       return OPERATOR_CANCELLED;
+       view_zoom_exit(C, op, true);
 }
 
 void CLIP_OT_view_zoom(wmOperatorType *ot)
index 289986d..f24a204 100644 (file)
@@ -1123,10 +1123,9 @@ static int console_modal_select(bContext *C, wmOperator *op, const wmEvent *even
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int console_modal_select_cancel(bContext *C, wmOperator *op)
+static void console_modal_select_cancel(bContext *C, wmOperator *op)
 {
        console_cursor_set_exit(C, op);
-       return OPERATOR_FINISHED;
 }
 
 void CONSOLE_OT_select_set(wmOperatorType *ot)
index 710d5c8..ebcc8c2 100644 (file)
@@ -256,7 +256,7 @@ static void image_view_pan_init(bContext *C, wmOperator *op, const wmEvent *even
        WM_event_add_modal_handler(C, op);
 }
 
-static void image_view_pan_exit(bContext *C, wmOperator *op, int cancel)
+static void image_view_pan_exit(bContext *C, wmOperator *op, bool cancel)
 {
        SpaceImage *sima = CTX_wm_space_image(C);
        ViewPanData *vpd = op->customdata;
@@ -330,7 +330,7 @@ static int image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *even
                        break;
                default:
                        if (event->type == vpd->event_type && event->val == KM_RELEASE) {
-                               image_view_pan_exit(C, op, 0);
+                               image_view_pan_exit(C, op, false);
                                return OPERATOR_FINISHED;
                        }
                        break;
@@ -339,10 +339,9 @@ static int image_view_pan_modal(bContext *C, wmOperator *op, const wmEvent *even
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int image_view_pan_cancel(bContext *C, wmOperator *op)
+static void image_view_pan_cancel(bContext *C, wmOperator *op)
 {
-       image_view_pan_exit(C, op, 1);
-       return OPERATOR_CANCELLED;
+       image_view_pan_exit(C, op, true);
 }
 
 void IMAGE_OT_view_pan(wmOperatorType *ot)
@@ -412,7 +411,7 @@ static void image_view_zoom_init(bContext *C, wmOperator *op, const wmEvent *eve
        WM_event_add_modal_handler(C, op);
 }
 
-static void image_view_zoom_exit(bContext *C, wmOperator *op, int cancel)
+static void image_view_zoom_exit(bContext *C, wmOperator *op, bool cancel)
 {
        SpaceImage *sima = CTX_wm_space_image(C);
        ViewZoomData *vpd = op->customdata;
@@ -547,17 +546,16 @@ static int image_view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *eve
                image_zoom_apply(vpd, op, event->x, event->y, U.viewzoom, (U.uiflag & USER_ZOOM_INVERT) != 0);
        }
        else if (event_code == VIEW_CONFIRM) {
-               image_view_zoom_exit(C, op, 0);
+               image_view_zoom_exit(C, op, false);
                return OPERATOR_FINISHED;
        }
 
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int image_view_zoom_cancel(bContext *C, wmOperator *op)
+static void image_view_zoom_cancel(bContext *C, wmOperator *op)
 {
-       image_view_zoom_exit(C, op, 1);
-       return OPERATOR_CANCELLED;
+       image_view_zoom_exit(C, op, true);
 }
 
 void IMAGE_OT_view_zoom(wmOperatorType *ot)
@@ -921,11 +919,10 @@ static void image_open_init(bContext *C, wmOperator *op)
        uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
 }
 
-static int image_open_cancel(bContext *UNUSED(C), wmOperator *op)
+static void image_open_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-       return OPERATOR_CANCELLED;
 }
 
 static int image_open_exec(bContext *C, wmOperator *op)
@@ -1505,11 +1502,9 @@ static int image_save_as_invoke(bContext *C, wmOperator *op, const wmEvent *UNUS
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int image_save_as_cancel(bContext *UNUSED(C), wmOperator *op)
+static void image_save_as_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        image_save_as_free(op);
-
-       return OPERATOR_CANCELLED;
 }
 
 static bool image_save_as_draw_check_prop(PointerRNA *ptr, PropertyRNA *prop)
@@ -2358,10 +2353,9 @@ static int image_sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int image_sample_cancel(bContext *C, wmOperator *op)
+static void image_sample_cancel(bContext *C, wmOperator *op)
 {
        image_sample_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 void IMAGE_OT_sample(wmOperatorType *ot)
@@ -2625,7 +2619,7 @@ static int image_record_composite_modal(bContext *C, wmOperator *op, const wmEve
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int image_record_composite_cancel(bContext *C, wmOperator *op)
+static void image_record_composite_cancel(bContext *C, wmOperator *op)
 {
        image_record_composite_exit(C, op);
        return OPERATOR_CANCELLED;
index 1d93fe6..f58bc83 100644 (file)
@@ -859,7 +859,7 @@ static void node_resize_init(bContext *C, wmOperator *op, const wmEvent *UNUSED(
        WM_event_add_modal_handler(C, op);
 }
 
-static void node_resize_exit(bContext *C, wmOperator *op, int UNUSED(cancel))
+static void node_resize_exit(bContext *C, wmOperator *op, bool UNUSED(cancel))
 {
        WM_cursor_modal_restore(CTX_wm_window(C));
        
@@ -961,7 +961,7 @@ static int node_resize_modal(bContext *C, wmOperator *op, const wmEvent *event)
                case MIDDLEMOUSE:
                case RIGHTMOUSE:
                        
-                       node_resize_exit(C, op, 0);
+                       node_resize_exit(C, op, false);
                        ED_node_post_apply_transform(C, snode->edittree);
                        
                        return OPERATOR_FINISHED;
@@ -990,11 +990,9 @@ static int node_resize_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
 }
 
-static int node_resize_cancel(bContext *C, wmOperator *op)
+static void node_resize_cancel(bContext *C, wmOperator *op)
 {
-       node_resize_exit(C, op, 1);
-
-       return OPERATOR_CANCELLED;
+       node_resize_exit(C, op, true);
 }
 
 void NODE_OT_resize(wmOperatorType *ot)
index 4b5cc9e..8c40507 100644 (file)
@@ -669,7 +669,7 @@ static int node_link_invoke(bContext *C, wmOperator *op, const wmEvent *event)
                return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH;
 }
 
-static int node_link_cancel(bContext *C, wmOperator *op)
+static void node_link_cancel(bContext *C, wmOperator *op)
 {
        SpaceNode *snode = CTX_wm_space_node(C);
        bNodeLinkDrag *nldrag = op->customdata;
@@ -678,8 +678,6 @@ static int node_link_cancel(bContext *C, wmOperator *op)
 
        BLI_freelistN(&nldrag->links);
        MEM_freeN(nldrag);
-
-       return OPERATOR_CANCELLED;
 }
 
 void NODE_OT_link(wmOperatorType *ot)
index f889a8e..5ea6f8b 100644 (file)
@@ -273,12 +273,10 @@ static int snode_bg_viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int snode_bg_viewmove_cancel(bContext *UNUSED(C), wmOperator *op)
+static void snode_bg_viewmove_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
        op->customdata = NULL;
-
-       return OPERATOR_CANCELLED;
 }
 
 void NODE_OT_backimage_move(wmOperatorType *ot)
@@ -612,10 +610,9 @@ static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int sample_cancel(bContext *C, wmOperator *op)
+static void sample_cancel(bContext *C, wmOperator *op)
 {
        sample_exit(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 void NODE_OT_backimage_sample(wmOperatorType *ot)
index deb37f8..f39b30a 100644 (file)
@@ -211,11 +211,9 @@ static int sample_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int sample_cancel(bContext *C, wmOperator *op)
+static void sample_cancel(bContext *C, wmOperator *op)
 {
        sample_exit(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 static int sample_poll(bContext *C)
index eaba537..692cefd 100644 (file)
@@ -529,10 +529,9 @@ static void text_autocomplete_free(bContext *C, wmOperator *op)
        }
 }
 
-static int text_autocomplete_cancel(bContext *C, wmOperator *op)
+static void text_autocomplete_cancel(bContext *C, wmOperator *op)
 {
        text_autocomplete_free(C, op);
-       return OPERATOR_CANCELLED;
 }
 
 void TEXT_OT_autocomplete(wmOperatorType *ot)
index 4f53d03..dd5e282 100644 (file)
@@ -214,10 +214,9 @@ static void text_open_init(bContext *C, wmOperator *op)
        uiIDContextProperty(C, &pprop->ptr, &pprop->prop);
 }
 
-static int text_open_cancel(bContext *UNUSED(C), wmOperator *op)
+static void text_open_cancel(bContext *UNUSED(C), wmOperator *op)
 {
        MEM_freeN(op->customdata);
-       return OPERATOR_CANCELLED;
 }
 
 static int text_open_exec(bContext *C, wmOperator *op)
@@ -2231,11 +2230,9 @@ static int text_scroll_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int text_scroll_cancel(bContext *C, wmOperator *op)
+static void text_scroll_cancel(bContext *C, wmOperator *op)
 {
        scroll_exit(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 static int text_scroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
@@ -2706,10 +2703,9 @@ static int text_set_selection_modal(bContext *C, wmOperator *op, const wmEvent *
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int text_set_selection_cancel(bContext *C, wmOperator *op)
+static void text_set_selection_cancel(bContext *C, wmOperator *op)
 {
        text_cursor_set_exit(C, op);
-       return OPERATOR_FINISHED;
 }
 
 void TEXT_OT_selection_set(wmOperatorType *ot)
index bb41e72..80e5d19 100644 (file)
@@ -1062,11 +1062,9 @@ static int view3d_lock_poll(bContext *C)
        return false;
 }
 
-static int viewrotate_cancel(bContext *C, wmOperator *op)
+static void viewrotate_cancel(bContext *C, wmOperator *op)
 {
        viewops_data_free(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void VIEW3D_OT_rotate(wmOperatorType *ot)
@@ -1699,11 +1697,9 @@ static int viewmove_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        }
 }
 
-static int viewmove_cancel(bContext *C, wmOperator *op)
+static void viewmove_cancel(bContext *C, wmOperator *op)
 {
        viewops_data_free(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void VIEW3D_OT_move(wmOperatorType *ot)
@@ -2091,11 +2087,9 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_FINISHED;
 }
 
-static int viewzoom_cancel(bContext *C, wmOperator *op)
+static void viewzoom_cancel(bContext *C, wmOperator *op)
 {
        viewops_data_free(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void VIEW3D_OT_zoom(wmOperatorType *ot)
@@ -2332,11 +2326,9 @@ static int viewdolly_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_FINISHED;
 }
 
-static int viewdolly_cancel(bContext *C, wmOperator *op)
+static void viewdolly_cancel(bContext *C, wmOperator *op)
 {
        viewops_data_free(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void VIEW3D_OT_dolly(wmOperatorType *ot)
@@ -3772,11 +3764,9 @@ static int viewroll_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_FINISHED;
 }
 
-static int viewroll_cancel(bContext *C, wmOperator *op)
+static void viewroll_cancel(bContext *C, wmOperator *op)
 {
        viewops_data_free(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 void VIEW3D_OT_view_roll(wmOperatorType *ot)
index 9341ea9..6d04b9b 100644 (file)
@@ -1254,15 +1254,13 @@ static int fly_invoke(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int fly_cancel(bContext *C, wmOperator *op)
+static void fly_cancel(bContext *C, wmOperator *op)
 {
        FlyInfo *fly = op->customdata;
 
        fly->state = FLY_CANCEL;
        flyEnd(C, fly);
        op->customdata = NULL;
-
-       return OPERATOR_CANCELLED;
 }
 
 static int fly_modal(bContext *C, wmOperator *op, const wmEvent *event)
index bca162d..288ada3 100644 (file)
@@ -809,15 +809,13 @@ static int view3d_ruler_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int view3d_ruler_cancel(bContext *C, wmOperator *op)
+static void view3d_ruler_cancel(bContext *C, wmOperator *op)
 {
        RulerInfo *ruler_info = op->customdata;
 
        view3d_ruler_end(C, ruler_info);
        view3d_ruler_free(ruler_info);
        op->customdata = NULL;
-
-       return OPERATOR_CANCELLED;
 }
 
 static int view3d_ruler_modal(bContext *C, wmOperator *op, const wmEvent *event)
index 2904b37..4b5ae89 100644 (file)
@@ -426,15 +426,13 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return exit_code;
 }
 
-static int transform_cancel(bContext *C, wmOperator *op)
+static void transform_cancel(bContext *C, wmOperator *op)
 {
        TransInfo *t = op->customdata;
 
        t->state = TRANS_CANCEL;
        transformEnd(C, t);
        transformops_exit(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 static int transform_exec(bContext *C, wmOperator *op)
index 4b5d6d5..c234d17 100644 (file)
@@ -1998,10 +1998,9 @@ static void stitch_exit(bContext *C, wmOperator *op, int finished)
 }
 
 
-static int stitch_cancel(bContext *C, wmOperator *op)
+static void stitch_cancel(bContext *C, wmOperator *op)
 {
        stitch_exit(C, op, 0);
-       return OPERATOR_CANCELLED;
 }
 
 
@@ -2016,7 +2015,8 @@ static int stitch_exec(bContext *C, wmOperator *op)
                return OPERATOR_FINISHED;
        }
        else {
-               return stitch_cancel(C, op);
+               stitch_cancel(C, op);
+               return OPERATOR_CANCELLED;
        }
 }
 
@@ -2067,8 +2067,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
 
                        /* Cancel */
                case ESCKEY:
-                       return stitch_cancel(C, op);
-
+                       stitch_cancel(C, op);
+                       return OPERATOR_CANCELLED;
 
                case LEFTMOUSE:
                        if (event->shift && (U.flag & USER_LMOUSESELECT)) {
@@ -2076,7 +2076,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                        stitch_select(C, scene, event, state);
 
                                        if (!stitch_process_data(state, scene, FALSE)) {
-                                               return stitch_cancel(C, op);
+                                               stitch_cancel(C, op);
+                                               return OPERATOR_CANCELLED;
                                        }
                                }
                                break;
@@ -2089,7 +2090,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                        return OPERATOR_FINISHED;
                                }
                                else {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                        }
                        else {
@@ -2101,7 +2103,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        if (event->val == KM_PRESS && event->alt) {
                                state->limit_dist += 0.01f;
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                                break;
                        }
@@ -2115,7 +2118,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                state->limit_dist -= 0.01f;
                                state->limit_dist = MAX2(0.01f, state->limit_dist);
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                                break;
                        }
@@ -2128,7 +2132,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        if (event->val == KM_PRESS) {
                                state->use_limit = !state->use_limit;
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                                break;
                        }
@@ -2140,7 +2145,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                state->static_island %= state->element_map->totalIslands;
 
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                                break;
                        }
@@ -2150,7 +2156,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        if (event->val == KM_PRESS) {
                                state->midpoints = !state->midpoints;
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                        }
                        break;
@@ -2158,13 +2165,15 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        /* Select geometry*/
                case RIGHTMOUSE:
                        if (!event->shift) {
-                               return stitch_cancel(C, op);
+                               stitch_cancel(C, op);
+                               return OPERATOR_CANCELLED;
                        }
                        if (event->val == KM_PRESS && !(U.flag & USER_LMOUSESELECT)) {
                                stitch_select(C, scene, event, state);
 
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                                break;
                        }
@@ -2175,7 +2184,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                        if (event->val == KM_PRESS) {
                                state->snap_islands = !state->snap_islands;
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                                break;
                        }
@@ -2189,7 +2199,8 @@ static int stitch_modal(bContext *C, wmOperator *op, const wmEvent *event)
                                stitch_switch_selection_mode(state);
 
                                if (!stitch_process_data(state, scene, FALSE)) {
-                                       return stitch_cancel(C, op);
+                                       stitch_cancel(C, op);
+                                       return OPERATOR_CANCELLED;
                                }
                        }
                        break;
index 06ffdea..d6bd6f4 100644 (file)
@@ -542,7 +542,7 @@ static bool minimize_stretch_init(bContext *C, wmOperator *op)
        return true;
 }
 
-static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interactive)
+static void minimize_stretch_iteration(bContext *C, wmOperator *op, bool interactive)
 {
        MinStretch *ms = op->customdata;
        ScrArea *sa = CTX_wm_area(C);
@@ -570,7 +570,7 @@ static void minimize_stretch_iteration(bContext *C, wmOperator *op, int interact
        }
 }
 
-static void minimize_stretch_exit(bContext *C, wmOperator *op, int cancel)
+static void minimize_stretch_exit(bContext *C, wmOperator *op, bool cancel)
 {
        MinStretch *ms = op->customdata;
        ScrArea *sa = CTX_wm_area(C);
@@ -604,8 +604,8 @@ static int minimize_stretch_exec(bContext *C, wmOperator *op)
 
        iterations = RNA_int_get(op->ptr, "iterations");
        for (i = 0; i < iterations; i++)
-               minimize_stretch_iteration(C, op, 0);
-       minimize_stretch_exit(C, op, 0);
+               minimize_stretch_iteration(C, op, false);
+       minimize_stretch_exit(C, op, false);
 
        return OPERATOR_FINISHED;
 }
@@ -617,7 +617,7 @@ static int minimize_stretch_invoke(bContext *C, wmOperator *op, const wmEvent *U
        if (!minimize_stretch_init(C, op))
                return OPERATOR_CANCELLED;
 
-       minimize_stretch_iteration(C, op, 1);
+       minimize_stretch_iteration(C, op, true);
 
        ms = op->customdata;
        WM_event_add_modal_handler(C, op);
@@ -633,12 +633,12 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *ev
        switch (event->type) {
                case ESCKEY:
                case RIGHTMOUSE:
-                       minimize_stretch_exit(C, op, 1);
+                       minimize_stretch_exit(C, op, true);
                        return OPERATOR_CANCELLED;
                case RETKEY:
                case PADENTER:
                case LEFTMOUSE:
-                       minimize_stretch_exit(C, op, 0);
+                       minimize_stretch_exit(C, op, false);
                        return OPERATOR_FINISHED;
                case PADPLUSKEY:
                case WHEELUPMOUSE:
@@ -647,7 +647,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *ev
                                        ms->blend += 0.1f;
                                        ms->lasttime = 0.0f;
                                        RNA_float_set(op->ptr, "blend", ms->blend);
-                                       minimize_stretch_iteration(C, op, 1);
+                                       minimize_stretch_iteration(C, op, true);
                                }
                        }
                        break;
@@ -658,7 +658,7 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *ev
                                        ms->blend -= 0.1f;
                                        ms->lasttime = 0.0f;
                                        RNA_float_set(op->ptr, "blend", ms->blend);
-                                       minimize_stretch_iteration(C, op, 1);
+                                       minimize_stretch_iteration(C, op, true);
                                }
                        }
                        break;
@@ -667,25 +667,23 @@ static int minimize_stretch_modal(bContext *C, wmOperator *op, const wmEvent *ev
                                double start = PIL_check_seconds_timer();
 
                                do {
-                                       minimize_stretch_iteration(C, op, 1);
+                                       minimize_stretch_iteration(C, op, true);
                                } while (PIL_check_seconds_timer() - start < 0.01);
                        }
                        break;
        }
 
        if (ms->iterations && ms->i >= ms->iterations) {
-               minimize_stretch_exit(C, op, 0);
+               minimize_stretch_exit(C, op, false);
                return OPERATOR_FINISHED;
        }
 
        return OPERATOR_RUNNING_MODAL;
 }
 
-static int minimize_stretch_cancel(bContext *C, wmOperator *op)
+static void minimize_stretch_cancel(bContext *C, wmOperator *op)
 {
-       minimize_stretch_exit(C, op, 1);
-
-       return OPERATOR_CANCELLED;
+       minimize_stretch_exit(C, op, true);
 }
 
 void UV_OT_minimize_stretch(wmOperatorType *ot)
index dd33871..0945159 100644 (file)
@@ -1042,15 +1042,13 @@ static void operator_draw(bContext *C, wmOperator *op)
 }
 
 /* same as exec(), but call cancel */
-static int operator_cancel(bContext *C, wmOperator *op)
+static void operator_cancel(bContext *C, wmOperator *op)
 {
        extern FunctionRNA rna_Operator_cancel_func;
 
        PointerRNA opr;
        ParameterList list;
        FunctionRNA *func;
-       void *ret;
-       int result;
 
        RNA_pointer_create(NULL, op->type->ext.srna, op, &opr);
        func = &rna_Operator_cancel_func; /* RNA_struct_find_function(&opr, "cancel"); */
@@ -1059,12 +1057,7 @@ static int operator_cancel(bContext *C, wmOperator *op)
        RNA_parameter_set_lookup(&list, "context", &C);
        op->type->ext.call(C, &opr, func, &list);
 
-       RNA_parameter_get_lookup(&list, "result", &ret);
-       result = *(int *)ret;
-
        RNA_parameter_list_free(&list);
-
-       return result;
 }
 
 void operator_wrapper(wmOperatorType *ot, void *userdata);
index eb84bb6..91cddd2 100644 (file)
@@ -539,10 +539,6 @@ void RNA_api_operator(StructRNA *srna)
        RNA_def_function_flag(func, FUNC_REGISTER_OPTIONAL | FUNC_ALLOW_WRITE);
        parm = RNA_def_pointer(func, "context", "Context", "", "");
        RNA_def_property_flag(parm, PROP_REQUIRED | PROP_NEVER_NULL);
-
-       /* better name? */
-       parm = RNA_def_enum_flag(func, "result", operator_return_items, OPERATOR_CANCELLED, "result", "");
-       RNA_def_function_return(func, parm);
 }
 
 void RNA_api_macro(StructRNA *srna)
index c338d49..9bc12d0 100644 (file)
@@ -294,20 +294,20 @@ void                WM_menutype_free(void);
                        /* default operator callbacks for border/circle/lasso */
 int                    WM_border_select_invoke (struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
 int                    WM_border_select_modal  (struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
-int                    WM_border_select_cancel(struct bContext *C, struct wmOperator *op);
+void           WM_border_select_cancel(struct bContext *C, struct wmOperator *op);
 int                    WM_gesture_circle_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
 int                    WM_gesture_circle_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
-int                    WM_gesture_circle_cancel(struct bContext *C, struct wmOperator *op);
+void           WM_gesture_circle_cancel(struct bContext *C, struct wmOperator *op);
 int                    WM_gesture_lines_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
 int                    WM_gesture_lines_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
-int                    WM_gesture_lines_cancel(struct bContext *C, struct wmOperator *op);
+void           WM_gesture_lines_cancel(struct bContext *C, struct wmOperator *op);
 int                    WM_gesture_lasso_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
 int                    WM_gesture_lasso_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
-int                    WM_gesture_lasso_cancel(struct bContext *C, struct wmOperator *op);
+void           WM_gesture_lasso_cancel(struct bContext *C, struct wmOperator *op);
 const int (*WM_gesture_lasso_path_to_array(struct bContext *C, struct wmOperator *op, int *mcords_tot))[2];
 int                    WM_gesture_straightline_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
 int                    WM_gesture_straightline_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event);
-int                    WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op);
+void           WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op);
 
                        /* Gesture manager API */
 struct wmGesture *WM_gesture_new(struct bContext *C, const struct wmEvent *event, int type);
index ac9af83..6538272 100644 (file)
@@ -535,7 +535,7 @@ typedef struct wmOperatorType {
         * canceled due to some external reason, cancel is called
         * - see defines below for return values */
        int (*invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT;
-       int (*cancel)(struct bContext *, struct wmOperator *);
+       void (*cancel)(struct bContext *, struct wmOperator *);
        int (*modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT;
 
        /* verify if the operator can be executed in the current context, note
index 6091ec4..acc26f6 100644 (file)
@@ -341,14 +341,14 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return wm_macro_end(op, retval);
 }
 
-static int wm_macro_cancel(bContext *C, wmOperator *op)
+static void wm_macro_cancel(bContext *C, wmOperator *op)
 {
        /* call cancel on the current modal operator, if any */
        if (op->opm && op->opm->type->cancel) {
                op->opm->type->cancel(C, op->opm);
        }
 
-       return wm_macro_end(op, OPERATOR_CANCELLED);
+       wm_macro_end(op, OPERATOR_CANCELLED);
 }
 
 /* Names have to be static for now */
@@ -2844,11 +2844,9 @@ int WM_border_select_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-int WM_border_select_cancel(bContext *C, wmOperator *op)
+void WM_border_select_cancel(bContext *C, wmOperator *op)
 {
        wm_gesture_end(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 /* **************** circle gesture *************** */
@@ -2961,11 +2959,9 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return OPERATOR_RUNNING_MODAL;
 }
 
-int WM_gesture_circle_cancel(bContext *C, wmOperator *op)
+void WM_gesture_circle_cancel(bContext *C, wmOperator *op)
 {
        wm_gesture_end(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 #if 0
@@ -3188,18 +3184,14 @@ int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event)
        return WM_gesture_lasso_modal(C, op, event);
 }
 
-int WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
+void WM_gesture_lasso_cancel(bContext *C, wmOperator *op)
 {
        wm_gesture_end(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
-int WM_gesture_lines_cancel(bContext *C, wmOperator *op)
+void WM_gesture_lines_cancel(bContext *C, wmOperator *op)
 {
        wm_gesture_end(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 /**
@@ -3365,11 +3357,9 @@ int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *ev
        return OPERATOR_RUNNING_MODAL;
 }
 
-int WM_gesture_straightline_cancel(bContext *C, wmOperator *op)
+void WM_gesture_straightline_cancel(bContext *C, wmOperator *op)
 {
        wm_gesture_end(C, op);
-
-       return OPERATOR_CANCELLED;
 }
 
 #if 0
@@ -3803,7 +3793,7 @@ static void radial_control_set_value(RadialControl *rc, float val)
        }
 }
 
-static int radial_control_cancel(bContext *C, wmOperator *op)
+static void radial_control_cancel(bContext *C, wmOperator *op)
 {
        RadialControl *rc = op->customdata;
        wmWindowManager *wm = CTX_wm_manager(C);
@@ -3821,8 +3811,6 @@ static int radial_control_cancel(bContext *C, wmOperator *op)
        glDeleteTextures(1, &rc->gltex);
 
        MEM_freeN(rc);
-
-       return OPERATOR_CANCELLED;
 }
 
 static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *event)