Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-23 16:57:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-23 16:57:03 +0400
commitd6d2f09dd9e4df0a3e1168b2fbd3dcf2f9bd8e27 (patch)
tree1a6e80812e585fbe4bfcf86e453fc0bf566e1b0e
parent7f56023e9bd95e8817556e0c6ae317434a1bee5a (diff)
quiet some clang warnings & fix for bugs in exceptional cases.
- ghost C api, BLI_get_folder_version() could assign garbage values. - pointcache ptcache_find_frames_around() had a superfluous NULL check which would have crashed anyway if actually NULL.
-rw-r--r--intern/ghost/intern/GHOST_C-api.cpp4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c6
-rw-r--r--source/blender/blenlib/intern/path_util.c2
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c4
-rw-r--r--source/blender/editors/interface/interface.c2
-rw-r--r--source/blender/editors/interface/interface_regions.c1
-rw-r--r--source/blender/editors/space_image/image_draw.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_header.c2
8 files changed, 16 insertions, 7 deletions
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp
index 28058c60499..a1e1bafa82f 100644
--- a/intern/ghost/intern/GHOST_C-api.cpp
+++ b/intern/ghost/intern/GHOST_C-api.cpp
@@ -403,7 +403,7 @@ GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle,
{
GHOST_ISystem* system = (GHOST_ISystem*) systemhandle;
GHOST_TSuccess result;
- bool isdown;
+ bool isdown= false;
result = system->getModifierKeyState(mask, isdown);
*isDown = (int) isdown;
@@ -419,7 +419,7 @@ GHOST_TSuccess GHOST_GetButtonState(GHOST_SystemHandle systemhandle,
{
GHOST_ISystem* system = (GHOST_ISystem*) systemhandle;
GHOST_TSuccess result;
- bool isdown;
+ bool isdown= false;
result = system->getButtonState(mask, isdown);
*isDown = (int) isdown;
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index a8c7266b3fa..179aab064b4 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -1373,11 +1373,13 @@ static void ptcache_find_frames_around(PTCacheID *pid, unsigned int frame, int *
while(pm->next && pm->next->frame < frame)
pm= pm->next;
- if(pm2 && pm2->frame < frame)
+ if(pm2->frame < frame) {
pm2 = NULL;
+ }
else {
- while(pm2->prev && pm2->prev->frame > frame)
+ while(pm2->prev && pm2->prev->frame > frame) {
pm2= pm2->prev;
+ }
}
if(pm && !pm2) {
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 73d6588b97f..1a47a93ab51 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1144,6 +1144,8 @@ char *BLI_get_folder_version(const int id, const int ver, const int do_check)
ok= get_path_system(path, NULL, NULL, NULL, ver);
break;
default:
+ path[0]= '\0'; /* incase do_check is false */
+ ok= FALSE;
BLI_assert(!"incorrect ID");
}
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 383e35a5760..3374b3c6f95 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3224,7 +3224,7 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b
{
bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale);
View2D *v2d= &ac->ar->v2d;
- float y, ymid, ytext;
+ float y, ymid /*, ytext*/;
short offset;
/* sanity checks - don't draw anything */
@@ -3243,7 +3243,7 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b
y= (ymaxc - yminc)/2 + yminc;
ymid= y - 7;
/* y-coordinates for text is only 4 down from middle */
- ytext= y - 4;
+ /* ytext= y - 4; */
/* no button backdrop behind icons */
uiBlockSetEmboss(block, UI_EMBOSSN);
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index b07baf45d23..108f06a5cb6 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -2093,6 +2093,8 @@ void ui_check_but(uiBut *but)
str= strcat(str, "Alt ");
if(but->modifier_key & KM_OSKEY)
str= strcat(str, "Cmd ");
+
+ (void)str; /* UNUSED */
}
else
strcat(but->drawstr, "Press a key ");
diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c
index 4457ec6b323..1a240f34757 100644
--- a/source/blender/editors/interface/interface_regions.c
+++ b/source/blender/editors/interface/interface_regions.c
@@ -2326,6 +2326,7 @@ static void confirm_operator(bContext *C, wmOperator *op, const char *title, con
s= buf;
if (title) s+= sprintf(s, "%s%%t|%s", title, item);
+ (void)s;
handle= ui_popup_menu_create(C, NULL, NULL, NULL, NULL, buf);
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index b866a21d027..0f361b43de6 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -332,6 +332,8 @@ void draw_image_info(ARegion *ar, int color_manage, int channels, int x, int y,
BLF_draw_ascii(blf_mono_font, str, sizeof(str));
dx += BLF_width(blf_mono_font, str);
}
+
+ (void)dx;
}
/* image drawing */
diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c
index 445d2f434fa..939c44a0514 100644
--- a/source/blender/editors/space_view3d/view3d_header.c
+++ b/source/blender/editors/space_view3d/view3d_header.c
@@ -313,7 +313,7 @@ static char *view3d_modeselect_pup(Scene *scene)
if (ob->particlesystem.first || modifiers_findByType(ob, eModifierType_Cloth) || modifiers_findByType(ob, eModifierType_Softbody)) {
str += sprintf(str, formatstr, "Particle Mode", OB_MODE_PARTICLE_EDIT, ICON_PARTICLEMODE);
}
-
+ (void)str;
return (string);
}