From 263830f0004481cd4921f03f4242d7c80794b08d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Dec 2010 17:05:21 +0000 Subject: Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,. Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into. --- .../editors/animation/anim_channels_defines.c | 2 +- source/blender/editors/animation/anim_ipo_utils.c | 3 +- source/blender/editors/animation/keyframing.c | 2 +- source/blender/editors/armature/BIF_retarget.h | 2 +- .../editors/armature/editarmature_retarget.c | 4 +- .../blender/editors/armature/editarmature_sketch.c | 2 +- source/blender/editors/armature/meshlaplacian.c | 2 +- source/blender/editors/armature/poseSlide.c | 2 +- source/blender/editors/armature/reeb.c | 2 +- source/blender/editors/curve/editcurve.c | 4 +- source/blender/editors/curve/editfont.c | 2 +- source/blender/editors/include/ED_anim_api.h | 2 +- source/blender/editors/include/ED_armature.h | 2 +- source/blender/editors/include/ED_screen.h | 4 +- source/blender/editors/include/ED_transform.h | 2 +- source/blender/editors/include/ED_util.h | 2 +- source/blender/editors/include/UI_interface.h | 126 ++++++++++----------- source/blender/editors/interface/interface.c | 108 +++++++++--------- .../blender/editors/interface/interface_intern.h | 4 +- .../blender/editors/interface/interface_layout.c | 16 +-- .../blender/editors/interface/interface_regions.c | 23 ++-- source/blender/editors/interface/interface_style.c | 4 +- .../editors/interface/interface_templates.c | 3 +- source/blender/editors/interface/interface_utils.c | 2 +- source/blender/editors/mesh/editmesh_add.c | 2 +- source/blender/editors/mesh/editmesh_tools.c | 2 +- source/blender/editors/mesh/meshtools.c | 6 +- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_constraint.c | 2 +- source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/physics/physics_fluid.c | 6 +- source/blender/editors/render/render_internal.c | 2 +- source/blender/editors/screen/area.c | 4 +- source/blender/editors/screen/screen_edit.c | 2 +- source/blender/editors/sculpt_paint/sculpt.c | 2 +- .../blender/editors/sculpt_paint/sculpt_intern.h | 2 +- source/blender/editors/sculpt_paint/sculpt_undo.c | 2 +- source/blender/editors/sound/sound_ops.c | 2 +- source/blender/editors/space_file/file_panels.c | 8 +- source/blender/editors/space_file/filelist.c | 4 +- source/blender/editors/space_file/fsmenu.c | 2 +- source/blender/editors/space_file/fsmenu.h | 2 +- source/blender/editors/space_image/image_ops.c | 2 +- source/blender/editors/space_info/info_report.c | 2 +- source/blender/editors/space_logic/logic_window.c | 30 ++--- source/blender/editors/space_node/drawnode.c | 4 +- source/blender/editors/space_outliner/outliner.c | 14 +-- .../editors/space_outliner/outliner_intern.h | 2 +- .../editors/space_sequencer/sequencer_add.c | 2 +- .../editors/space_sequencer/sequencer_edit.c | 6 +- .../editors/space_sequencer/sequencer_intern.h | 2 +- .../blender/editors/space_view3d/view3d_buttons.c | 5 +- source/blender/editors/space_view3d/view3d_draw.c | 6 +- .../blender/editors/space_view3d/view3d_header.c | 4 +- source/blender/editors/transform/transform.c | 2 +- .../editors/transform/transform_orientations.c | 2 +- source/blender/editors/util/ed_util.c | 2 +- 57 files changed, 236 insertions(+), 228 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 4d28bed0ffb..fa488e8ba98 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3001,7 +3001,7 @@ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChan short negflag, ptrsize, enabled, butType; int flag, icon; void *ptr; - char *tooltip; + const char *tooltip; uiBut *but = NULL; /* get the flag and the pointer to that flag */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 13cbfeec2bb..56161f4bfa0 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -74,7 +74,8 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) /* try to resolve the path */ if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { - char *structname=NULL, *propname=NULL, *arrayname=NULL, arrayindbuf[16]; + char *structname=NULL, *propname=NULL, arrayindbuf[16]; + const char *arrayname=NULL; short free_structname = 0; /* For now, name will consist of 3 parts: struct-name, property name, array index diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 5c1c3eec568..5d5f660213b 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -724,7 +724,7 @@ short insert_keyframe_direct (ReportList *reports, PointerRNA ptr, PropertyRNA * /* try to get property we should be affecting */ if ((RNA_path_resolve(&ptr, fcu->rna_path, &tmp_ptr, &prop) == 0) || (prop == NULL)) { /* property not found... */ - char *idname= (ptr.id.data) ? ((ID *)ptr.id.data)->name : ""; + const char *idname= (ptr.id.data) ? ((ID *)ptr.id.data)->name : ""; BKE_reportf(reports, RPT_ERROR, "Could not insert keyframe, as RNA Path is invalid for the given ID (ID = %s, Path = %s)", diff --git a/source/blender/editors/armature/BIF_retarget.h b/source/blender/editors/armature/BIF_retarget.h index 7c590a48b35..acdf07b6466 100644 --- a/source/blender/editors/armature/BIF_retarget.h +++ b/source/blender/editors/armature/BIF_retarget.h @@ -154,7 +154,7 @@ typedef struct RigControl { void BIF_retargetArc(struct bContext *C, ReebArc *earc, RigGraph *template_rigg); RigGraph *RIG_graphFromArmature(const struct bContext *C, struct Object *ob, struct bArmature *arm); int RIG_nbJoints(RigGraph *rg); -char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index); +const char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index); void RIG_freeRigGraph(BGraph *rg); #endif /* BIF_RETARGET_H */ diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index d043c2e472d..3e8c5c3ebb2 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -1413,7 +1413,7 @@ static void RIG_findHead(RigGraph *rg) /*******************************************************************************************************/ -void RIG_printNode(RigNode *node, char name[]) +void RIG_printNode(RigNode *node, const char name[]) { printf("%s %p %i <%0.3f, %0.3f, %0.3f>\n", name, (void *)node, node->degree, node->p[0], node->p[1], node->p[2]); @@ -2746,7 +2746,7 @@ static void retargetGraphs(bContext *C, RigGraph *rigg) ED_armature_from_edit(rigg->ob); } -char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index) +const char *RIG_nameBone(RigGraph *rg, int arc_index, int bone_index) { RigArc *arc = BLI_findlink(&rg->arcs, arc_index); RigEdge *iedge; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 93bddb3834b..4874d31780a 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -287,7 +287,7 @@ int BIF_nbJointsTemplate(const bContext *C) } } -char * BIF_nameBoneTemplate(const bContext *C) +const char * BIF_nameBoneTemplate(const bContext *C) { ToolSettings *ts = CTX_data_tool_settings(C); SK_Sketch *stk = contextSketch(C, 1); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index e93775f593b..3d8e87d9e79 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -65,7 +65,7 @@ static void waitcursor(int UNUSED(val)) {} static void progress_bar(int UNUSED(dummy_val), const char *UNUSED(dummy)) {} static void start_progress_bar(void) {} static void end_progress_bar(void) {} -static void error(char *str) { printf("error: %s\n", str); } +static void error(const char *str) { printf("error: %s\n", str); } /* ************* XXX *************** */ diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index 7b2ec9891f4..c51621080c5 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -187,7 +187,7 @@ static void pose_slide_refresh (bContext *C, tPoseSlideOp *pso) } /* helper for apply() - perform sliding for some 3-element vector */ -static void pose_slide_apply_vec3 (tPoseSlideOp *pso, tPChanFCurveLink *pfl, float vec[3], char *propName) +static void pose_slide_apply_vec3 (tPoseSlideOp *pso, tPChanFCurveLink *pfl, float vec[3], const char *propName) { LinkData *ld=NULL; char *path=NULL; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index d7fe001c8b4..3ac78f2c727 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -2018,7 +2018,7 @@ void spreadWeight(EditMesh *em) /******************************************** EXPORT ***************************************************/ -void exportNode(FILE *f, char *text, ReebNode *node) +void exportNode(FILE *f, const char *text, ReebNode *node) { fprintf(f, "%s i:%i w:%f d:%i %f %f %f\n", text, node->index, node->weight, node->degree, node->p[0], node->p[1], node->p[2]); } diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index cc90ab3c136..04f0397e7f2 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -5696,7 +5696,7 @@ int join_curve_exec(bContext *C, wmOperator *UNUSED(op)) /************ add primitive, used by object/ module ****************/ -static char *get_curve_defname(int type) +static const char *get_curve_defname(int type) { int stype= type & CU_PRIMITIVE; @@ -5720,7 +5720,7 @@ static char *get_curve_defname(int type) } } -static char *get_surf_defname(int type) +static const char *get_surf_defname(int type) { int stype= type & CU_PRIMITIVE; diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 76b616fbdec..96bd4624fe4 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -416,7 +416,7 @@ void FONT_OT_file_paste(wmOperatorType *ot) static int paste_buffer_exec(bContext *C, wmOperator *UNUSED(op)) { - char *filename; + const char *filename; #ifdef WIN32 filename= "C:\\windows\\temp\\cutbuf.txt"; diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 82f84a8d62f..d78c2cc1bdd 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -345,7 +345,7 @@ typedef enum eAnimChannel_Settings { typedef struct bAnimChannelType { /* type data */ /* name of the channel type, for debugging */ - char *channel_type_name; + const char *channel_type_name; /* drawing */ /* get RGB color that is used to draw the majority of the backdrop */ diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index 0db8ffd733e..be63b1bf1ce 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -166,7 +166,7 @@ int BIF_currentTemplate(const struct bContext *C); void BIF_freeTemplates(struct bContext *C); void BIF_setTemplate(struct bContext *C, int index); int BIF_nbJointsTemplate(const struct bContext *C); -char * BIF_nameBoneTemplate(const struct bContext *C); +const char * BIF_nameBoneTemplate(const struct bContext *C); void BDR_drawSketch(const struct bContext *vc); int BDR_drawSketchNames(struct ViewContext *vc); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 559156fe89d..a27a792eeee 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -57,7 +57,7 @@ void ED_region_tag_redraw(struct ARegion *ar); void ED_region_tag_redraw_partial(struct ARegion *ar, struct rcti *rct); void ED_region_tag_redraw_overlay(struct ARegion *ar); void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *ar); -void ED_region_panels(const struct bContext *C, struct ARegion *ar, int vertical, char *context, int contextnr); +void ED_region_panels(const struct bContext *C, struct ARegion *ar, int vertical, const char *context, int contextnr); void ED_region_header_init(struct ARegion *ar); void ED_region_header(const struct bContext *C, struct ARegion *ar); void ED_region_toggle_hidden(struct bContext *C, struct ARegion *ar); @@ -92,7 +92,7 @@ void ED_screen_draw(struct wmWindow *win); void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win); void ED_screen_do_listen(struct wmWindow *win, struct wmNotifier *note); bScreen *ED_screen_duplicate(struct wmWindow *win, struct bScreen *sc); -bScreen *ED_screen_add(struct wmWindow *win, struct Scene *scene, char *name); +bScreen *ED_screen_add(struct wmWindow *win, struct Scene *scene, const char *name); void ED_screen_set(struct bContext *C, struct bScreen *sc); void ED_screen_delete(struct bContext *C, struct bScreen *sc); void ED_screen_set_scene(struct bContext *C, struct Scene *scene); diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index d8954be08c9..c9139a503f1 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -126,7 +126,7 @@ void BIF_selectTransformOrientationValue(struct bContext *C, int orientation); void ED_getTransformOrientationMatrix(const struct bContext *C, float orientation_mat[][3], int activeOnly); struct EnumPropertyItem *BIF_enumTransformOrientation(struct bContext *C); -char * BIF_menustringTransformOrientation(const struct bContext *C, char *title); /* the returned value was allocated and needs to be freed after use */ +const char * BIF_menustringTransformOrientation(const struct bContext *C, const char *title); /* the returned value was allocated and needs to be freed after use */ int BIF_countTransformOrientation(const struct bContext *C); void BIF_TransformSetUndo(char *str); diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h index 618353c100b..8d654e4eaa5 100644 --- a/source/blender/editors/include/ED_util.h +++ b/source/blender/editors/include/ED_util.h @@ -70,7 +70,7 @@ void undo_editmode_step (struct bContext *C, int step); /* ************** XXX OLD CRUFT WARNING ************* */ void apply_keyb_grid(int shift, int ctrl, float *val, float fac1, float fac2, float fac3, int invert); -int GetButStringLength(char *str); +int GetButStringLength(const char *str); #endif /* ED_UTIL_H */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 8e5b4ee3abd..12ca1bc9a7a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -280,10 +280,10 @@ uiPopupMenu *uiPupMenuBegin(struct bContext *C, const char *title, int icon); void uiPupMenuEnd(struct bContext *C, struct uiPopupMenu *head); struct uiLayout *uiPupMenuLayout(uiPopupMenu *head); -void uiPupMenuOkee(struct bContext *C, const char *opname, char *str, ...); -void uiPupMenuSaveOver(struct bContext *C, struct wmOperator *op, char *filename); -void uiPupMenuNotice(struct bContext *C, char *str, ...); -void uiPupMenuError(struct bContext *C, char *str, ...); +void uiPupMenuOkee(struct bContext *C, const char *opname, const char *str, ...); +void uiPupMenuSaveOver(struct bContext *C, struct wmOperator *op, const char *filename); +void uiPupMenuNotice(struct bContext *C, const char *str, ...); +void uiPupMenuError(struct bContext *C, const char *str, ...); void uiPupMenuReports(struct bContext *C, struct ReportList *reports); void uiPupMenuInvoke(struct bContext *C, const char *idname); /* popup registered menu */ @@ -325,7 +325,7 @@ void uiFreeInactiveBlocks(const struct bContext *C, struct ListBase *lb); void uiBlockSetRegion(uiBlock *block, struct ARegion *region); -void uiBlockSetButLock(uiBlock *block, int val, char *lockstr); +void uiBlockSetButLock(uiBlock *block, int val, const char *lockstr); void uiBlockClearButLock(uiBlock *block); /* automatic aligning, horiz or verical */ @@ -389,18 +389,18 @@ uiBut *uiDefBut(uiBlock *block, short x2, short y2, void *poin, float min, float max, - float a1, float a2, char *tip); -uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip); -uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip); + float a1, float a2, const char *tip); +uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, const char *tip); +uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip); uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, @@ -408,17 +408,17 @@ uiBut *uiDefIconBut(uiBlock *block, short x2, short y2, void *poin, float min, float max, - float a1, float a2, char *tip); -uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip); + float a1, float a2, const char *tip); +uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, const char *tip); uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, @@ -426,17 +426,17 @@ uiBut *uiDefIconTextBut(uiBlock *block, short x2, short y2, void *poin, float min, float max, - float a1, float a2, char *tip); -uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip); -uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, char *tip); + float a1, float a2, const char *tip); +uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, struct PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip); +uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip); /* for passing inputs to ButO buttons */ struct PointerRNA *uiButGetOperatorPtrRNA(uiBut *but); @@ -466,33 +466,33 @@ struct PointerRNA *uiButGetOperatorPtrRNA(uiBut *but); #define UI_ID_PREVIEWS 2048 #define UI_ID_FULL (UI_ID_RENAME|UI_ID_BROWSE|UI_ID_ADD_NEW|UI_ID_OPEN|UI_ID_ALONE|UI_ID_DELETE|UI_ID_LOCAL) -typedef void (*uiIDPoinFuncFP)(struct bContext *C, char *str, struct ID **idpp); +typedef void (*uiIDPoinFuncFP)(struct bContext *C, const char *str, struct ID **idpp); typedef void (*uiIDPoinFunc)(struct bContext *C, struct ID *id, int event); -uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str, - short x1, short y1, short x2, short y2, void *idpp, char *tip); +uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str, + short x1, short y1, short x2, short y2, void *idpp, const char *tip); int uiIconFromID(struct ID *id); -uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip); -uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip); -uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip); -uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, short x1, short y1, short x2, short y2, char *tip); +uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip); +uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip); +uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip); +uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, short x1, short y1, short x2, short y2, const char *tip); -uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *func_arg1, char *str, short x1, short y1, short x2, short y2, char *tip); -uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char *str, short x1, short y1, short x2, short y2, char *tip); +uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *func_arg1, const char *str, short x1, short y1, short x2, short y2, const char *tip); +uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const char *str, short x1, short y1, short x2, short y2, const char *tip); -uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, char *tip); -uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip); +uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, const char *tip); +uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip); -uiBut *uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip); -uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *keypoin, short *modkeypoin, char *tip); +uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, short x1, short y1, short x2, short y2, short *spoin, const char *tip); +uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, short x1, short y1, short x2, short y2, short *keypoin, short *modkeypoin, const char *tip); -uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, short x1, short y1, short x2, short y2, float a1, float a2, char *tip); +uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, short x1, short y1, short x2, short y2, float a1, float a2, const char *tip); void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float *old, char *hexcol, char mode, short retval); -uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, char *name, int icon, int x1, int y1, int x2, int y2); +uiBut *uiDefAutoButR(uiBlock *block, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2); void uiDefAutoButsRNA(uiLayout *layout, struct PointerRNA *ptr, int columns); /* Links @@ -557,7 +557,7 @@ void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext typedef struct AutoComplete AutoComplete; -AutoComplete *autocomplete_begin(char *startname, int maxlen); +AutoComplete *autocomplete_begin(const char *startname, int maxlen); void autocomplete_do_name(AutoComplete *autocpl, const char *name); void autocomplete_end(AutoComplete *autocpl, char *autoname); @@ -708,13 +708,13 @@ void uiTemplateList(uiLayout *layout, struct bContext *C, struct PointerRNA *ptr /* items */ void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname); -void uiItemEnumO(uiLayout *layout, const char *opname, char *name, int icon, const char *propname, int value); -void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value); +void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value); +void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value); void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname); -void uiItemBooleanO(uiLayout *layout, char *name, int icon, const char *opname, const char *propname, int value); +void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value); void uiItemIntO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value); void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, float value); -void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value); +void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value); PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, int icon, struct IDProperty *properties, int context, int flag); void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon); @@ -726,9 +726,9 @@ void uiItemPointerR(uiLayout *layout, struct PointerRNA *ptr, const char *propna void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, struct IDProperty *properties, int context, int flag); void uiItemL(uiLayout *layout, const char *name, int icon); /* label */ -void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, char *name, int icon); /* label icon for dragging */ +void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon); /* label icon for dragging */ void uiItemM(uiLayout *layout, struct bContext *C, const char *menuname, const char *name, int icon); /* menu */ -void uiItemV(uiLayout *layout, char *name, int icon, int argval); /* value */ +void uiItemV(uiLayout *layout, const char *name, int icon, int argval); /* value */ void uiItemS(uiLayout *layout); /* separator */ void uiItemMenuF(uiLayout *layout, const char *name, int icon, uiMenuCreateFunc func, void *arg); @@ -746,8 +746,8 @@ void uiIDContextProperty(struct bContext *C, struct PointerRNA *ptr, struct Prop /* Styled text draw */ void uiStyleFontSet(struct uiFontStyle *fs); -void uiStyleFontDraw(struct uiFontStyle *fs, struct rcti *rect, char *str); -void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, char *str); +void uiStyleFontDraw(struct uiFontStyle *fs, struct rcti *rect, const char *str); +void uiStyleFontDrawRotated(struct uiFontStyle *fs, struct rcti *rect, const char *str); int UI_GetStringWidth(const char *str); // XXX temp void UI_DrawString(float x, float y, const char *str); // XXX temp diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 061bff7187f..b62a76ee14a 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -941,7 +941,7 @@ void uiComposeLinks(uiBlock *block) /* ************************************************ */ -void uiBlockSetButLock(uiBlock *block, int val, char *lockstr) +void uiBlockSetButLock(uiBlock *block, int val, const char *lockstr) { if(val) { block->lock= val ? 1:0; @@ -2449,7 +2449,7 @@ static uiBut *ui_def_but(uiBlock *block, int type, int retval, const char *str, return but; } -static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +static uiBut *ui_def_but_rna(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; PropertyRNA *prop; @@ -2679,7 +2679,7 @@ static uiBut *ui_def_but_operator_text(uiBlock *block, int type, const char *opn return but; } -uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefBut(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2712,10 +2712,10 @@ static int findBitIndex(unsigned int x) { struct AutoComplete { int maxlen; char *truncate; - char *startname; + const char *startname; }; -AutoComplete *autocomplete_begin(char *startname, int maxlen) +AutoComplete *autocomplete_begin(const char *startname, int maxlen) { AutoComplete *autocpl; @@ -2730,7 +2730,7 @@ AutoComplete *autocomplete_begin(char *startname, int maxlen) void autocomplete_do_name(AutoComplete *autocpl, const char *name) { char *truncate= autocpl->truncate; - char *startname= autocpl->startname; + const char *startname= autocpl->startname; int a; for(a=0; amaxlen-1; a++) { @@ -2788,7 +2788,7 @@ static void autocomplete_id(bContext *C, char *str, void *arg_v) } } -static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { int bitIdx= findBitIndex(bit); if (bitIdx==-1) { @@ -2797,39 +2797,39 @@ static uiBut *uiDefButBit(uiBlock *block, int type, int bit, int retval, char *s return uiDefBut(block, type|BIT|bitIdx, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); } } -uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButF(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|FLO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|FLO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButI(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|INT, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|INT, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButS(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|SHO, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|SHO, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButC(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefBut(block, type|CHA, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefButBit(block, type|CHA, bit, retval, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; @@ -2839,7 +2839,7 @@ uiBut *uiDefButR(uiBlock *block, int type, int retval, const char *str, short x1 return but; } -uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but; @@ -2850,7 +2850,7 @@ uiBut *uiDefButO(uiBlock *block, int type, const char *opname, int opcontext, ch return but; } -uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but_operator_text(block, type, opname, opcontext, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2861,7 +2861,7 @@ uiBut *uiDefButTextO(uiBlock *block, int type, const char *opname, int opcontext } /* if a1==1.0 then a2 is an extra icon blending factor (alpha 0.0 - 1.0) */ -uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, type, retval, "", x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2872,7 +2872,7 @@ uiBut *uiDefIconBut(uiBlock *block, int type, int retval, int icon, short x1, sh return but; } -static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { int bitIdx= findBitIndex(bit); if (bitIdx==-1) { @@ -2882,39 +2882,39 @@ static uiBut *uiDefIconButBit(uiBlock *block, int type, int bit, int retval, int } } -uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|FLO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|FLO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|INT, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|INT, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|SHO, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|SHO, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconBut(block, type|CHA, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconButBit(block, type|CHA, bit, retval, icon, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; @@ -2929,7 +2929,7 @@ uiBut *uiDefIconButR(uiBlock *block, int type, int retval, int icon, short x1, s return but; } -uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but; @@ -2944,7 +2944,7 @@ uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, int opcontext } /* Button containing both string label and icon */ -uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, type, retval, str, x1, y1, x2, y2, poin, min, max, a1, a2, tip); @@ -2957,7 +2957,7 @@ uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, const ch return but; } -static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip) +static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, const char *tip) { int bitIdx= findBitIndex(bit); if (bitIdx==-1) { @@ -2967,39 +2967,39 @@ static uiBut *uiDefIconTextButBit(uiBlock *block, int type, int bit, int retval, } } -uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|FLO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|FLO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|INT, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|INT, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|SHO, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|SHO, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextBut(block, type|CHA, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, const char *tip) { return uiDefIconTextButBit(block, type|CHA, bit, retval, icon, str, x1, y1, x2, y2, (void*) poin, min, max, a1, a2, tip); } -uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, char *tip) +uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const char *str, short x1, short y1, short x2, short y2, PointerRNA *ptr, const char *propname, int index, float min, float max, float a1, float a2, const char *tip) { uiBut *but; @@ -3015,7 +3015,7 @@ uiBut *uiDefIconTextButR(uiBlock *block, int type, int retval, int icon, const c return but; } -uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, int opcontext, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but; @@ -3246,7 +3246,7 @@ void uiButSetCompleteFunc(uiBut *but, uiButCompleteFunc func, void *arg) but->autofunc_arg= arg; } -uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, char *str, short x1, short y1, short x2, short y2, void *idpp, char *tip) +uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int retval, const char *str, short x1, short y1, short x2, short y2, void *idpp, const char *tip) { uiBut *but= ui_def_but(block, IDPOIN, retval, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip); but->idpoin_func= func; @@ -3259,7 +3259,7 @@ uiBut *uiDefIDPoinBut(uiBlock *block, uiIDPoinFuncFP func, short blocktype, int return but; } -uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; @@ -3267,7 +3267,7 @@ uiBut *uiDefBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *st return but; } -uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, NULL, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; @@ -3279,7 +3279,7 @@ uiBut *uiDefBlockButN(uiBlock *block, uiBlockCreateFunc func, void *argN, char * } -uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); but->block_create_func= func; @@ -3287,7 +3287,7 @@ uiBut *uiDefPulldownBut(uiBlock *block, uiBlockCreateFunc func, void *arg, char return but; } -uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); but->menu_create_func= func; @@ -3295,7 +3295,7 @@ uiBut *uiDefMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, char *str, return but; } -uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3311,7 +3311,7 @@ uiBut *uiDefIconTextMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, in return but; } -uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int icon, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, PULLDOWN, 0, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3326,7 +3326,7 @@ uiBut *uiDefIconMenuBut(uiBlock *block, uiMenuCreateFunc func, void *arg, int ic } /* Block button containing both string label and icon */ -uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int icon, const char *str, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, 0, str, x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3345,7 +3345,7 @@ uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, } /* Block button containing icon */ -uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, char *tip) +uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int retval, int icon, short x1, short y1, short x2, short y2, const char *tip) { uiBut *but= ui_def_but(block, BLOCK, retval, "", x1, y1, x2, y2, arg, 0.0, 0.0, 0.0, 0.0, tip); @@ -3360,7 +3360,7 @@ uiBut *uiDefIconBlockBut(uiBlock *block, uiBlockCreateFunc func, void *arg, int return but; } -uiBut *uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip) +uiBut *uiDefKeyevtButS(uiBlock *block, int retval, const char *str, short x1, short y1, short x2, short y2, short *spoin, const char *tip) { uiBut *but= ui_def_but(block, KEYEVT|SHO, retval, str, x1, y1, x2, y2, spoin, 0.0, 0.0, 0.0, 0.0, tip); ui_check_but(but); @@ -3369,7 +3369,7 @@ uiBut *uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1 /* short pointers hardcoded */ /* modkeypoin will be set to KM_SHIFT, KM_ALT, KM_CTRL, KM_OSKEY bits */ -uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *keypoin, short *modkeypoin, char *tip) +uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, const char *str, short x1, short y1, short x2, short y2, short *keypoin, short *modkeypoin, const char *tip) { uiBut *but= ui_def_but(block, HOTKEYEVT|SHO, retval, str, x1, y1, x2, y2, keypoin, 0.0, 0.0, 0.0, 0.0, tip); but->modifier_key= *modkeypoin; @@ -3380,7 +3380,7 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block, int retval, char *str, short x1, short /* arg is pointer to string/name, use uiButSetSearchFunc() below to make this work */ /* here a1 and a2, if set, control thumbnail preview rows/cols */ -uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, short x1, short y1, short x2, short y2, float a1, float a2, char *tip) +uiBut *uiDefSearchBut(uiBlock *block, void *arg, int retval, int icon, int maxlen, short x1, short y1, short x2, short y2, float a1, float a2, const char *tip) { uiBut *but= ui_def_but(block, SEARCH_MENU, retval, "", x1, y1, x2, y2, arg, 0.0, maxlen, a1, a2, tip); diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 34eb78a40d8..d09be1df39a 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -303,7 +303,7 @@ struct uiBlock { short auto_open; double auto_open_last; - char *lockstr; + const char *lockstr; char lock; char active; // to keep blocks while drawing and free them afterwards @@ -436,7 +436,7 @@ void ui_set_name_menu(uiBut *but, int value); int ui_step_name_menu(uiBut *but, int step); struct AutoComplete; -struct AutoComplete *autocomplete_begin(char *startname, int maxlen); +struct AutoComplete *autocomplete_begin(const char *startname, int maxlen); void autocomplete_do_name(struct AutoComplete *autocpl, const char *name); void autocomplete_end(struct AutoComplete *autocpl, char *autoname); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 4c166251268..e14a52ca2dc 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -439,7 +439,7 @@ static void ui_item_enum_expand(uiLayout *layout, uiBlock *block, PointerRNA *pt uiBut *but; EnumPropertyItem *item; const char *identifier; - char *name; + const char *name; int a, totitem, itemw, icon, value, free; identifier= RNA_property_identifier(prop); @@ -646,7 +646,7 @@ PointerRNA uiItemFullO(uiLayout *layout, const char *idname, const char *name, i return PointerRNA_NULL; } -static char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const char *propname, int retval) +static const char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const char *propname, int retval) { wmOperatorType *ot= WM_operatortype_find(opname, 0); PointerRNA ptr; @@ -676,7 +676,7 @@ static char *ui_menu_enumpropname(uiLayout *layout, const char *opname, const ch return ""; } -void uiItemEnumO(uiLayout *layout, const char *opname, char *name, int icon, const char *propname, int value) +void uiItemEnumO(uiLayout *layout, const char *opname, const char *name, int icon, const char *propname, int value) { PointerRNA ptr; @@ -759,7 +759,7 @@ void uiItemsEnumO(uiLayout *layout, const char *opname, const char *propname) } /* for use in cases where we have */ -void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value_str) +void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value_str) { PointerRNA ptr; @@ -796,7 +796,7 @@ void uiItemEnumO_string(uiLayout *layout, const char *name, int icon, const char uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0); } -void uiItemBooleanO(uiLayout *layout, char *name, int icon, const char *opname, const char *propname, int value) +void uiItemBooleanO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, int value) { PointerRNA ptr; @@ -826,7 +826,7 @@ void uiItemFloatO(uiLayout *layout, const char *name, int icon, const char *opna uiItemFullO(layout, opname, name, icon, ptr.data, layout->root->opcontext, 0); } -void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, char *value) +void uiItemStringO(uiLayout *layout, const char *name, int icon, const char *opname, const char *propname, const char *value) { PointerRNA ptr; @@ -1374,7 +1374,7 @@ void uiItemL(uiLayout *layout, const char *name, int icon) uiItemL_(layout, name, icon); } -void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, char *name, int icon) +void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, const char *name, int icon) { uiBut *but= uiItemL_(layout, name, icon); @@ -1385,7 +1385,7 @@ void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, char *name, int icon) /* value item */ -void uiItemV(uiLayout *layout, char *name, int icon, int argval) +void uiItemV(uiLayout *layout, const char *name, int icon, int argval) { /* label */ uiBlock *block= layout->root->block; diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 6b834c08456..df2ebd44c9c 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -71,7 +71,7 @@ /*********************** Menu Data Parsing ********************* */ typedef struct MenuEntry { - char *str; + const char *str; int retval; int icon; int sepr; @@ -79,7 +79,7 @@ typedef struct MenuEntry { typedef struct MenuData { char *instr; - char *title; + const char *title; int titleicon; MenuEntry *items; @@ -99,7 +99,7 @@ static MenuData *menudata_new(char *instr) return md; } -static void menudata_set_title(MenuData *md, char *title, int titleicon) +static void menudata_set_title(MenuData *md, const char *title, int titleicon) { if (!md->title) md->title= title; @@ -107,7 +107,7 @@ static void menudata_set_title(MenuData *md, char *title, int titleicon) md->titleicon= titleicon; } -static void menudata_add_item(MenuData *md, char *str, int retval, int icon, int sepr) +static void menudata_add_item(MenuData *md, const char *str, int retval, int icon, int sepr) { if (md->nitems==md->itemssize) { int nsize= md->itemssize?(md->itemssize<<1):1; @@ -154,7 +154,8 @@ MenuData *decompose_menu_string(char *str) { char *instr= BLI_strdup(str); MenuData *md= menudata_new(instr); - char *nitem= NULL, *s= instr; + const char *nitem= NULL; + char *s= instr; int nicon=0, nretval= 1, nitem_is_title= 0, nitem_is_sepr= 0; while (1) { @@ -2279,7 +2280,7 @@ static void confirm_cancel_operator(void *opv) WM_operator_free(opv); } -static void vconfirm_opname(bContext *C, const char *opname, char *title, char *itemfmt, va_list ap) +static void vconfirm_opname(bContext *C, const char *opname, const char *title, const char *itemfmt, va_list ap) { uiPopupBlockHandle *handle; char *s, buf[512]; @@ -2294,7 +2295,7 @@ static void vconfirm_opname(bContext *C, const char *opname, char *title, char * handle->popup_arg= (void *)opname; } -static void confirm_operator(bContext *C, wmOperator *op, char *title, char *item) +static void confirm_operator(bContext *C, wmOperator *op, const char *title, const char *item) { uiPopupBlockHandle *handle; char *s, buf[512]; @@ -2309,7 +2310,7 @@ static void confirm_operator(bContext *C, wmOperator *op, char *title, char *ite handle->cancel_func= confirm_cancel_operator; } -void uiPupMenuOkee(bContext *C, const char *opname, char *str, ...) +void uiPupMenuOkee(bContext *C, const char *opname, const char *str, ...) { va_list ap; char titlestr[256]; @@ -2321,7 +2322,7 @@ void uiPupMenuOkee(bContext *C, const char *opname, char *str, ...) va_end(ap); } -void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename) +void uiPupMenuSaveOver(bContext *C, wmOperator *op, const char *filename) { size_t len= strlen(filename); @@ -2339,7 +2340,7 @@ void uiPupMenuSaveOver(bContext *C, wmOperator *op, char *filename) confirm_operator(C, op, "Save Over", filename); } -void uiPupMenuNotice(bContext *C, char *str, ...) +void uiPupMenuNotice(bContext *C, const char *str, ...) { va_list ap; @@ -2348,7 +2349,7 @@ void uiPupMenuNotice(bContext *C, char *str, ...) va_end(ap); } -void uiPupMenuError(bContext *C, char *str, ...) +void uiPupMenuError(bContext *C, const char *str, ...) { va_list ap; char nfmt[256]; diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index 43f11ae421e..51a54315d66 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -136,7 +136,7 @@ static uiFont *uifont_to_blfont(int id) /* *************** draw ************************ */ -void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) +void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, const char *str) { float height; int xofs=0, yofs; @@ -174,7 +174,7 @@ void uiStyleFontDraw(uiFontStyle *fs, rcti *rect, char *str) } /* drawn same as above, but at 90 degree angle */ -void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, char *str) +void uiStyleFontDrawRotated(uiFontStyle *fs, rcti *rect, const char *str) { float height; int xofs, yofs; diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index ae75bd03d86..e56aa3f7682 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1962,7 +1962,8 @@ static void list_item_row(bContext *C, uiLayout *layout, PointerRNA *ptr, Pointe uiBlock *block= uiLayoutGetBlock(layout); uiBut *but; uiLayout *split, *overlap, *sub, *row; - char *name, *namebuf; + char *namebuf; + const char *name; int icon; overlap= uiLayoutOverlap(layout); diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 6d8aa89afb0..7d3f186d490 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -40,7 +40,7 @@ /*************************** RNA Utilities ******************************/ -uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, char *name, int icon, int x1, int y1, int x2, int y2) +uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int index, const char *name, int icon, int x1, int y1, int x2, int y2) { uiBut *but=NULL; const char *propname= RNA_property_identifier(prop); diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index 5dd1b1227a3..da3f7e3f916 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1312,7 +1312,7 @@ static void make_prim(Object *obedit, int type, float mat[4][4], int tot, int se /* ********* add primitive operators ************* */ -static char *get_mesh_defname(int type) +static const char *get_mesh_defname(int type) { switch (type) { case PRIM_PLANE: return "Plane"; diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 8adf504b7fd..6b101c0c92f 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -1194,7 +1194,7 @@ static void delete_mesh(EditMesh *em, wmOperator *op, int event) EditVert *eve,*nextve; EditEdge *eed,*nexted; int count; - char *str="Erase"; + const char *str="Erase"; if(event<1) return; diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 820e287e945..8b12b4b8872 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1192,9 +1192,9 @@ float *editmesh_get_mirror_uv(int axis, float *uv, float *mirrCent, float *face_ } #endif -static unsigned int mirror_facehash(void *ptr) +static unsigned int mirror_facehash(const void *ptr) { - MFace *mf= ptr; + const MFace *mf= ptr; int v0, v1; if(mf->v4) { @@ -1233,7 +1233,7 @@ static int mirror_facerotation(MFace *a, MFace *b) return -1; } -static int mirror_facecmp(void *a, void *b) +static int mirror_facecmp(const void *a, const void *b) { return (mirror_facerotation((MFace*)a, (MFace*)b) == -1); } diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 198b68bce40..664e2d5eda3 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -653,7 +653,7 @@ void OBJECT_OT_armature_add(wmOperatorType *ot) ED_object_add_generic_props(ot, TRUE); } -static char *get_lamp_defname(int type) +static const char *get_lamp_defname(int type) { switch (type) { case LA_LOCAL: return "Point"; diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index e222913e703..d5ca7f0f89e 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -212,7 +212,7 @@ void update_pyconstraint_cb (void *arg1, void *arg2) } /* helper function for add_constriant - sets the last target for the active constraint */ -static void set_constraint_nth_target (bConstraint *con, Object *target, char subtarget[], int index) +static void set_constraint_nth_target (bConstraint *con, Object *target, const char subtarget[], int index) { bConstraintTypeInfo *cti= constraint_get_typeinfo(con); ListBase targets = {NULL, NULL}; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index a077e9890b0..11084c2c0d1 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1052,7 +1052,7 @@ static void copymenu_modifiers(Main *bmain, Scene *scene, View3D *v3d, Object *o Base *base; int i, event; char str[512]; - char *errorstr= NULL; + const char *errorstr= NULL; strcpy(str, "Copy Modifiers %t"); diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index adf5d00355e..1801116fe01 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -633,7 +633,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF FILE *fileCfg; int dirExist = 0; char newSurfdataPath[FILE_MAXDIR+FILE_MAXFILE]; // modified output settings - char *suffixConfig = FLUID_SUFFIX_CONFIG; + const char *suffixConfig = FLUID_SUFFIX_CONFIG; int outStringsChanged = 0; // prepare names... @@ -813,8 +813,8 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) int gridlevels = 0; const char *strEnvName = "BLENDER_ELBEEMDEBUG"; // from blendercall.cpp - char *suffixConfig = FLUID_SUFFIX_CONFIG; - char *suffixSurface = FLUID_SUFFIX_SURFACE; + const char *suffixConfig = FLUID_SUFFIX_CONFIG; + const char *suffixSurface = FLUID_SUFFIX_SURFACE; char targetDir[FILE_MAXDIR+FILE_MAXFILE]; // store & modify output settings char targetFile[FILE_MAXDIR+FILE_MAXFILE]; // temp. store filename from targetDir for access diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 6c52a04eb0b..5426a0e9df2 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -390,7 +390,7 @@ static ScrArea *find_empty_image_area(bContext *C) } #endif // XXX not used -static void render_error_reports(void *reports, char *str) +static void render_error_reports(void *reports, const char *str) { BKE_report(reports, RPT_ERROR, str); } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index c25a912d597..fd8afd63bb8 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1130,7 +1130,7 @@ void ED_area_prevspace(bContext *C, ScrArea *sa) WM_event_add_notifier(C, NC_SPACE|ND_SPACE_CHANGED, sa); } -static char *editortype_pup(void) +static const char *editortype_pup(void) { return( "Editor type:%t" @@ -1227,7 +1227,7 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco) /************************ standard UI regions ************************/ -void ED_region_panels(const bContext *C, ARegion *ar, int vertical, char *context, int contextnr) +void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char *context, int contextnr) { ScrArea *sa= CTX_wm_area(C); uiStyle *style= U.uistyles.first; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 130916f4285..7c30d113132 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -408,7 +408,7 @@ ScrArea *area_split(bScreen *sc, ScrArea *sa, char dir, float fac) /* empty screen, with 1 dummy area without spacedata */ /* uses window size */ -bScreen *ED_screen_add(wmWindow *win, Scene *scene, char *name) +bScreen *ED_screen_add(wmWindow *win, Scene *scene, const char *name) { bScreen *sc; ScrVert *sv1, *sv2, *sv3, *sv4; diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index d15dd7902bf..7607255d5ce 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -2692,7 +2692,7 @@ int sculpt_poll(bContext *C) return sculpt_mode_poll(C) && paint_poll(C); } -static char *sculpt_tool_name(Sculpt *sd) +static const char *sculpt_tool_name(Sculpt *sd) { Brush *brush = paint_brush(&sd->paint); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.h b/source/blender/editors/sculpt_paint/sculpt_intern.h index 254876d9b68..7893c27fbcd 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.h +++ b/source/blender/editors/sculpt_paint/sculpt_intern.h @@ -104,7 +104,7 @@ typedef struct SculptUndoNode { SculptUndoNode *sculpt_undo_push_node(SculptSession *ss, PBVHNode *node); SculptUndoNode *sculpt_undo_get_node(PBVHNode *node); -void sculpt_undo_push_begin(char *name); +void sculpt_undo_push_begin(const char *name); void sculpt_undo_push_end(void); struct MultiresModifierData *sculpt_multires_active(struct Scene *scene, struct Object *ob); diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c index e92740678fd..1964f1a03c7 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.c +++ b/source/blender/editors/sculpt_paint/sculpt_undo.c @@ -274,7 +274,7 @@ SculptUndoNode *sculpt_undo_push_node(SculptSession *ss, PBVHNode *node) return unode; } -void sculpt_undo_push_begin(char *name) +void sculpt_undo_push_begin(const char *name) { undo_paint_push_begin(UNDO_PAINT_MESH, name, sculpt_undo_restore, sculpt_undo_free); diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index df45bc15827..5ee2d1b83d8 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -203,7 +203,7 @@ void SOUND_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ // XXX this function is in image_ops.c too, exactly the same, should be moved to a generally accessible position -static void unpack_menu(bContext *C, char *opname, char *abs_name, char *folder, PackedFile *pf) +static void unpack_menu(bContext *C, const char *opname, const char *abs_name, const char *folder, PackedFile *pf) { uiPopupMenu *pup; uiLayout *layout; diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 86cd4a967f1..109c5f0fdf6 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -68,7 +68,6 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat uiBut *but; uiLayout *box, *col; struct FSMenu* fsmenu = fsmenu_get(); - char *curdir= (sfile->params)? sfile->params->dir: ""; int i, i_iter, nentries = fsmenu_get_nentries(fsmenu, category); /* reset each time */ @@ -95,8 +94,11 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat entry = fsmenu_get_entry(fsmenu, category, i); /* set this list item as active if we have a match */ - if(strcmp(curdir, entry) == 0) - *nr= i; + if(sfile->params) { + if(strcmp(sfile->params->dir, entry) == 0) { + *nr= i; + } + } /* create nice bookmark name, shows last directory in the full path currently */ BLI_strncpy(temp, entry, FILE_MAX); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 41ad7ad3503..c476b5d8cde 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -238,8 +238,8 @@ static int compare_size(const void *a1, const void *a2) static int compare_extension(const void *a1, const void *a2) { const struct direntry *entry1=a1, *entry2=a2; - char *sufix1, *sufix2; - char *nil=""; + const char *sufix1, *sufix2; + const char *nil=""; if (!(sufix1= strstr (entry1->relname, ".blend.gz"))) sufix1= strrchr (entry1->relname, '.'); diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index a043fc8cfd1..2856f0f4fdf 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -157,7 +157,7 @@ short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx) return fsme?fsme->save:0; } -void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save) +void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save) { FSMenuEntry *prev; FSMenuEntry *fsme; diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index dcf8d3eb632..d499f439f65 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -56,7 +56,7 @@ char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int ind * Duplicate entries are not added. * @param sorted Should entry be inserted in sorted order? */ -void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save); +void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save); /** Return whether the entry was created by the user and can be saved and deleted */ short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index dab486949ea..a2aa2419e49 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1432,7 +1432,7 @@ void IMAGE_OT_pack(wmOperatorType *ot) /********************* unpack operator *********************/ -void unpack_menu(bContext *C, char *opname, Image *ima, char *folder, PackedFile *pf) +static void unpack_menu(bContext *C, const char *opname, Image *ima, const char *folder, PackedFile *pf) { PointerRNA props_ptr; uiPopupMenu *pup; diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index 8ae9c1293eb..787d70805c6 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -321,7 +321,7 @@ static int report_delete_exec(bContext *C, wmOperator *UNUSED(op)) if((report->type & report_mask) && (report->flag & SELECT)) { BLI_remlink(&reports->list, report); - MEM_freeN(report->message); + MEM_freeN((void *)report->message); MEM_freeN(report); } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index e6ed3f6ec1f..068ac016b13 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -593,7 +593,7 @@ void do_logic_buts(bContext *C, void *UNUSED(arg), int event) } -static char *sensor_name(int type) +static const char *sensor_name(int type) { switch (type) { case SENS_ALWAYS: @@ -630,7 +630,7 @@ static char *sensor_name(int type) return "unknown"; } -static char *sensor_pup(void) +static const char *sensor_pup(void) { /* the number needs to match defines in DNA_sensor_types.h */ return "Sensors %t|Always %x0|Delay %x13|Keyboard %x3|Mouse %x5|" @@ -638,7 +638,7 @@ static char *sensor_pup(void) "Property %x4|Random %x8|Ray %x9|Message %x10|Joystick %x11|Actuator %x12|Armature %x14"; } -static char *controller_name(int type) +static const char *controller_name(int type) { switch (type) { case CONT_LOGIC_AND: @@ -661,12 +661,12 @@ static char *controller_name(int type) return "unknown"; } -static char *controller_pup(void) +static const char *controller_pup(void) { return "Controllers %t|AND %x0|OR %x1|XOR %x6|NAND %x4|NOR %x5|XNOR %x7|Expression %x2|Python %x3"; } -static char *actuator_name(int type) +static const char *actuator_name(int type) { switch (type) { case ACT_SHAPEACTION: @@ -718,7 +718,7 @@ static char *actuator_name(int type) -static char *actuator_pup(Object *owner) +static const char *actuator_pup(Object *owner) { switch (owner->type) { @@ -976,12 +976,12 @@ static void verify_logicbutton_func(bContext *UNUSED(C), void *data1, void *data } } -static void test_scriptpoin_but(struct bContext *C, char *name, ID **idpp) +static void test_scriptpoin_but(struct bContext *C, const char *name, ID **idpp) { *idpp= BLI_findstring(&CTX_data_main(C)->text, name, offsetof(ID, name) + 2); } -static void test_actionpoin_but(struct bContext *C, char *name, ID **idpp) +static void test_actionpoin_but(struct bContext *C, const char *name, ID **idpp) { *idpp= BLI_findstring(&CTX_data_main(C)->action, name, offsetof(ID, name) + 2); if(*idpp) @@ -989,28 +989,28 @@ static void test_actionpoin_but(struct bContext *C, char *name, ID **idpp) } -static void test_obpoin_but(struct bContext *C, char *name, ID **idpp) +static void test_obpoin_but(struct bContext *C, const char *name, ID **idpp) { *idpp= BLI_findstring(&CTX_data_main(C)->object, name, offsetof(ID, name) + 2); if(*idpp) id_lib_extern(*idpp); /* checks lib data, sets correct flag for saving then */ } -static void test_meshpoin_but(struct bContext *C, char *name, ID **idpp) +static void test_meshpoin_but(struct bContext *C, const char *name, ID **idpp) { *idpp= BLI_findstring(&CTX_data_main(C)->mesh, name, offsetof(ID, name) + 2); if(*idpp) id_us_plus(*idpp); } -static void test_matpoin_but(struct bContext *C, char *name, ID **idpp) +static void test_matpoin_but(struct bContext *C, const char *name, ID **idpp) { *idpp= BLI_findstring(&CTX_data_main(C)->mat, name, offsetof(ID, name) + 2); if(*idpp) id_us_plus(*idpp); } -static void test_scenepoin_but(struct bContext *C, char *name, ID **idpp) +static void test_scenepoin_but(struct bContext *C, const char *name, ID **idpp) { *idpp= BLI_findstring(&CTX_data_main(C)->scene, name, offsetof(ID, name) + 2); if(*idpp) @@ -1134,7 +1134,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short bDelaySensor *ds = NULL; uiBut *but; short ysize; - char *str; + const char *str; /* yco is at the top of the rect, draw downwards */ @@ -1839,7 +1839,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo float *fp; short ysize = 0, wval; - char *str; + const char *str; int myline, stbit; uiBut *but; @@ -2167,7 +2167,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiDefButF(block, NUM, 0, "Cone Inner Angle: ", xco+wval+10, yco-176, wval, 19, &sa->sound3D.cone_inner_angle, 0.0, 360.0, 0.0, 0.0, "The angle of the inner cone."); } } - MEM_freeN(str); + MEM_freeN((void *)str); } else { uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+10, yco-22, width-20, 19, "Load a sound file."); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 85c1daf81b3..471e5085c56 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -389,7 +389,7 @@ static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA * /* B_NODE_EXEC is handled in butspace.c do_node_buts */ if(!node->id) { - char *strp; + const char *strp; IDnames_to_pupstring(&strp, NULL, "", &(bmain->text), NULL, NULL); node->menunr= 0; bt= uiDefButS(block, MENU, B_NODE_EXEC/*+node->nr*/, strp, @@ -397,7 +397,7 @@ static void node_shader_buts_dynamic(uiLayout *layout, bContext *C, PointerRNA * &node->menunr, 0, 0, 0, 0, "Browses existing choices"); uiButSetFunc(bt, node_browse_text_cb, ntree, node); xoff=19; - if(strp) MEM_freeN(strp); + if(strp) MEM_freeN((void *)strp); } else { bt = uiDefBut(block, BUT, B_NOP, "Update", diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index f9c5661b51d..154911422a6 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -240,7 +240,7 @@ void outliner_free_tree(ListBase *lb) outliner_free_tree(&te->subtree); BLI_remlink(lb, te); - if(te->flag & TE_FREE_NAME) MEM_freeN(te->name); + if(te->flag & TE_FREE_NAME) MEM_freeN((void *)te->name); MEM_freeN(te); } } @@ -324,7 +324,7 @@ static ID *outliner_search_back(SpaceOops *soops, TreeElement *te, short idcode) struct treesort { TreeElement *te; ID *id; - char *name; + const char *name; short idcode; }; @@ -1112,8 +1112,8 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i c= RNA_property_array_item_char(prop, index); te->name= MEM_callocN(sizeof(char)*20, "OutlinerRNAArrayName"); - if(c) sprintf(te->name, " %c", c); - else sprintf(te->name, " %d", index+1); + if(c) sprintf((char *)te->name, " %c", c); + else sprintf((char *)te->name, " %d", index+1); te->flag |= TE_FREE_NAME; } } @@ -1308,7 +1308,7 @@ static int outliner_filter_tree(SpaceOops *soops, ListBase *lb) outliner_free_tree(&te->subtree); BLI_remlink(lb, te); - if(te->flag & TE_FREE_NAME) MEM_freeN(te->name); + if(te->flag & TE_FREE_NAME) MEM_freeN((void *)te->name); MEM_freeN(te); } } @@ -3386,7 +3386,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); SpaceOops *soops= CTX_wm_space_outliner(C); int event; - char *str= NULL; + const char *str= NULL; /* check for invalid states */ if (soops == NULL) @@ -5592,7 +5592,7 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa spx=te->xs+2*OL_X-4; if(spx+dx+10>ar->v2d.cur.xmax) dx = ar->v2d.cur.xmax-spx-10; - bt= uiDefBut(block, TEX, OL_NAMEBUTTON, "", spx, (short)te->ys, dx+10, OL_H-1, te->name, 1.0, (float)len, 0, 0, ""); + bt= uiDefBut(block, TEX, OL_NAMEBUTTON, "", spx, (short)te->ys, dx+10, OL_H-1, (void *)te->name, 1.0, (float)len, 0, 0, ""); uiButSetRenameFunc(bt, namebutton_cb, tselem); /* returns false if button got removed */ diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index fa3078a365b..256bf3f936b 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -49,7 +49,7 @@ typedef struct TreeElement { short index; // index for data arrays short idcode; // from TreeStore id short xend; // width of item display, for select - char *name; + const char *name; void *directdata; // Armature Bones, Base, Sequence, Strip... PointerRNA rnaptr; // RNA Pointer } TreeElement; diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index bf11d131b9c..807672623cd 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -559,7 +559,7 @@ static int sequencer_add_effect_strip_exec(bContext *C, wmOperator *op) int start_frame, end_frame, channel, type; /* operator props */ Sequence *seq1, *seq2, *seq3; - char *error_msg; + const char *error_msg; start_frame= RNA_int_get(op->ptr, "frame_start"); end_frame= RNA_int_get(op->ptr, "frame_end"); diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 9cc98556cba..a5361ec676f 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -71,7 +71,7 @@ static void error(const char *UNUSED(dummy)) {} static void waitcursor(int UNUSED(val)) {} -static void activate_fileselect(int UNUSED(d1), char *UNUSED(d2), char *UNUSED(d3), void *UNUSED(d4)) {} +static void activate_fileselect(int UNUSED(d1), const char *UNUSED(d2), const char *UNUSED(d3), void *UNUSED(d4)) {} static int pupmenu(const char *UNUSED(dummy)) {return 0;} static int okee(const char *UNUSED(dummy)) {return 0;} @@ -603,7 +603,7 @@ void change_sequence(Scene *scene) } -int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, char **error_str) +int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequence **selseq1, Sequence **selseq2, Sequence **selseq3, const char **error_str) { Editing *ed = seq_give_editing(scene, FALSE); Sequence *seq1= 0, *seq2= 0, *seq3= 0, *seq; @@ -1441,7 +1441,7 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); Sequence *seq1, *seq2, *seq3, *last_seq = seq_active_get(scene); - char *error_msg; + const char *error_msg; if(!seq_effect_find_selected(scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg)) { BKE_report(op->reports, RPT_ERROR, error_msg); diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 116786c3009..87872d36c24 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -64,7 +64,7 @@ struct Sequence *find_neighboring_sequence(struct Scene *scene, struct Sequence void deselect_all_seq(struct Scene *scene); void recurs_sel_seq(struct Sequence *seqm); int event_to_efftype(int event); -int seq_effect_find_selected(struct Scene *scene, struct Sequence *activeseq, int type, struct Sequence **selseq1, struct Sequence **selseq2, struct Sequence **selseq3, char **error_str); +int seq_effect_find_selected(struct Scene *scene, struct Sequence *activeseq, int type, struct Sequence **selseq1, struct Sequence **selseq2, struct Sequence **selseq3, const char **error_str); struct Sequence *alloc_sequence(struct ListBase *lb, int cfra, int machine); /* operator helpers */ diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 5c95423e77f..36fef45249d 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1062,8 +1062,11 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event } break; case B_TRANSFORMSPACEADD: - BIF_createTransformOrientation(C, NULL, "", 1, 0); + { + char names[sizeof(((TransformOrientation *)NULL)->name)]= ""; + BIF_createTransformOrientation(C, NULL, names, 1, 0); break; + } case B_TRANSFORMSPACECLEAR: BIF_clearTransformOrientation(C); break; diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 267fcb637d0..80993b45f72 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -688,9 +688,9 @@ static void draw_view_icon(RegionView3D *rv3d) glDisable(GL_BLEND); } -static char *view3d_get_name(View3D *v3d, RegionView3D *rv3d) +static const char *view3d_get_name(View3D *v3d, RegionView3D *rv3d) { - char *name = NULL; + const char *name = NULL; switch (rv3d->view) { case RV3D_VIEW_FRONT: @@ -739,7 +739,7 @@ static char *view3d_get_name(View3D *v3d, RegionView3D *rv3d) static void draw_viewport_name(ARegion *ar, View3D *v3d) { RegionView3D *rv3d= ar->regiondata; - char *name= view3d_get_name(v3d, rv3d); + const char *name= view3d_get_name(v3d, rv3d); char tmpstr[24]; if (v3d->localvd) { diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 55675f8a64d..5c3a34801a3 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -460,7 +460,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) RNA_pointer_create(&ob->id, &RNA_Mesh, ob->data, &meshptr); uiItemR(layout, &meshptr, "use_paint_mask", UI_ITEM_R_ICON_ONLY, "", 0); } else { - char *str_menu; + const char *str_menu; row= uiLayoutRow(layout, 1); uiItemR(row, &v3dptr, "pivot_point", UI_ITEM_R_ICON_ONLY, "", 0); @@ -494,7 +494,7 @@ void uiTemplateHeader3D(uiLayout *layout, struct bContext *C) str_menu = BIF_menustringTransformOrientation(C, "Orientation"); uiDefButS(block, MENU, B_MAN_MODE, str_menu,0,0,70,YIC, &v3d->twmode, 0, 0, 0, 0, "Transform Orientation"); - MEM_freeN(str_menu); + MEM_freeN((void *)str_menu); } if(obedit==NULL && v3d->localvd==NULL) { diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index c47d49de99f..36438712d09 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -3854,7 +3854,7 @@ int Bevel(TransInfo *t, short UNUSED(mval[2])) float distance,d; int i; char str[128]; - char *mode; + const char *mode; TransData *td = t->data; mode = (G.editBMesh->options & BME_BEVEL_VERT) ? "verts only" : "normal"; diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index de6c56246a0..0b70e211484 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -400,7 +400,7 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) return item; } -char * BIF_menustringTransformOrientation(const bContext *C, char *title) { +const char * BIF_menustringTransformOrientation(const bContext *C, const char *title) { char menu[] = "%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3"; ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; TransformOrientation *ts; diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 0d3d8a48b60..f7a4966821a 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -152,7 +152,7 @@ void apply_keyb_grid(int shift, int ctrl, float *val, float fac1, float fac2, fl } -int GetButStringLength(char *str) +int GetButStringLength(const char *str) { int rt; -- cgit v1.2.3