From 59f1640ae5f53e2360fec2634fdc7d2ec85e2989 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 13 Feb 2011 15:02:21 +0000 Subject: [PATCH] warning cleanup. - fix mistake with grease pencil UI (&& was intended but & used). - use (void) rather then () across _all_ blenders code. - a few minor edits, don't shadow stack variables in roll calculation & avoid running memset() for VBO vertex map. --- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenkernel/intern/suggestions.c | 2 +- source/blender/blenlib/intern/threads.c | 2 +- source/blender/editors/armature/editarmature.c | 4 +--- source/blender/editors/armature/reeb.c | 2 +- source/blender/editors/gpencil/gpencil_buttons.c | 2 +- source/blender/editors/interface/interface.c | 6 +++--- source/blender/editors/interface/interface_icons.c | 2 +- source/blender/editors/screen/glutil.c | 2 +- source/blender/editors/space_file/filelist.c | 2 +- source/blender/editors/space_file/filesel.c | 2 +- source/blender/editors/space_text/text_python.c | 2 +- .../blender/editors/uvedit/uvedit_parametrizer.c | 2 +- source/blender/gpu/intern/gpu_buffers.c | 4 ++-- source/blender/gpu/intern/gpu_extensions.c | 14 +++++++------- source/blender/imbuf/intern/allocimbuf.c | 2 +- source/blender/imbuf/intern/thumbs.c | 2 +- source/blender/makesrna/intern/makesrna.c | 2 +- source/blender/makesrna/intern/rna_access.c | 4 ++-- source/blender/makesrna/intern/rna_define.c | 2 +- source/blender/makesrna/intern/rna_render.c | 4 ++-- source/blender/windowmanager/intern/wm_window.c | 4 ++-- 22 files changed, 34 insertions(+), 36 deletions(-) diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 69699c85203..c2ec463c708 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2390,7 +2390,7 @@ void BKE_ptcache_set_continue_physics(Main *bmain, Scene *scene, int enable) } } -int BKE_ptcache_get_continue_physics() +int BKE_ptcache_get_continue_physics(void) { return CONTINUE_PHYSICS; } diff --git a/source/blender/blenkernel/intern/suggestions.c b/source/blender/blenkernel/intern/suggestions.c index b506ac55371..7ec6d84d285 100644 --- a/source/blender/blenkernel/intern/suggestions.c +++ b/source/blender/blenkernel/intern/suggestions.c @@ -88,7 +88,7 @@ void texttool_text_set_active(Text *text) { activeToolText = text; } -void texttool_text_clear() { +void texttool_text_clear(void) { free_texttools(); activeToolText = NULL; } diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index eb2057220fe..3d06f157780 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -520,7 +520,7 @@ struct ThreadQueue { int nowait; }; -ThreadQueue *BLI_thread_queue_init() +ThreadQueue *BLI_thread_queue_init(void) { ThreadQueue *queue; diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 689c792d859..94c1edd90d5 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -2198,10 +2198,8 @@ static int armature_calc_roll_exec(bContext *C, wmOperator *op) mul_m3_v3(imat, vec); } else if (type==5) { - bArmature *arm= ob->data; - EditBone *ebone= (EditBone *)arm->act_edbone; float mat[3][3], nor[3]; - + ebone= (EditBone *)arm->act_edbone; if(ebone==NULL) { BKE_report(op->reports, RPT_ERROR, "No active bone set"); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 29ba72ce604..38e23a3d456 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -205,7 +205,7 @@ void REEB_freeGraph(ReebGraph *rg) MEM_freeN(rg); } -ReebGraph * newReebGraph() +ReebGraph * newReebGraph(void) { ReebGraph *rg; rg = MEM_callocN(sizeof(ReebGraph), "reeb graph"); diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 96bc4259661..7590b2558f0 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -141,7 +141,7 @@ static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl) uiItemL(subrow, name, ICON_NULL); /* delete button (only if hidden but not locked!) */ - if ((gpl->flag & GP_LAYER_HIDE) & !(gpl->flag & GP_LAYER_LOCKED)) { + if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) { /* right-align ............................... */ subrow= uiLayoutRow(row, 1); uiLayoutSetAlignment(subrow, UI_LAYOUT_ALIGN_RIGHT); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index bfa9f17a4fb..cb7c8c34f1c 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -80,17 +80,17 @@ static void ui_free_but(const bContext *C, uiBut *but); /* ************* translation ************** */ -int ui_translate_buttons() +int ui_translate_buttons(void) { return (U.transopts & USER_TR_BUTTONS); } -int ui_translate_menus() +int ui_translate_menus(void) { return (U.transopts & USER_TR_MENUS); } -int ui_translate_tooltips() +int ui_translate_tooltips(void) { return (U.transopts & USER_TR_TOOLTIPS); } diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 32b27874cb4..5ea74cbf40a 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -705,7 +705,7 @@ ListBase *UI_iconfile_list(void) } -void UI_icons_free() +void UI_icons_free(void) { if(icongltex.id) { glDeleteTextures(1, &icongltex.id); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 9b3a51805e9..a39039b254f 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -765,7 +765,7 @@ void bglBegin(int mode) } } -int bglPointHack() { +int bglPointHack(void) { float value[4]; int pointhack_px; glGetFloatv(GL_POINT_SIZE_RANGE, value); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index d9954b584f5..b92b95e2efd 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -395,7 +395,7 @@ void filelist_free_icons(void) } //-----------------FOLDERLIST (previous/next) --------------// -struct ListBase* folderlist_new() +struct ListBase* folderlist_new(void) { ListBase* p = MEM_callocN( sizeof(ListBase), "folderlist" ); return p; diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 6453b527770..9092e639542 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -347,7 +347,7 @@ float file_string_width(const char* str) return BLF_width(style->widget.uifont_id, str); } -float file_font_pointsize() +float file_font_pointsize(void) { #if 0 float s; diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index 1c75e6f65ca..e6f201e4147 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -98,7 +98,7 @@ int text_do_suggest_select(SpaceText *st, ARegion *ar) return 1; } -void text_pop_suggest_list() +void text_pop_suggest_list(void) { SuggItem *item, *sel; int *top, i; diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index dc5e17b5fae..981332c8fbf 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -4042,7 +4042,7 @@ static void p_smooth(PChart *chart) /* Exported */ -ParamHandle *param_construct_begin() +ParamHandle *param_construct_begin(void) { PHandle *handle = MEM_callocN(sizeof*handle, "PHandle"); handle->construction_chart = p_chart_new(handle); diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 0a419af5b06..53e3ad09a6f 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -65,7 +65,7 @@ static GPUBufferPool *globalPool = 0; static int GLStates = 0; static GPUAttrib attribData[MAX_GPU_ATTRIB_DATA] = { { -1, 0, 0 } }; -GPUBufferPool *GPU_buffer_pool_new() +GPUBufferPool *GPU_buffer_pool_new(void) { GPUBufferPool *pool; @@ -1514,7 +1514,7 @@ void GPU_interleaved_attrib_setup( GPUBuffer *buffer, GPUAttrib data[], int numd } -void GPU_buffer_unbind() +void GPU_buffer_unbind(void) { int i; DEBUG_VBO("GPU_buffer_unbind\n"); diff --git a/source/blender/gpu/intern/gpu_extensions.c b/source/blender/gpu/intern/gpu_extensions.c index bff4287bd75..c0c3cc128af 100644 --- a/source/blender/gpu/intern/gpu_extensions.c +++ b/source/blender/gpu/intern/gpu_extensions.c @@ -82,12 +82,12 @@ int GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver) /* GPU Extensions */ -void GPU_extensions_disable() +void GPU_extensions_disable(void) { GG.extdisabled = 1; } -void GPU_extensions_init() +void GPU_extensions_init(void) { GLint r, g, b; const char *vendor, *renderer; @@ -183,12 +183,12 @@ void GPU_extensions_init() #endif } -int GPU_glsl_support() +int GPU_glsl_support(void) { return !GG.extdisabled && GG.glslsupport; } -int GPU_non_power_of_two_support() +int GPU_non_power_of_two_support(void) { /* Exception for buggy ATI/Apple driver in Mac OS X 10.5/10.6, * they claim to support this but can cause system freeze */ @@ -201,7 +201,7 @@ int GPU_non_power_of_two_support() return GLEW_ARB_texture_non_power_of_two; } -int GPU_color_depth() +int GPU_color_depth(void) { return GG.colordepth; } @@ -680,7 +680,7 @@ struct GPUFrameBuffer { GPUTexture *depthtex; }; -GPUFrameBuffer *GPU_framebuffer_create() +GPUFrameBuffer *GPU_framebuffer_create(void) { GPUFrameBuffer *fb; @@ -825,7 +825,7 @@ void GPU_framebuffer_free(GPUFrameBuffer *fb) MEM_freeN(fb); } -void GPU_framebuffer_restore() +void GPU_framebuffer_restore(void) { if (GG.currentfb != 0) { glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0); diff --git a/source/blender/imbuf/intern/allocimbuf.c b/source/blender/imbuf/intern/allocimbuf.c index 32284472163..99b3c3a58d6 100644 --- a/source/blender/imbuf/intern/allocimbuf.c +++ b/source/blender/imbuf/intern/allocimbuf.c @@ -458,7 +458,7 @@ static MEM_CacheLimiterC **get_imbuf_cache_limiter(void) return &c; } -void IMB_free_cache_limiter() +void IMB_free_cache_limiter(void) { delete_MEM_CacheLimiter(*get_imbuf_cache_limiter()); *get_imbuf_cache_limiter() = 0; diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index a6eb319ccd9..c0fd6584d6f 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -228,7 +228,7 @@ static int thumbpath_from_uri(const char* uri, char* path, const int path_len, T return rv; } -void IMB_thumb_makedirs() +void IMB_thumb_makedirs(void) { char tpath[FILE_MAX]; if (get_thumb_dir(tpath, THB_NORMAL)) { diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 4588d0c36c5..227b6327d64 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1679,7 +1679,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA dfunc->gencall= funcname; } -static void rna_auto_types() +static void rna_auto_types(void) { StructDefRNA *ds; PropertyDefRNA *dp; diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 2a3fb11acc5..8e24f9724d6 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -61,7 +61,7 @@ const PointerRNA PointerRNA_NULL= {{0}}; /* Init/Exit */ -void RNA_init() +void RNA_init(void) { StructRNA *srna; PropertyRNA *prop; @@ -77,7 +77,7 @@ void RNA_init() } } -void RNA_exit() +void RNA_exit(void) { StructRNA *srna; diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 454ed7cee71..975858099c5 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -412,7 +412,7 @@ static int rna_validate_identifier(const char *identifier, char *error, int prop /* Blender Data Definition */ -BlenderRNA *RNA_create() +BlenderRNA *RNA_create(void) { BlenderRNA *brna; diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c index 3d97e38e3a4..b889d0082f8 100644 --- a/source/blender/makesrna/intern/rna_render.c +++ b/source/blender/makesrna/intern/rna_render.c @@ -54,7 +54,7 @@ static RenderEngineType internal_game_type = { ListBase R_engines = {NULL, NULL}; -void RE_engines_init() +void RE_engines_init(void) { BLI_addtail(&R_engines, &internal_render_type); #ifdef WITH_GAMEENGINE @@ -62,7 +62,7 @@ void RE_engines_init() #endif } -void RE_engines_exit() +void RE_engines_exit(void) { RenderEngineType *type, *next; diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 8bd0af23b48..1022cff5062 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1155,12 +1155,12 @@ void WM_setprefsize(int stax, int stay, int sizx, int sizy) } /* for borderless and border windows set from command-line */ -void WM_setinitialstate_fullscreen() +void WM_setinitialstate_fullscreen(void) { initialstate= GHOST_kWindowStateFullScreen; } -void WM_setinitialstate_normal() +void WM_setinitialstate_normal(void) { initialstate= GHOST_kWindowStateNormal; }