From 8227b3d463955d887a987fe546d8eefa2757a982 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 13 Jan 2011 04:53:55 +0000 Subject: remove/comment unused vars also removed unnecessary NULL checks (where the pointer was used later without checking). --- source/blender/blenkernel/intern/anim.c | 4 +--- source/blender/blenkernel/intern/collision.c | 4 ++-- source/blender/blenkernel/intern/customdata.c | 4 ++-- source/blender/blenkernel/intern/multires.c | 4 ++-- source/blender/editors/armature/editarmature.c | 2 -- .../blender/editors/armature/editarmature_retarget.c | 9 ++------- source/blender/editors/armature/poseobject.c | 19 ++++++++----------- source/blender/editors/armature/reeb.c | 10 ++++++---- source/blender/editors/interface/interface.c | 10 +++++----- .../blender/editors/interface/interface_templates.c | 5 +---- source/blender/editors/mesh/editmesh_mods.c | 5 +---- source/blender/editors/mesh/editmesh_tools.c | 4 ++-- source/blender/editors/mesh/mesh_ops.c | 2 +- source/blender/editors/mesh/meshtools.c | 12 ++++-------- source/blender/editors/object/object_add.c | 4 +--- source/blender/editors/physics/particle_edit.c | 13 +++++-------- source/blender/editors/render/render_opengl.c | 7 +++---- source/blender/editors/render/render_shading.c | 4 ++++ source/blender/editors/space_file/filesel.c | 6 ++++++ source/blender/editors/space_graph/graph_ops.c | 2 +- source/blender/editors/space_image/image_ops.c | 2 -- source/blender/editors/space_logic/logic_window.c | 2 -- source/blender/editors/space_nla/nla_channels.c | 2 -- source/blender/editors/space_view3d/drawarmature.c | 6 +++--- source/blender/editors/transform/transform_ops.c | 4 ++-- source/blender/editors/transform/transform_snap.c | 3 +-- source/blender/editors/uvedit/uvedit_ops.c | 4 +--- source/blender/gpu/intern/gpu_draw.c | 4 ++-- source/blender/imbuf/intern/tiff.c | 2 +- source/blender/makesrna/intern/rna_animation.c | 2 +- source/blender/makesrna/intern/rna_curve.c | 2 +- source/blender/makesrna/intern/rna_fcurve.c | 2 +- source/blender/makesrna/intern/rna_mesh.c | 8 ++++---- source/blender/makesrna/intern/rna_meta.c | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 6 +++--- source/blender/makesrna/intern/rna_object.c | 2 +- source/blender/makesrna/intern/rna_screen.c | 3 +-- source/blender/makesrna/intern/rna_ui_api.c | 4 ++-- source/blender/python/intern/bpy_rna_array.c | 4 ++-- source/blender/windowmanager/intern/wm_event_system.c | 2 +- 40 files changed, 85 insertions(+), 111 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 8cac3860e79..68a949ed25a 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -1172,7 +1172,6 @@ static void new_particle_duplilist(ListBase *lb, ID *UNUSED(id), Scene *scene, O float (*obmat)[4], (*oldobmat)[4]; int a, b, counter, hair = 0; int totpart, totchild, totgroup=0, pa_num; - unsigned int lay; if(psys==0) return; @@ -1193,8 +1192,7 @@ static void new_particle_duplilist(ListBase *lb, ID *UNUSED(id), Scene *scene, O totchild = psys->totchild; BLI_srandom(31415926 + psys->seed); - - lay= scene->lay; + if((psys->renderdata || part->draw_as==PART_DRAW_REND) && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { ParticleSimulationData sim= {0}; sim.scene= scene; diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c index e7dff52db62..8cdfd60b9a7 100644 --- a/source/blender/blenkernel/intern/collision.c +++ b/source/blender/blenkernel/intern/collision.c @@ -1457,13 +1457,13 @@ static void cloth_bvh_objcollisions_nearcheck ( ClothModifierData * clmd, Collis static int cloth_bvh_objcollisions_resolve ( ClothModifierData * clmd, CollisionModifierData *collmd, CollPair *collisions, CollPair *collisions_index) { Cloth *cloth = clmd->clothObject; - int i=0, j = 0, numfaces = 0, numverts = 0; + int i=0, j = 0, /*numfaces = 0,*/ numverts = 0; ClothVertex *verts = NULL; int ret = 0; int result = 0; float tnull[3] = {0,0,0}; - numfaces = clmd->clothObject->numfaces; + /*numfaces = clmd->clothObject->numfaces;*/ /*UNUSED*/ numverts = clmd->clothObject->numverts; verts = cloth->verts; diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c index 57f66a37343..94bb771aecd 100644 --- a/source/blender/blenkernel/intern/customdata.c +++ b/source/blender/blenkernel/intern/customdata.c @@ -893,13 +893,13 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data, void CustomData_merge(const struct CustomData *source, struct CustomData *dest, CustomDataMask mask, int alloctype, int totelem) { - const LayerTypeInfo *typeInfo; + /*const LayerTypeInfo *typeInfo;*/ CustomDataLayer *layer, *newlayer; int i, type, number = 0, lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0, lastflag = 0; for(i = 0; i < source->totlayer; ++i) { layer = &source->layers[i]; - typeInfo = layerType_getInfo(layer->type); + /*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/ type = layer->type; diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index ed0b1bfceca..0fb19685f25 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -707,7 +707,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int MFace *mface = me->mface; MDisps *mdisps = CustomData_get_layer(&me->fdata, CD_MDISPS); int *gridOffset; - int i, numGrids, gridSize, dGridSize, dSkip; + int i, /*numGrids,*/ gridSize, dGridSize, dSkip; if(!mdisps) { if(invert) @@ -716,7 +716,7 @@ static void multiresModifier_disp_run(DerivedMesh *dm, Mesh *me, int invert, int return; } - numGrids = dm->getNumGrids(dm); + /*numGrids = dm->getNumGrids(dm);*/ /*UNUSED*/ gridSize = dm->getGridSize(dm); gridData = dm->getGridData(dm); gridOffset = dm->getGridOffset(dm); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index f62fb83deca..2252c926c71 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1209,12 +1209,10 @@ static int separate_armature_exec (bContext *C, wmOperator *UNUSED(op)) Object *obedit= CTX_data_edit_object(C); Object *oldob, *newob; Base *oldbase, *newbase; - bArmature *arm; /* sanity checks */ if (obedit == NULL) return OPERATOR_CANCELLED; - arm= obedit->data; /* set wait cursor in case this takes a while */ WM_cursor_wait(1); diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index d4f25c10e30..cabf81ea85e 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -2730,8 +2730,6 @@ static void retargetGraphs(bContext *C, RigGraph *rigg) BIF_flagMultiArcs(reebg, ARC_FREE); /* return to first level */ - reebg = rigg->link_mesh; - inode = rigg->head; matchMultiResolutionStartingNode(rigg, reebg, inode); @@ -2887,7 +2885,6 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) Object *ob; RigGraph *rigg; RigArc *iarc; - bArmature *arm; char *side_string = scene->toolsettings->skgen_side_string; char *num_string = scene->toolsettings->skgen_num_string; int free_template = 0; @@ -2895,14 +2892,12 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) if (template_rigg) { ob = template_rigg->ob; - arm = ob->data; } else { free_template = 1; - ob = obedit; - arm = ob->data; - template_rigg = armatureSelectedToGraph(C, ob, arm); + ob = obedit; + template_rigg = armatureSelectedToGraph(C, ob, ob->data); } if (template_rigg->arcs.first == NULL) diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index cae6491378e..6c1adcb2ccb 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -667,7 +667,7 @@ void pose_copy_menu(Scene *scene) { Object *obedit= scene->obedit; // XXX context Object *ob= OBACT; - bArmature *arm= ob->data; + bArmature *arm; bPoseChannel *pchan, *pchanact; short nr=0; int i=0; @@ -680,7 +680,8 @@ void pose_copy_menu(Scene *scene) if (pchan==NULL) return; pchanact= pchan; - + arm= ob->data; + /* if proxy-protected bones selected, some things (such as locks + displays) shouldn't be changable, * but for constraints (just add local constraints) */ @@ -1241,7 +1242,6 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op) { ScrArea *sa= CTX_wm_area(C); Object *ob; - bArmature *arm; bPose *pose; short done= 0; @@ -1254,7 +1254,7 @@ static int pose_group_assign_exec (bContext *C, wmOperator *op) /* only continue if there's an object, and a pose there too */ if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; - arm= ob->data; + pose= ob->pose; /* set the active group number to the one from operator props @@ -1306,8 +1306,6 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op)) { ScrArea *sa= CTX_wm_area(C); Object *ob; - bArmature *arm; - bPose *pose; short done= 0; /* since this call may also be used from the buttons window, we need to check for where to get the object */ @@ -1319,8 +1317,6 @@ static int pose_group_unassign_exec (bContext *C, wmOperator *UNUSED(op)) /* only continue if there's an object, and a pose there too */ if (ELEM(NULL, ob, ob->pose)) return OPERATOR_CANCELLED; - pose= ob->pose; - arm= ob->data; /* find selected bones to remove from all bone groups */ CTX_DATA_BEGIN(C, bPoseChannel*, pchan, selected_pose_bones) @@ -1561,16 +1557,17 @@ void POSE_OT_autoside_names (wmOperatorType *ot) void pose_activate_flipped_bone(Scene *scene) { Object *ob= OBACT; - bArmature *arm= ob->data; - + if(ob==NULL) return; if(ob->mode & OB_MODE_WEIGHT_PAINT) { ob= modifiers_isDeformedByArmature(ob); } + if(ob && (ob->mode & OB_MODE_POSE)) { bPoseChannel *pchanf; - + bArmature *arm= ob->data; + if(arm->act_bone) { char name[32]; flip_side_name(name, arm->act_bone->name, TRUE); diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 780dc8827c4..29ba72ce604 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2558,10 +2558,10 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions) EditVert *eve; EditFace *efa; int index; - int totvert; - int totfaces; + /*int totvert;*/ #ifdef DEBUG_REEB + int totfaces; int countfaces = 0; #endif @@ -2569,8 +2569,10 @@ ReebGraph * generateReebGraph(EditMesh *em, int subdivisions) rg->resolution = subdivisions; - totvert = BLI_countlist(&em->verts); + /*totvert = BLI_countlist(&em->verts);*/ /*UNUSED*/ +#ifdef DEBUG_REEB totfaces = BLI_countlist(&em->faces); +#endif renormalizeWeight(em, 1.0f); @@ -2641,7 +2643,7 @@ void renormalizeWeight(EditMesh *em, float newmax) eve = em->verts.first; minimum = weightData(eve); maximum = minimum; - for(eve = em->verts.first; eve; eve = eve->next) + for(; eve; eve = eve->next) { maximum = MAX2(maximum, weightData(eve)); minimum = MIN2(minimum, weightData(eve)); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index d74a907d785..2620db30b39 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1801,7 +1801,7 @@ static double soft_range_round_down(double value, double max) void ui_set_but_soft_range(uiBut *but, double value) { PropertyType type; - double softmin, softmax, step, precision; + double softmin, softmax /*, step, precision*/; if(but->rnaprop) { type= RNA_property_type(but->rnaprop); @@ -1814,8 +1814,8 @@ void ui_set_but_soft_range(uiBut *but, double value) RNA_property_int_ui_range(&but->rnapoin, but->rnaprop, &imin, &imax, &istep); softmin= (imin == INT_MIN)? -1e4: imin; softmax= (imin == INT_MAX)? 1e4: imax; - step= istep; - precision= 1; + /*step= istep;*/ /*UNUSED*/ + /*precision= 1;*/ /*UNUSED*/ } else if(type == PROP_FLOAT) { float fmin, fmax, fstep, fprecision; @@ -1823,8 +1823,8 @@ void ui_set_but_soft_range(uiBut *but, double value) RNA_property_float_ui_range(&but->rnapoin, but->rnaprop, &fmin, &fmax, &fstep, &fprecision); softmin= (fmin == -FLT_MAX)? -1e4: fmin; softmax= (fmax == FLT_MAX)? 1e4: fmax; - step= fstep; - precision= fprecision; + /*step= fstep;*/ /*UNUSED*/ + /*precision= fprecision;*/ /*UNUSED*/ } else return; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 1f25f968213..e96740d6353 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1893,15 +1893,12 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, const char *propname, int groups, cols, layers; int group, col, layer, row; int cols_per_group = 5; - const char *desc; - + prop= RNA_struct_find_property(ptr, propname); if (!prop) { printf("uiTemplateLayer: layers property not found: %s.%s\n", RNA_struct_identifier(ptr->type), propname); return; } - - desc= RNA_property_description(prop); /* the number of layers determines the way we group them * - we want 2 rows only (for now) diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 54a3adc5da3..cdccc1e0110 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -4474,8 +4474,6 @@ static int mesh_noise_exec(bContext *C, wmOperator *op) void MESH_OT_noise(wmOperatorType *ot) { - PropertyRNA *prop; - /* identifiers */ ot->name= "Noise"; ot->description= "Use vertex coordinate as texture coordinate"; @@ -4488,8 +4486,7 @@ void MESH_OT_noise(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - prop= RNA_def_float(ot->srna, "factor", 0.1f, -FLT_MAX, FLT_MAX, "Factor", "", 0.0f, 1.0f); - + RNA_def_float(ot->srna, "factor", 0.1f, -FLT_MAX, FLT_MAX, "Factor", "", 0.0f, 1.0f); } void flipface(EditMesh *em, EditFace *efa) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 0fde8d75990..3e359101f3a 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -5685,7 +5685,7 @@ static int collapseEdges(EditMesh *em) CollectedEdge *curredge; Collection *edgecollection; - int totedges, groupcount, mergecount,vcount; + int totedges, mergecount,vcount /*, groupcount*/; float avgcount[3]; allcollections.first = 0; @@ -5694,7 +5694,7 @@ static int collapseEdges(EditMesh *em) mergecount = 0; build_edgecollection(em, &allcollections); - groupcount = BLI_countlist(&allcollections); + /*groupcount = BLI_countlist(&allcollections);*/ /*UNUSED*/ for(edgecollection = allcollections.first; edgecollection; edgecollection = edgecollection->next){ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 682010be4db..b2cb3e06de3 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -231,7 +231,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) kmi= WM_keymap_add_item(keymap, "MESH_OT_loop_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT, 0); RNA_boolean_set(kmi->ptr, "extend", 1); - kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); + WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_ALT|KM_CTRL, 0); kmi= WM_keymap_add_item(keymap, "MESH_OT_edgering_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_ALT|KM_CTRL, 0); RNA_boolean_set(kmi->ptr, "extend", 1); diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 3e7b7604448..c4fe5f8fbc1 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -92,9 +92,9 @@ int join_mesh_exec(bContext *C, wmOperator *op) Object *ob= CTX_data_active_object(C); Material **matar, *ma; Mesh *me; - MVert *mvert, *mv, *mvertmain; - MEdge *medge = NULL, *medgemain; - MFace *mface = NULL, *mfacemain; + MVert *mvert, *mv; + MEdge *medge = NULL; + MFace *mface = NULL; Key *key, *nkey=NULL; KeyBlock *kb, *okb, *kbn; float imat[4][4], cmat[4][4], *fp1, *fp2, curpos; @@ -280,11 +280,7 @@ int join_mesh_exec(bContext *C, wmOperator *op) mvert= CustomData_add_layer(&vdata, CD_MVERT, CD_CALLOC, NULL, totvert); medge= CustomData_add_layer(&edata, CD_MEDGE, CD_CALLOC, NULL, totedge); mface= CustomData_add_layer(&fdata, CD_MFACE, CD_CALLOC, NULL, totface); - - mvertmain= mvert; - medgemain= medge; - mfacemain= mface; - + vertofs= 0; edgeofs= 0; faceofs= 0; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index e4fc8c16470..cd2b0f79f1a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -680,9 +680,7 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; ob= ED_object_add_type(C, OB_LAMP, loc, rot, FALSE, layer); - if(ob && ob->data) - ((Lamp*)ob->data)->type= type; - + ((Lamp*)ob->data)->type= type; rename_id((ID *)ob, get_lamp_defname(type)); rename_id((ID *)ob->data, get_lamp_defname(type)); diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 9ce8488c461..0017fd0130a 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -1036,10 +1036,8 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) { DerivedMesh *dm=psys_get_modifier(ob,psys)->dm; PTCacheEdit *edit= psys->edit; - MFace *mface; - MVert *mvert; float *vec, *nor; - int i, totface, totvert; + int i, totface /*, totvert*/; if(!dm) return; @@ -1050,7 +1048,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) BLI_kdtree_free(edit->emitter_field); totface=dm->getNumFaces(dm); - totvert=dm->getNumVerts(dm); + /*totvert=dm->getNumVerts(dm);*/ /*UNSUED*/ edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos"); @@ -1059,9 +1057,9 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) vec=edit->emitter_cosnos; nor=vec+3; - mvert=dm->getVertDataArray(dm,CD_MVERT); for(i=0; igetFaceData(dm,i,CD_MFACE); + MFace *mface=dm->getFaceData(dm,i,CD_MFACE); + MVert *mvert; mvert=dm->getVertData(dm,mface->v1,CD_MVERT); VECCOPY(vec,mvert->co); @@ -2062,12 +2060,11 @@ static int remove_tagged_particles(Object *ob, ParticleSystem *psys, int mirror) POINT_P; PTCacheEditPoint *npoint=0, *new_points=0; ParticleSystemModifierData *psmd; - int i, totpart, new_totpart= psys->totpart, removed= 0; + int i, new_totpart= psys->totpart, removed= 0; if(mirror) { /* mirror tags */ psmd= psys_get_modifier(ob, psys); - totpart= psys->totpart; LOOP_TAGGED_POINTS { PE_mirror_particle(ob, psmd->dm, psys, psys->particles + p, NULL); diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 8a4a0433eb8..c2b2a0ad457 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -130,20 +130,19 @@ static void screen_opengl_render_apply(OGLRender *oglrender) */ if(view_context) { - int is_ortho; GPU_offscreen_bind(oglrender->ofs); /* bind */ /* render 3d view */ if(rv3d->persp==RV3D_CAMOB && v3d->camera) { + /*int is_ortho= scene->r.mode & R_ORTHO;*/ RE_GetCameraWindow(oglrender->re, v3d->camera, scene->r.cfra, winmat); - is_ortho= scene->r.mode & R_ORTHO; } else { rctf viewplane; float clipsta, clipend; - - is_ortho= get_view3d_viewplane(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL); + + int is_ortho= get_view3d_viewplane(v3d, rv3d, sizex, sizey, &viewplane, &clipsta, &clipend, NULL); if(is_ortho) orthographic_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend); else perspective_m4(winmat, viewplane.xmin, viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend); } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 44fce4819f3..560819b5e0f 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -851,6 +851,10 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int ibuf = IMB_allocImBuf(dx, dx, 24, IB_rectfloat); IMB_rectcpy(ibuf, env->cube[1], 0, 0, 0, 0, dx, dx); } + else { + BKE_report(op->reports, RPT_ERROR, "Invalid environment map type"); + return OPERATOR_CANCELLED; + } if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) ibuf->profile = IB_PROFILE_LINEAR_RGB; diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 9e29967a792..939a8450cb6 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -349,12 +349,18 @@ float file_string_width(const char* str) float file_font_pointsize() { +#if 0 float s; char tmp[2] = "X"; uiStyle *style= U.uistyles.first; uiStyleFontSet(&style->widget); s = BLF_height(style->widget.uifont_id, tmp); return style->widget.points; +#else + uiStyle *style= U.uistyles.first; + uiStyleFontSet(&style->widget); + return style->widget.points; +#endif } static void column_widths(struct FileList* files, struct FileLayout* layout) diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 4f529df24dc..95c499c263b 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -299,7 +299,7 @@ static void graphedit_keymap_keyframes (wmKeyConfig *keyconf, wmKeyMap *keymap) RNA_boolean_set(WM_keymap_add_item(keymap, "GRAPH_OT_select_all_toggle", IKEY, KM_PRESS, KM_CTRL, 0)->ptr, "invert", 1); /* borderselect */ - kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, 0, 0); kmi = WM_keymap_add_item(keymap, "GRAPH_OT_select_border", BKEY, KM_PRESS, KM_ALT, 0); RNA_boolean_set(kmi->ptr, "axis_range", 1); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index d1230d82f71..3f4c10c8155 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -438,14 +438,12 @@ static int view_all_exec(bContext *C, wmOperator *UNUSED(op)) { SpaceImage *sima; ARegion *ar; - Object *obedit; float aspx, aspy, zoomx, zoomy, w, h; int width, height; /* retrieve state */ sima= CTX_wm_space_image(C); ar= CTX_wm_region(C); - obedit= CTX_data_edit_object(C); ED_space_image_size(sima, &width, &height); ED_space_image_aspect(sima, &aspx, &aspy); diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index b0634ff25c7..c8766f5c4c1 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -4771,8 +4771,6 @@ void logic_buttons(bContext *C, ARegion *ar) uiDefButBitS(block, TOG, BUTS_CONT_LINK, B_REDR, "Link", xco+110+2*(width-100)/3, yco+35, (width-100)/3, UI_UNIT_Y, &slogic->scaflag, 0, 0, 0, 0, "Show linked Objects to Sensor/Actuator"); uiBlockEndAlign(block); - ob= CTX_data_active_object(C); - for(a=0; av2d; diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index 901aaba2cb1..f16078ba454 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -760,7 +760,7 @@ static void draw_sphere_bone_dist(float smat[][4], float imat[][4], bPoseChannel /* smat, imat = mat & imat to draw screenaligned */ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, int boneflag, int constflag, unsigned int id, bPoseChannel *pchan, EditBone *ebone) { - float head, tail, length; + float head, tail /*, length*/; float *headvec, *tailvec, dirvec[3]; /* figure out the sizes of spheres */ @@ -768,7 +768,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, /* this routine doesn't call get_matrix_editbone() that calculates it */ ebone->length = len_v3v3(ebone->head, ebone->tail); - length= ebone->length; + /*length= ebone->length;*/ /*UNUSED*/ tail= ebone->rad_tail; if (ebone->parent && (boneflag & BONE_CONNECTED)) head= ebone->parent->rad_tail; @@ -778,7 +778,7 @@ static void draw_sphere_bone_wire(float smat[][4], float imat[][4], int armflag, tailvec= ebone->tail; } else { - length= pchan->bone->length; + /*length= pchan->bone->length;*/ /*UNUSED*/ tail= pchan->bone->rad_tail; if ((pchan->parent) && (boneflag & BONE_CONNECTED)) head= pchan->parent->bone->rad_tail; diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 3047df06523..82cec1eec42 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -408,7 +408,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) if (flags & P_CONSTRAINT) { - prop= RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", ""); + RNA_def_boolean_vector(ot->srna, "constraint_axis", 3, NULL, "Constraint Axis", ""); prop= RNA_def_property(ot->srna, "constraint_orientation", PROP_ENUM, PROP_NONE); RNA_def_property_ui_text(prop, "Orientation", "Transformation orientation"); RNA_def_enum_funcs(prop, rna_TransformOrientation_itemf); @@ -455,7 +455,7 @@ void Transform_Properties(struct wmOperatorType *ot, int flags) } // Add confirm method all the time. At the end because it's not really that important and should be hidden only in log, not in keymap edit - prop = RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button"); + /*prop =*/ RNA_def_boolean(ot->srna, "release_confirm", 0, "Confirm on Release", "Always confirm operation when releasing button"); //RNA_def_property_flag(prop, PROP_HIDDEN); } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 3eae81d52f1..089f192cdc8 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1591,8 +1591,7 @@ int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, float mv Object *ob = base->object; retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, loc, no, dist, &depth); } - - base= FIRSTBASE; + for ( base = FIRSTBASE; base != NULL; base = base->next ) { if ( BASE_VISIBLE(v3d, base) && (base->flag & (BA_HAS_RECALC_OB|BA_HAS_RECALC_DATA)) == 0 && ((mode == SNAP_NOT_SELECTED && (base->flag & (SELECT|BA_WAS_SEL)) == 0) || (ELEM(mode, SNAP_ALL, SNAP_NOT_OBEDIT) && base != BASACT)) ) { Object *ob = base->object; diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 033cfdc2912..8a2a52df2c8 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1086,7 +1086,6 @@ typedef struct UVVertAverage { static int stitch_exec(bContext *C, wmOperator *op) { - SpaceImage *sima; Scene *scene; Object *obedit; EditMesh *em; @@ -1094,8 +1093,7 @@ static int stitch_exec(bContext *C, wmOperator *op) EditVert *eve; Image *ima; MTFace *tf; - - sima= CTX_wm_space_image(C); + scene= CTX_data_scene(C); obedit= CTX_data_edit_object(C); em= BKE_mesh_get_editmesh((Mesh*)obedit->data); diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c index dfaf251f4c5..dedcab91e06 100644 --- a/source/blender/gpu/intern/gpu_draw.c +++ b/source/blender/gpu/intern/gpu_draw.c @@ -776,9 +776,9 @@ void GPU_free_smoke(SmokeModifierData *smd) void GPU_create_smoke(SmokeModifierData *smd, int highres) { - if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex && !highres) + if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && !highres) smd->domain->tex = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smoke_get_density(smd->domain->fluid)); - else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && smd->domain && !smd->domain->tex && highres) + else if(smd->type & MOD_SMOKE_TYPE_DOMAIN && !smd->domain->tex && highres) smd->domain->tex = GPU_texture_create_3D(smd->domain->res_wt[0], smd->domain->res_wt[1], smd->domain->res_wt[2], smoke_turbulence_get_density(smd->domain->wt)); smd->domain->tex_shadow = GPU_texture_create_3D(smd->domain->res[0], smd->domain->res[1], smd->domain->res[2], smd->domain->shadow); diff --git a/source/blender/imbuf/intern/tiff.c b/source/blender/imbuf/intern/tiff.c index 4e5dc5923fe..5c3451fd6f4 100644 --- a/source/blender/imbuf/intern/tiff.c +++ b/source/blender/imbuf/intern/tiff.c @@ -760,7 +760,7 @@ int imb_savetiff(ImBuf *ibuf, const char *name, int flags) if (samplesperpixel == 4) { to16[to_i+3] = FTOUSHORT(fromf[from_i+3]); - to_i++; from_i++; + /*to_i++; from_i++;*/ /*unused, set on each loop */ } } else { diff --git a/source/blender/makesrna/intern/rna_animation.c b/source/blender/makesrna/intern/rna_animation.c index f9fa10f4a32..e366b0c61b9 100644 --- a/source/blender/makesrna/intern/rna_animation.c +++ b/source/blender/makesrna/intern/rna_animation.c @@ -676,7 +676,7 @@ static void rna_api_animdata_nla_tracks(BlenderRNA *brna, PropertyRNA *cprop) func = RNA_def_function(srna, "new", "rna_NlaTrack_new"); RNA_def_function_flag(func, FUNC_USE_CONTEXT); RNA_def_function_ui_description(func, "Add a new NLA Tracks"); - parm = RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after."); + RNA_def_pointer(func, "prev", "NlaTrack", "", "NLA Track to add the new one after."); /* return type */ parm = RNA_def_pointer(func, "track", "NlaTrack", "", "New NLA Track."); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c index a257356f6c9..8ffd98b8d88 100644 --- a/source/blender/makesrna/intern/rna_curve.c +++ b/source/blender/makesrna/intern/rna_curve.c @@ -1145,7 +1145,7 @@ static void rna_def_curve_spline_bezpoints(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "rna_Curve_spline_bezpoints_add"); RNA_def_function_ui_description(func, "Add a number of points to this spline."); RNA_def_function_flag(func, FUNC_USE_SELF_ID|FUNC_USE_REPORTS); - parm= RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); + RNA_def_int(func, "number", 1, INT_MIN, INT_MAX, "Number", "Number of points to add to the spline", 0, INT_MAX); /* func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); diff --git a/source/blender/makesrna/intern/rna_fcurve.c b/source/blender/makesrna/intern/rna_fcurve.c index 491defcd016..12ecf15816a 100644 --- a/source/blender/makesrna/intern/rna_fcurve.c +++ b/source/blender/makesrna/intern/rna_fcurve.c @@ -1346,7 +1346,7 @@ static void rna_def_fcurve_keyframe_points(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_pointer(func, "keyframe", "Keyframe", "", "Keyframe to remove."); RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); /* optional */ - parm= RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time"); + RNA_def_boolean(func, "fast", 0, "Fast", "Fast keyframe removal to avoid recalculating the curve each time"); } static void rna_def_fcurve(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_mesh.c b/source/blender/makesrna/intern/rna_mesh.c index 1e6db94f7a3..08065b90530 100644 --- a/source/blender/makesrna/intern/rna_mesh.c +++ b/source/blender/makesrna/intern/rna_mesh.c @@ -1650,7 +1650,7 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop) // PropertyRNA *prop; FunctionRNA *func; - PropertyRNA *parm; +// PropertyRNA *parm; RNA_def_property_srna(cprop, "MeshVertices"); srna= RNA_def_struct(brna, "MeshVertices", NULL); @@ -1659,7 +1659,7 @@ static void rna_def_mesh_vertices(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_vertices_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); + RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); } /* mesh.edges */ @@ -1688,7 +1688,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop) PropertyRNA *prop; FunctionRNA *func; - PropertyRNA *parm; + /*PropertyRNA *parm;*/ RNA_def_property_srna(cprop, "MeshFaces"); srna= RNA_def_struct(brna, "MeshFaces", NULL); @@ -1707,7 +1707,7 @@ static void rna_def_mesh_faces(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "add", "ED_mesh_faces_add"); RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); + RNA_def_int(func, "count", 0, 0, INT_MAX, "Count", "Number of vertices to add.", 0, INT_MAX); } /* mesh.vertex_colors */ diff --git a/source/blender/makesrna/intern/rna_meta.c b/source/blender/makesrna/intern/rna_meta.c index f1d41d86695..142c8017289 100644 --- a/source/blender/makesrna/intern/rna_meta.c +++ b/source/blender/makesrna/intern/rna_meta.c @@ -232,7 +232,7 @@ static void rna_def_metaball_elements(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "new", "rna_MetaBall_elements_new"); RNA_def_function_ui_description(func, "Add a new spline to the curve."); - parm= RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta element."); + RNA_def_enum(func, "type", metaelem_type_items, MB_BALL, "", "type for the new meta element."); parm= RNA_def_pointer(func, "element", "MetaElement", "", "The newly created metaelement."); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index e40506fcd83..7184fd05dcf 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2386,7 +2386,7 @@ static void rna_def_composite_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_enum(func, "type", compositor_node_type_items, 0, "Type", "Type of node to add"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); + RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); /* return value */ parm= RNA_def_pointer(func, "node", "Node", "", "New node."); RNA_def_function_return(func, parm); @@ -2414,7 +2414,7 @@ static void rna_def_shader_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_enum(func, "type", shader_node_type_items, 0, "Type", "Type of node to add"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); + RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); /* return value */ parm= RNA_def_pointer(func, "node", "Node", "", "New node."); RNA_def_function_return(func, parm); @@ -2442,7 +2442,7 @@ static void rna_def_texture_nodetree_api(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_enum(func, "type", texture_node_type_items, 0, "Type", "Type of node to add"); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); + RNA_def_pointer(func, "group", "NodeTree", "", "The group tree"); /* return value */ parm= RNA_def_pointer(func, "node", "Node", "", "New node."); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 6cb5a074c03..35e19c6b6b7 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1658,7 +1658,7 @@ static void rna_def_object_vertex_groups(BlenderRNA *brna, PropertyRNA *cprop) /* vertex groups */ // add_vertex_group func= RNA_def_function(srna, "new", "rna_Object_vgroup_new"); RNA_def_function_ui_description(func, "Add vertex group to object."); - parm= RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */ + RNA_def_string(func, "name", "Group", 0, "", "Vertex group name."); /* optional */ parm= RNA_def_pointer(func, "group", "VertexGroup", "", "New vertex group."); RNA_def_function_return(func, parm); diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c index a9e43d35f32..f3f8db6fb39 100644 --- a/source/blender/makesrna/intern/rna_screen.c +++ b/source/blender/makesrna/intern/rna_screen.c @@ -107,7 +107,6 @@ static void rna_def_area(BlenderRNA *brna) StructRNA *srna; PropertyRNA *prop; FunctionRNA *func; - PropertyRNA *parm; srna= RNA_def_struct(brna, "Area", NULL); RNA_def_struct_ui_text(srna, "Area", "Area in a subdivided screen, containing an editor"); @@ -144,7 +143,7 @@ static void rna_def_area(BlenderRNA *brna) func= RNA_def_function(srna, "header_text_set", "ED_area_headerprint"); RNA_def_function_ui_description(func, "Set the header text"); - parm= RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text."); + RNA_def_string(func, "text", NULL, 0, "Text", "New string for the header, no argument clears the text."); } static void rna_def_region(BlenderRNA *brna) diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index e6d6759a449..022f818d7d7 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -141,7 +141,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); func= RNA_def_function(srna, "column_flow", "uiLayoutColumnFlow"); - parm= RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX); + RNA_def_int(func, "columns", 0, 0, INT_MAX, "", "Number of columns, 0 is automatic.", 0, INT_MAX); parm= RNA_def_pointer(func, "layout", "UILayout", "", "Sub-layout to put items in."); RNA_def_function_return(func, parm); RNA_def_boolean(func, "align", 0, "", "Align buttons to each other."); @@ -327,7 +327,7 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_ui_description(func, "Item. A preview window for materials, textures, lamps, etc."); parm= RNA_def_pointer(func, "id", "ID", "", "ID datablock."); RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?"); + RNA_def_boolean(func, "show_buttons", 1, "", "Show preview buttons?"); RNA_def_pointer(func, "parent", "ID", "", "ID datablock."); RNA_def_pointer(func, "slot", "TextureSlot", "", "Texture slot."); diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index a0dbc2d5ff2..ab13f9928c2 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -239,11 +239,11 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) { - int totdim, dim_size[MAX_ARRAY_DIMENSION]; + /*int totdim, dim_size[MAX_ARRAY_DIMENSION];*/ int totitem; char *data= NULL; - totdim= RNA_property_array_dimension(ptr, prop, dim_size); + /*totdim= RNA_property_array_dimension(ptr, prop, dim_size);*/ /*UNUSED*/ if (!validate_array(py, ptr, prop, 0, check_item_type, item_type_str, &totitem, error_prefix)) { return 0; diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 0cf3522eaf3..7d5cdb8a10c 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -715,7 +715,7 @@ int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerR ARegion *ar= CTX_wm_region(C); ScrArea *sa= CTX_wm_area(C); - if(ar && ar->regiontype == RGN_TYPE_WINDOW && BLI_in_rcti(&ar->winrct, event->x, event->y)) { + if(ar && ar->regiontype == RGN_TYPE_WINDOW && event && BLI_in_rcti(&ar->winrct, event->x, event->y)) { winrect= &ar->winrct; } else if(sa) { -- cgit v1.2.3