From 535d27eb4923d5582ff16b4016344e8f712608d7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 11 Jan 2012 09:33:44 +0000 Subject: minor cleanup for string use - no functional changes - use more logical names for strings, noticed too many strings called `str` when reviewing name patch. - pass __func__ macro to uiBeginBlock(), quite a few names were wrong (copy/paste error). --- source/blender/blenkernel/intern/image.c | 6 +-- source/blender/blenkernel/intern/library.c | 14 +++--- source/blender/editors/animation/anim_draw.c | 10 ++-- source/blender/editors/armature/poseSlide.c | 16 +++--- .../blender/editors/interface/interface_regions.c | 8 +-- .../editors/interface/interface_templates.c | 21 ++++---- source/blender/editors/interface/view2d.c | 12 ++--- source/blender/editors/space_action/action_draw.c | 2 +- .../blender/editors/space_buttons/buttons_header.c | 2 +- source/blender/editors/space_clip/clip_draw.c | 8 +-- source/blender/editors/space_file/file_draw.c | 8 +-- source/blender/editors/space_file/filelist.c | 2 +- source/blender/editors/space_graph/graph_draw.c | 2 +- source/blender/editors/space_image/image_buttons.c | 2 +- source/blender/editors/space_logic/logic_window.c | 26 +++++----- source/blender/editors/space_nla/nla_draw.c | 2 +- source/blender/editors/space_node/drawnode.c | 8 +-- source/blender/editors/space_node/node_draw.c | 18 +++---- .../blender/editors/space_outliner/outliner_draw.c | 2 +- .../editors/space_sequencer/sequencer_draw.c | 8 +-- source/blender/editors/space_view3d/drawanimviz.c | 16 +++--- source/blender/editors/space_view3d/drawobject.c | 58 +++++++++++----------- .../blender/editors/space_view3d/view3d_buttons.c | 2 +- source/blender/editors/space_view3d/view3d_draw.c | 6 +-- source/blender/gpu/GPU_extensions.h | 2 +- source/blender/gpu/intern/gpu_extensions.c | 2 +- source/blender/windowmanager/intern/wm_operators.c | 6 +-- 27 files changed, 135 insertions(+), 134 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index a5c8f5c905d..6ee2da9f7dc 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -1202,14 +1202,14 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d } if (scene->r.stamp & R_STAMP_FRAME) { - char format[32]; + char fmtstr[32]; int digits= 1; if(scene->r.efra>9) digits= 1 + (int) log10(scene->r.efra); - BLI_snprintf(format, sizeof(format), do_prefix ? "Frame %%0%di":"%%0%di", digits); - BLI_snprintf (stamp_data->frame, sizeof(stamp_data->frame), format, scene->r.cfra); + BLI_snprintf(fmtstr, sizeof(fmtstr), do_prefix ? "Frame %%0%di":"%%0%di", digits); + BLI_snprintf (stamp_data->frame, sizeof(stamp_data->frame), fmtstr, scene->r.cfra); } else { stamp_data->frame[0] = '\0'; } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 315f1e14e61..795cf75820f 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -991,7 +991,7 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor ID *id; for (i=0, id= lb->first; id; id= id->next, i++) { - char buf[32]; + char numstr[32]; if (nr && id==link) *nr= i+1; @@ -1002,12 +1002,12 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor if ( ((Image *)id)->source==IMA_SRC_VIEWER ) continue; - get_flags_for_id(id, buf); + get_flags_for_id(id, numstr); - BLI_dynstr_append(pupds, buf); + BLI_dynstr_append(pupds, numstr); BLI_dynstr_append(pupds, id->name+2); - BLI_snprintf(buf, sizeof(buf), "%%x%d", i+1); - BLI_dynstr_append(pupds, buf); + BLI_snprintf(numstr, sizeof(numstr), "%%x%d", i+1); + BLI_dynstr_append(pupds, numstr); /* icon */ switch(GS(id->name)) @@ -1017,8 +1017,8 @@ static void IDnames_to_dyn_pupstring(DynStr *pupds, ListBase *lb, ID *link, shor case ID_IM: /* fall through */ case ID_WO: /* fall through */ case ID_LA: /* fall through */ - BLI_snprintf(buf, sizeof(buf), "%%i%d", BKE_icon_getid(id) ); - BLI_dynstr_append(pupds, buf); + BLI_snprintf(numstr, sizeof(numstr), "%%i%d", BKE_icon_getid(id) ); + BLI_dynstr_append(pupds, numstr); break; default: break; diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 569125e1055..32e5fe82ed4 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -180,7 +180,7 @@ void ANIM_timecode_string_from_frame (char *str, Scene *scene, int power, short static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) { float xscale, yscale, x, y; - char str[32] = " t"; /* t is the character to start replacing from */ + char numstr[32] = " t"; /* t is the character to start replacing from */ short slen; /* because the frame number text is subject to the same scaling as the contents of the view */ @@ -193,10 +193,10 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) * but power = 1 is required for frames (to get integer frames) */ if (time) - ANIM_timecode_string_from_frame(&str[4], scene, 0, time, FRA2TIME(cfra)); + ANIM_timecode_string_from_frame(&numstr[4], scene, 0, time, FRA2TIME(cfra)); else - ANIM_timecode_string_from_frame(&str[4], scene, 1, time, cfra); - slen= (short)UI_GetStringWidth(str) - 1; + ANIM_timecode_string_from_frame(&numstr[4], scene, 1, time, cfra); + slen= (short)UI_GetStringWidth(numstr) - 1; /* get starting coordinates for drawing */ x= cfra * xscale; @@ -208,7 +208,7 @@ static void draw_cfra_number (Scene *scene, View2D *v2d, float cfra, short time) /* draw current frame number - black text */ UI_ThemeColor(TH_TEXT); - UI_DrawString(x-5, y+3, str); + UI_DrawString(x-5, y+3, numstr); /* restore view transform */ glScalef(xscale, 1.0, 1.0); diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index efc8ffe4c7d..6a9323107d7 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -523,28 +523,28 @@ static void pose_slide_reset (tPoseSlideOp *pso) /* draw percentage indicator in header */ static void pose_slide_draw_status (tPoseSlideOp *pso) { - char statusStr[32]; - char mode[32]; + char status_str[32]; + char mode_str[32]; switch (pso->mode) { case POSESLIDE_PUSH: - strcpy(mode, "Push Pose"); + strcpy(mode_str, "Push Pose"); break; case POSESLIDE_RELAX: - strcpy(mode, "Relax Pose"); + strcpy(mode_str, "Relax Pose"); break; case POSESLIDE_BREAKDOWN: - strcpy(mode, "Breakdown"); + strcpy(mode_str, "Breakdown"); break; default: // unknown - strcpy(mode, "Sliding-Tool"); + strcpy(mode_str, "Sliding-Tool"); break; } - sprintf(statusStr, "%s: %d %%", mode, (int)(pso->percentage*100.0f)); - ED_area_headerprint(pso->sa, statusStr); + sprintf(status_str, "%s: %d %%", mode_str, (int)(pso->percentage*100.0f)); + ED_area_headerprint(pso->sa, status_str); } /* common code for invoke() methods */ diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index c535f2c1ad0..973b43fca78 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2109,7 +2109,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu uiBut *but= arg_but; uiBlock *block; - block= uiBeginBlock(C, handle->region, "colorpicker", UI_EMBOSS); + block= uiBeginBlock(C, handle->region, __func__, UI_EMBOSS); if (but->rnaprop) { if (RNA_property_subtype(but->rnaprop) == PROP_COLOR_GAMMA) { @@ -2299,8 +2299,8 @@ uiPopupBlockHandle *ui_popup_menu_create(bContext *C, ARegion *butregion, uiBut uiStyle *style= UI_GetStyle(); uiPopupBlockHandle *handle; uiPopupMenu *pup; - pup= MEM_callocN(sizeof(uiPopupMenu), "menu dummy"); - pup->block= uiBeginBlock(C, NULL, "ui_button_menu_create", UI_EMBOSSP); + pup= MEM_callocN(sizeof(uiPopupMenu), __func__); + pup->block= uiBeginBlock(C, NULL, __func__, UI_EMBOSSP); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); pup->slideout= (but && (but->block->flag & UI_BLOCK_LOOP)); pup->but= but; @@ -2361,7 +2361,7 @@ uiPopupMenu *uiPupMenuBegin(bContext *C, const char *title, int icon) uiPopupMenu *pup= MEM_callocN(sizeof(uiPopupMenu), "popup menu"); uiBut *but; - pup->block= uiBeginBlock(C, NULL, "uiPupMenuBegin", UI_EMBOSSP); + pup->block= uiBeginBlock(C, NULL, __func__, UI_EMBOSSP); pup->block->flag |= UI_BLOCK_POPUP_MEMORY; pup->block->puphash= ui_popup_menu_hash(title); pup->layout= uiBlockLayout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, style); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 573b6cd0b08..ccca0c8f7cf 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -413,11 +413,11 @@ static void template_ID(bContext *C, uiLayout *layout, TemplateID *template, Str } if(id->us > 1) { - char str[32]; + char numstr[32]; - BLI_snprintf(str, sizeof(str), "%d", id->us); + BLI_snprintf(numstr, sizeof(numstr), "%d", id->us); - but= uiDefBut(block, BUT, 0, str, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, + but= uiDefBut(block, BUT, 0, numstr, 0,0,UI_UNIT_X + ((id->us < 10) ? 0:10), UI_UNIT_Y, NULL, 0, 0, 0, 0, TIP_("Display number of users of this data (click to make a single-user copy)")); uiButSetNFunc(but, template_id_cb, MEM_dupallocN(template), SET_INT_IN_POINTER(UI_ID_ALONE)); @@ -1621,7 +1621,7 @@ static uiBlock *curvemap_clipping_func(bContext *C, struct ARegion *ar, void *cu uiBut *bt; float width= 8*UI_UNIT_X; - block= uiBeginBlock(C, ar, "curvemap_clipping_func", UI_EMBOSS); + block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); /* use this for a fake extra empy space around the buttons */ uiDefBut(block, LABEL, 0, "", -4, 16, width+8, 6*UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); @@ -1680,7 +1680,7 @@ static uiBlock *curvemap_tools_func(bContext *C, struct ARegion *ar, void *cumap uiBlock *block; short yco= 0, menuwidth=10*UI_UNIT_X; - block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); @@ -1702,7 +1702,7 @@ static uiBlock *curvemap_brush_tools_func(bContext *C, struct ARegion *ar, void uiBlock *block; short yco= 0, menuwidth=10*UI_UNIT_X; - block= uiBeginBlock(C, ar, "curvemap_tools_func", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetButmFunc(block, curvemap_tools_dofunc, cumap_v); uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, IFACE_("Reset View"), 0, yco-=UI_UNIT_Y, menuwidth, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 1, ""); @@ -2281,7 +2281,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * uiBlock *block; uiBut *but; Panel *pa; - char *name, str[32]; + const char *name; + char numstr[32]; int rnaicon=0, icon=0, i= 0, activei= 0, len= 0, items, found, min, max; /* validate arguments */ @@ -2372,7 +2373,7 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * uiItemL(row, (name)? name: "", icon); if(name) - MEM_freeN(name); + MEM_freeN((void *)name); } i++; @@ -2385,8 +2386,8 @@ void uiTemplateList(uiLayout *layout, bContext *C, PointerRNA *ptr, const char * uiItemL(row, "", ICON_NONE); /* next/prev button */ - BLI_snprintf(str, sizeof(str), "%d :", i); - but= uiDefIconTextButR_prop(block, NUM, 0, 0, str, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); + BLI_snprintf(numstr, sizeof(numstr), "%d :", i); + but= uiDefIconTextButR_prop(block, NUM, 0, 0, numstr, 0,0,UI_UNIT_X*5,UI_UNIT_Y, activeptr, activeprop, 0, 0, 0, 0, 0, ""); if(i == 0) uiButSetFlag(but, UI_BUT_DISABLED); } diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 57d46de9cb7..81ea3370331 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1507,7 +1507,7 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short static void scroll_printstr(Scene *scene, float x, float y, float val, int power, short unit, char dir) { int len; - char str[32]; + char timecode_str[32]; /* adjust the scale unit to work ok */ if (dir == 'v') { @@ -1522,10 +1522,10 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power } /* get string to print */ - ANIM_timecode_string_from_frame(str, scene, power, (unit == V2D_UNIT_SECONDS), val); + ANIM_timecode_string_from_frame(timecode_str, scene, power, (unit == V2D_UNIT_SECONDS), val); /* get length of string, and adjust printing location to fit it into the horizontal scrollbar */ - len= strlen(str); + len= strlen(timecode_str); if (dir == 'h') { /* seconds/timecode display has slightly longer strings... */ if (unit == V2D_UNIT_SECONDS) @@ -1536,12 +1536,12 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power /* Add degree sympbol to end of string for vertical scrollbar? */ if ((dir == 'v') && (unit == V2D_UNIT_DEGREES)) { - str[len]= 186; - str[len+1]= 0; + timecode_str[len]= 186; + timecode_str[len+1]= 0; } /* draw it */ - BLF_draw_default_ascii(x, y, 0.0f, str, sizeof(str)-1); + BLF_draw_default_ascii(x, y, 0.0f, timecode_str, sizeof(timecode_str)-1); } /* Draw scrollbars in the given 2d-region */ diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 619e76e9e50..309b455e2a2 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -119,7 +119,7 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) } } { /* second pass: widgets */ - uiBlock *block= uiBeginBlock(C, ar, "dopesheet channel buttons", UI_EMBOSS); + uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y= (float)ACHANNEL_FIRST; diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index 1c352b1cb21..6777e2c2d85 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -108,7 +108,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar) buttons_context_compute(C, sbuts); - block= uiBeginBlock(C, ar, "header buttons", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetHandleFunc(block, do_buttons_buttons, NULL); xco= ED_area_header_switchbutton(C, block, yco); diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index 1593ecd7cb8..0d1c312792a 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -75,20 +75,20 @@ void clip_draw_curfra_label(SpaceClip *sc, float x, float y) { uiStyle *style= UI_GetStyle(); int fontid= style->widget.uifont_id; - char str[32]; + char numstr[32]; float font_dims[2] = {0.0f, 0.0f}; /* frame number */ BLF_size(fontid, 11.0f, U.dpi); - BLI_snprintf(str, sizeof(str), "%d", sc->user.framenr); + BLI_snprintf(numstr, sizeof(numstr), "%d", sc->user.framenr); - BLF_width_and_height(fontid, str, &font_dims[0], &font_dims[1]); + BLF_width_and_height(fontid, numstr, &font_dims[0], &font_dims[1]); glRecti(x, y, x + font_dims[0] + 6.0f, y + font_dims[1] + 4.0f); UI_ThemeColor(TH_TEXT); BLF_position(fontid, x+2.0f, y+2.0f, 0.0f); - BLF_draw(fontid, str, sizeof(str)); + BLF_draw(fontid, numstr, sizeof(numstr)); } static void draw_movieclip_cache(SpaceClip *sc, ARegion *ar, MovieClip *clip, Scene *scene) diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 41aae64445a..7517c0cd543 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -118,7 +118,7 @@ void file_draw_buttons(const bContext *C, ARegion *ar) const int separator = 4; /* Additional locals. */ - char name[32]; + char uiblockstr[32]; int loadbutton; int fnumbuttons; int min_x = 10; @@ -134,8 +134,8 @@ void file_draw_buttons(const bContext *C, ARegion *ar) ARegion* artmp; /* Initialize UI block. */ - sprintf(name, "win %p", (void *)ar); - block = uiBeginBlock(C, ar, name, UI_EMBOSS); + sprintf(uiblockstr, "win %p", (void *)ar); + block = uiBeginBlock(C, ar, uiblockstr, UI_EMBOSS); uiBlockSetHandleFunc(block, do_file_buttons, NULL); /* exception to make space for collapsed region icon */ @@ -450,7 +450,7 @@ void file_draw_list(const bContext *C, ARegion *ar) struct FileList* files = sfile->files; struct direntry *file; ImBuf *imb; - uiBlock *block = uiBeginBlock(C, ar, "FileNames", UI_EMBOSS); + uiBlock *block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); int numfiles; int numfiles_layout; int sx, sy; diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 288ff76d9ff..5b505004f49 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -970,7 +970,7 @@ int filelist_islibrary(struct FileList* filelist, char* dir, char* group) return BLO_is_a_library(filelist->dir, dir, group); } -static int groupname_to_code(char *group) +static int groupname_to_code(const char *group) { char buf[32]; char *lslash; diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 7091fe094c6..7bdb37d9651 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1003,7 +1003,7 @@ void graph_draw_channel_names(bContext *C, bAnimContext *ac, ARegion *ar) } } { /* second pass: widgets */ - uiBlock *block= uiBeginBlock(C, ar, "graph channel buttons", UI_EMBOSS); + uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y= (float)ACHANNEL_FIRST; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 8d8c79386c5..3aebc39bd0a 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -335,7 +335,7 @@ static void image_panel_preview(ScrArea *sa, short cntrl) // IMAGE_HANDLER_PREVI return; } - block= uiBeginBlock(C, ar, "image_panel_preview", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); uiSetPanelHandler(IMAGE_HANDLER_PREVIEW); // for close and esc diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index f5feaad12ac..09a8ebc8770 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -2999,7 +2999,7 @@ static uiBlock *sensor_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlock *block; int yco=0; - block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_sensor_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3048,7 +3048,7 @@ static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlock *block; int yco=0; - block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_controller_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3097,7 +3097,7 @@ static uiBlock *actuator_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlock *block; int xco=0; - block= uiBeginBlock(C, ar, "filemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_actuator_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -3143,7 +3143,7 @@ static uiBlock *controller_state_mask_menu(bContext *C, ARegion *ar, void *arg_c short yco = 12, xco = 0, stbit, offset; - block= uiBeginBlock(C, ar, "Controller state mask", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); /* use this for a fake extra empy space around the buttons */ uiDefBut(block, LABEL, 0, "", -5, -5, 200, 34, NULL, 0, 0, 0, 0, ""); @@ -3191,7 +3191,7 @@ static uiBlock *object_state_mask_menu(bContext *C, ARegion *ar, void *arg_obj) uiBlock *block; short xco = 0; - block= uiBeginBlock(C, ar, "obstatemenu", UI_EMBOSSP); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSSP); uiBlockSetButmFunc(block, do_object_state_menu, arg_obj); uiDefBut(block, BUTM, 1, "Set all bits", 0, (short)(xco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); @@ -4488,7 +4488,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) uiLayout *layout, *row, *box; uiBlock *block; uiBut *but; - char name[32]; + char uiblockstr[32]; short a, count; int xco, yco, width; @@ -4497,8 +4497,8 @@ static void logic_buttons_new(bContext *C, ARegion *ar) RNA_pointer_create(NULL, &RNA_SpaceLogicEditor, slogic, &logic_ptr); idar= get_selected_and_linked_obs(C, &count, slogic->scaflag); - sprintf(name, "buttonswin %p", (void *)ar); - block= uiBeginBlock(C, ar, name, UI_EMBOSS); + sprintf(uiblockstr, "buttonswin %p", (void *)ar); + block= uiBeginBlock(C, ar, uiblockstr, UI_EMBOSS); uiBlockSetHandleFunc(block, do_logic_buts, NULL); /* loop over all objects and set visible/linked flags for the logic bricks */ @@ -4802,7 +4802,7 @@ void logic_buttons(bContext *C, ARegion *ar) int a, iact, stbit, offset; int xco, yco, width, ycoo; short count; - char name[32]; + char numstr[32]; /* pin is a bool used for actuator and sensor drawing with states * pin so changing states dosnt hide the logic brick */ char pin; @@ -4815,8 +4815,8 @@ void logic_buttons(bContext *C, ARegion *ar) if(ob==NULL) return; // uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); - sprintf(name, "buttonswin %p", (void *)ar); - block= uiBeginBlock(C, ar, name, UI_EMBOSS); + sprintf(numstr, "buttonswin %p", (void *)ar); + block= uiBeginBlock(C, ar, numstr, UI_EMBOSS); uiBlockSetHandleFunc(block, do_logic_buts, NULL); RNA_pointer_create(NULL, &RNA_SpaceLogicEditor, slogic, &logic_ptr); @@ -4932,8 +4932,8 @@ void logic_buttons(bContext *C, ARegion *ar) uiDefIconButBitS(block, ICONTOG, CONT_SHOW, B_REDR, ICON_RIGHTARROW, (short)(xco+width-22), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Controller settings"); uiDefIconButBitS(block, TOG, CONT_PRIO, B_REDR, ICON_BOOKMARKS, (short)(xco+width-66), yco, 22, UI_UNIT_Y, &cont->flag, 0, 0, 0, 0, "Mark controller for execution before all non-marked controllers (good for startup scripts)"); - sprintf(name, "%d", first_bit(cont->state_mask)+1); - uiDefBlockBut(block, controller_state_mask_menu, cont, name, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)"); + sprintf(numstr, "%d", first_bit(cont->state_mask)+1); + uiDefBlockBut(block, controller_state_mask_menu, cont, numstr, (short)(xco+width-44), yco, 22, UI_UNIT_Y, "Set controller state index (from 1 to 30)"); if(cont->flag & CONT_SHOW) { cont->otype= cont->type; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 6af43e7618d..9f13fd7bbb2 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -958,7 +958,7 @@ void draw_nla_channel_list (bContext *C, bAnimContext *ac, ARegion *ar) draw_nla_channel_list_gl(ac, &anim_data, v2d, y); } { /* second pass: UI widgets */ - uiBlock *block= uiBeginBlock(C, ar, "NLA channel buttons", UI_EMBOSS); + uiBlock *block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); size_t channel_index = 0; y= (float)(-NLACHANNEL_HEIGHT(snla)); diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 285bac9c519..1f1eb9b7e00 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -132,7 +132,7 @@ static uiBlock *socket_component_menu(bContext *C, ARegion *ar, void *args_v) uiBlock *block; uiLayout *layout; - block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, NODE_DY, UI_GetStyle()), 0); @@ -1203,10 +1203,10 @@ static void node_composit_buts_image(uiLayout *layout, bContext *C, PointerRNA * /* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */ Scene *scene= CTX_data_scene(C); ImageUser *iuser= node->storage; - char tstr[32]; + char numstr[32]; const int framenr= BKE_image_user_get_frame(iuser, CFRA, 0); - BLI_snprintf(tstr, sizeof(tstr), "Frame: %d", framenr); - uiItemL(layout, tstr, ICON_NONE); + BLI_snprintf(numstr, sizeof(numstr), "Frame: %d", framenr); + uiItemL(layout, numstr, ICON_NONE); } if (ELEM(source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE)) { diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index da7f22b2030..ea9a8b1ef32 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -195,18 +195,18 @@ static void node_scaling_widget(int color_id, float aspect, float xmin, float ym static void node_uiblocks_init(const bContext *C, bNodeTree *ntree) { bNode *node; - char str[32]; + char uiblockstr[32]; /* add node uiBlocks in drawing order - prevents events going to overlapping nodes */ - for(node= ntree->nodes.first; node; node=node->next) { - /* ui block */ - sprintf(str, "node buttons %p", (void *)node); - node->block= uiBeginBlock(C, CTX_wm_region(C), str, UI_EMBOSS); - uiBlockSetHandleFunc(node->block, do_node_internal_buttons, node); - - /* this cancels events for background nodes */ - uiBlockSetFlag(node->block, UI_BLOCK_CLIP_EVENTS); + for (node= ntree->nodes.first; node; node= node->next) { + /* ui block */ + sprintf(uiblockstr, "node buttons %p", (void *)node); + node->block= uiBeginBlock(C, CTX_wm_region(C), uiblockstr, UI_EMBOSS); + uiBlockSetHandleFunc(node->block, do_node_internal_buttons, node); + + /* this cancels events for background nodes */ + uiBlockSetFlag(node->block, UI_BLOCK_CLIP_EVENTS); } } diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index f3bab197b3c..71cb83ad231 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1649,7 +1649,7 @@ void draw_outliner(const bContext *C) /* draw outliner stuff (background, hierachy lines and names) */ outliner_back(ar); - block= uiBeginBlock(C, ar, "outliner buttons", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); outliner_draw_tree((bContext *)C, block, scene, ar, soops); if(ELEM(soops->outlinevis, SO_DATABLOCKS, SO_USERDEF)) { diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 2b59a02deae..18c4b32398d 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -328,7 +328,7 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire float x1, x2, y1, y2; float handsize; float minhandle, maxhandle; - char str[32]; + char numstr[32]; unsigned int whichsel=0; x1= seq->startdisp; @@ -392,15 +392,15 @@ static void draw_seq_handle(View2D *v2d, Sequence *seq, float pixelx, short dire if(G.moving || (seq->flag & whichsel)) { const char col[4]= {255, 255, 255, 255}; if (direction == SEQ_LEFTHANDLE) { - sprintf(str, "%d", seq->startdisp); + sprintf(numstr, "%d", seq->startdisp); x1= rx1; y1 -= 0.45f; } else { - sprintf(str, "%d", seq->enddisp - 1); + sprintf(numstr, "%d", seq->enddisp - 1); x1= x2 - handsize*0.75f; y1= y2 + 0.05f; } - UI_view2d_text_cache_add(v2d, x1, y1, str, col); + UI_view2d_text_cache_add(v2d, x1, y1, numstr, col); } } diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 1784d949761..638bf5b41a7 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -218,23 +218,23 @@ void draw_motion_path_instance(Scene *scene, col[3]= 255; for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) { - char str[32]; + char numstr[32]; float co[3]; /* only draw framenum if several consecutive highlighted points don't occur on same point */ if (i == 0) { - sprintf(str, "%d", (i+sfra)); + sprintf(numstr, "%d", (i+sfra)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } else if ((i > stepsize) && (i < len-stepsize)) { bMotionPathVert *mpvP = (mpv - stepsize); bMotionPathVert *mpvN = (mpv + stepsize); if ((equals_v3v3(mpv->co, mpvP->co)==0) || (equals_v3v3(mpv->co, mpvN->co)==0)) { - sprintf(str, "%d", (sfra+i)); + sprintf(numstr, "%d", (sfra+i)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } } } @@ -293,11 +293,11 @@ void draw_motion_path_instance(Scene *scene, float mframe= (float)(sfra + i); if (BLI_dlrbTree_search_exact(&keys, compare_ak_cfraPtr, &mframe)) { - char str[32]; + char numstr[32]; - sprintf(str, "%d", (sfra+i)); + sprintf(numstr, "%d", (sfra+i)); mul_v3_m4v3(co, ob->imat, mpv->co); - view3d_cached_text_draw_add(co, str, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col); } } } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 7f54821c98d..0066e9d799a 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -2663,7 +2663,7 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet EditFace *efa; float v1[3], v2[3], v3[3], v4[3], vmid[3]; float fvec[3]; - char val[32]; /* Stores the measurement display text here */ + char numstr[32]; /* Stores the measurement display text here */ const char *conv_float; /* Use a float conversion matching the grid size */ unsigned char col[4]= {0, 0, 0, 255}; /* color of the text to draw */ float area; /* area of the face */ @@ -2696,11 +2696,11 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet mul_mat3_m4_v3(ob->obmat, v2); } if(unit->system) - bUnit_AsString(val, sizeof(val), len_v3v3(v1, v2)*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); + bUnit_AsString(numstr, sizeof(numstr), len_v3v3(v1, v2)*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); else - sprintf(val, conv_float, len_v3v3(v1, v2)); + sprintf(numstr, conv_float, len_v3v3(v1, v2)); - view3d_cached_text_draw_add(vmid, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(vmid, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2730,11 +2730,11 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet area = area_tri_v3(v1, v2, v3); if(unit->system) - bUnit_AsString(val, sizeof(val), area*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); // XXX should be B_UNIT_AREA + bUnit_AsString(numstr, sizeof(numstr), area*unit->scale_length, 3, unit->system, B_UNIT_LENGTH, do_split, FALSE); // XXX should be B_UNIT_AREA else - sprintf(val, conv_float, area); + sprintf(numstr, conv_float, area); - view3d_cached_text_draw_add(efa->cent, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(efa->cent, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2768,31 +2768,31 @@ static void draw_em_measure_stats(View3D *v3d, Object *ob, EditMesh *em, UnitSet if( (e4->f & e1->f & SELECT) || (do_moving && (efa->v1->f & SELECT)) ) { /* Vec 1 */ - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v4, v1, v2))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v4, v1, v2))); interp_v3_v3v3(fvec, efa->cent, efa->v1->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } if( (e1->f & e2->f & SELECT) || (do_moving && (efa->v2->f & SELECT)) ) { /* Vec 2 */ - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v1, v2, v3))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v1, v2, v3))); interp_v3_v3v3(fvec, efa->cent, efa->v2->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } if( (e2->f & e3->f & SELECT) || (do_moving && (efa->v3->f & SELECT)) ) { /* Vec 3 */ if(efa->v4) - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v4))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v4))); else - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v1))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v2, v3, v1))); interp_v3_v3v3(fvec, efa->cent, efa->v3->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } /* Vec 4 */ if(efa->v4) { if( (e3->f & e4->f & SELECT) || (do_moving && (efa->v4->f & SELECT)) ) { - sprintf(val,"%.3g", RAD2DEGF(angle_v3v3v3(v3, v4, v1))); + sprintf(numstr,"%.3g", RAD2DEGF(angle_v3v3v3(v3, v4, v1))); interp_v3_v3v3(fvec, efa->cent, efa->v4->co, 0.8f); - view3d_cached_text_draw_add(fvec, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(fvec, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2805,7 +2805,7 @@ static void draw_em_indices(EditMesh *em) EditFace *f; EditVert *v; int i; - char val[32]; + char numstr[32]; float pos[3]; unsigned char col[4]; @@ -2815,8 +2815,8 @@ static void draw_em_indices(EditMesh *em) UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEANG, col); for (v = em->verts.first, i = 0; v; v = v->next, i++) { if (v->f & SELECT) { - sprintf(val, "%d", i); - view3d_cached_text_draw_add(v->co, val, 0, V3D_CACHE_TEXT_ASCII, col); + sprintf(numstr, "%d", i); + view3d_cached_text_draw_add(v->co, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2825,9 +2825,9 @@ static void draw_em_indices(EditMesh *em) UI_GetThemeColor3ubv(TH_DRAWEXTRA_EDGELEN, col); for (e = em->edges.first, i = 0; e; e = e->next, i++) { if (e->f & SELECT) { - sprintf(val, "%d", i); + sprintf(numstr, "%d", i); mid_v3_v3v3(pos, e->v1->co, e->v2->co); - view3d_cached_text_draw_add(pos, val, 0, V3D_CACHE_TEXT_ASCII, col); + view3d_cached_text_draw_add(pos, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -2836,8 +2836,8 @@ static void draw_em_indices(EditMesh *em) UI_GetThemeColor3ubv(TH_DRAWEXTRA_FACEAREA, col); for (f = em->faces.first, i = 0; f; f = f->next, i++) { if (f->f & SELECT) { - sprintf(val, "%d", i); - view3d_cached_text_draw_add(f->cent, val, 0, V3D_CACHE_TEXT_ASCII, col); + sprintf(numstr, "%d", i); + view3d_cached_text_draw_add(f->cent, numstr, 0, V3D_CACHE_TEXT_ASCII, col); } } } @@ -4042,7 +4042,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv int a, totpart, totpoint=0, totve=0, drawn, draw_as, totchild=0; int select=ob->flag&SELECT, create_cdata=0, need_v=0; GLint polygonmode[2]; - char val[32]; + char numstr[32]; unsigned char tcol[4]= {0, 0, 0, 255}; /* 1. */ @@ -4430,8 +4430,8 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if((part->draw & PART_DRAW_NUM || part->draw & PART_DRAW_HEALTH) && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0){ float vec_txt[3]; - char *val_pos= val; - val[0]= '\0'; + char *val_pos= numstr; + numstr[0]= '\0'; if(part->draw&PART_DRAW_NUM) { if(a < totpart && (part->draw & PART_DRAW_HEALTH) && (part->phystype==PART_PHYS_BOIDS)) { @@ -4450,7 +4450,7 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv /* in path drawing state.co is the end point */ /* use worldspace beause object matrix is already applied */ mul_v3_m4v3(vec_txt, ob->imat, state.co); - view3d_cached_text_draw_add(vec_txt, val, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); + view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); } } } @@ -4539,10 +4539,10 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv for(a=0, pa=psys->particles; aimat, cache[a]->co); - view3d_cached_text_draw_add(vec_txt, val, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); + view3d_cached_text_draw_add(vec_txt, numstr, 10, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, tcol); } } } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 1b923c7a0cd..3353030e29f 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1334,7 +1334,7 @@ static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3 View3D *v3d= sa->spacedata.first; int ofsx, ofsy; - block= uiBeginBlock(C, ar, "view3d_panel_preview", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl); uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 3b355177852..0f08c1984ab 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2890,14 +2890,14 @@ static void view3d_main_area_draw_info(const bContext *C, ARegion *ar, const cha draw_viewport_name(ar, v3d); } if (grid_unit) { /* draw below the viewport name */ - char tstr[32]= ""; + char numstr[32]= ""; UI_ThemeColor(TH_TEXT_HI); if(v3d->grid != 1.0f) { - BLI_snprintf(tstr, sizeof(tstr), "%s x %.4g", grid_unit, v3d->grid); + BLI_snprintf(numstr, sizeof(numstr), "%s x %.4g", grid_unit, v3d->grid); } - BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, tstr[0]?tstr : grid_unit, sizeof(tstr)); /* XXX, use real length */ + BLF_draw_default_ascii(22, ar->winy-(USER_SHOW_VIEWPORTNAME?40:20), 0.0f, numstr[0]?numstr : grid_unit, sizeof(numstr)); /* XXX, use real length */ } } diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 03e169a9512..9fb0dd1ae07 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -167,7 +167,7 @@ void GPU_shader_uniform_vector(GPUShader *shader, int location, int length, int arraysize, float *value); void GPU_shader_uniform_texture(GPUShader *shader, int location, GPUTexture *tex); -int GPU_shader_get_attribute(GPUShader *shader, char *name); +int GPU_shader_get_attribute(GPUShader *shader, const char *name); /* Vertex attributes for shaders */ diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index c4ed88635b7..cc486b75245 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -1156,7 +1156,7 @@ void GPU_shader_uniform_texture(GPUShader *UNUSED(shader), int location, GPUText GPU_print_error("Post Uniform Texture"); } -int GPU_shader_get_attribute(GPUShader *shader, char *name) +int GPU_shader_get_attribute(GPUShader *shader, const char *name) { int index; diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 2ab876b2165..2a28a7edfe8 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -939,7 +939,7 @@ static uiBlock *wm_block_create_redo(bContext *C, ARegion *ar, void *arg_op) int width= 300; - block= uiBeginBlock(C, ar, "redo_popup", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); @@ -1015,7 +1015,7 @@ static uiBlock *wm_block_dialog_create(bContext *C, ARegion *ar, void *userData) uiLayout *layout; uiStyle *style= UI_GetStyle(); - block = uiBeginBlock(C, ar, "operator dialog", UI_EMBOSS); + block = uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); @@ -1056,7 +1056,7 @@ static uiBlock *wm_operator_ui_create(bContext *C, ARegion *ar, void *userData) uiLayout *layout; uiStyle *style= UI_GetStyle(); - block= uiBeginBlock(C, ar, "opui_popup", UI_EMBOSS); + block= uiBeginBlock(C, ar, __func__, UI_EMBOSS); uiBlockClearFlag(block, UI_BLOCK_LOOP); uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN|UI_BLOCK_RET_1|UI_BLOCK_MOVEMOUSE_QUIT); -- cgit v1.2.3