From b07c5f20962420095c2b25f2bbfdc9477ff15f22 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Fri, 16 Jul 2004 14:45:06 +0000 Subject: [PATCH] Bunch of small fixes for warnings and whatnot.... intern/SoundSystem/intern/SND_AudioDevice.cpp Initalized a var that could fall through with no value. source/blender/readblenfile/intern/BLO_readblenfile.c source/blender/src/space.c intern/SoundSystem/intern/SND_Scene.cpp source/gameengine/Converter/BL_MeshDeformer.cpp removed unused var's intern/SoundSystem/openal/pthread_cancel.cpp fixed a nested /* source/blender/imbuf/IMB_imbuf.h added static to the type returned for addzbufImBuf source/blender/imbuf/intern/IMB_bmp.h had a wrong prototype source/blender/src/view.c added newline at end of file. source/blender/src/sequence.c removed unused var added #include to avoid: warning: implicit declaration of function `abs' initalized a var that could have been used without being set. Kent --- intern/SoundSystem/intern/SND_AudioDevice.cpp | 3 +-- intern/SoundSystem/intern/SND_Scene.cpp | 2 -- intern/SoundSystem/openal/pthread_cancel.cpp | 2 +- source/blender/imbuf/IMB_imbuf.h | 2 +- source/blender/imbuf/intern/IMB_bmp.h | 2 +- source/blender/readblenfile/intern/BLO_readblenfile.c | 1 - source/blender/src/sequence.c | 5 +++-- source/blender/src/space.c | 1 - source/blender/src/view.c | 3 ++- source/gameengine/Converter/BL_MeshDeformer.cpp | 1 - 10 files changed, 9 insertions(+), 13 deletions(-) diff --git a/intern/SoundSystem/intern/SND_AudioDevice.cpp b/intern/SoundSystem/intern/SND_AudioDevice.cpp index 3fd8334d506..9cb2202425c 100644 --- a/intern/SoundSystem/intern/SND_AudioDevice.cpp +++ b/intern/SoundSystem/intern/SND_AudioDevice.cpp @@ -97,14 +97,13 @@ bool SND_AudioDevice::GetNewId(SND_SoundObject* pObject) printf("SND_AudioDevice::GetNewId\n"); #endif - bool result; + bool result = false; // first, get the oldest (the first) idobject SND_IdObject* pIdObject = (SND_IdObject*)m_idObjectList.getHead(); if (pIdObject->isTail()) { - result = false; } else { diff --git a/intern/SoundSystem/intern/SND_Scene.cpp b/intern/SoundSystem/intern/SND_Scene.cpp index 5d26b41469e..ffb1cd44108 100644 --- a/intern/SoundSystem/intern/SND_Scene.cpp +++ b/intern/SoundSystem/intern/SND_Scene.cpp @@ -307,7 +307,6 @@ void SND_Scene::UpdateActiveObects() if (id >= 0) { - bool juststartedplaying = false; #ifdef USE_FMOD // fmod wants these set before playing the sample if (pObject->IsModified()) @@ -323,7 +322,6 @@ void SND_Scene::UpdateActiveObects() pObject->SetPlaystate(SND_PLAYING); pObject->InitRunning(); // printf("start play: %d\n", tijd); - juststartedplaying = true; } #endif if (pObject->Is3D()) diff --git a/intern/SoundSystem/openal/pthread_cancel.cpp b/intern/SoundSystem/openal/pthread_cancel.cpp index c46c1f2c453..7651417db0b 100644 --- a/intern/SoundSystem/openal/pthread_cancel.cpp +++ b/intern/SoundSystem/openal/pthread_cancel.cpp @@ -1,5 +1,5 @@ /* $Id$ -/* + * * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h index 7f7b2b08a56..b5b97034769 100644 --- a/source/blender/imbuf/IMB_imbuf.h +++ b/source/blender/imbuf/IMB_imbuf.h @@ -184,7 +184,7 @@ struct ImBuf *IMB_dupImBuf(struct ImBuf *ibuf1); * * @attention Defined in allocimbuf.c */ -short addzbufImBuf(struct ImBuf * ibuf); +static short addzbufImBuf(struct ImBuf * ibuf); /** * diff --git a/source/blender/imbuf/intern/IMB_bmp.h b/source/blender/imbuf/intern/IMB_bmp.h index b0fde577b00..d220c564652 100644 --- a/source/blender/imbuf/intern/IMB_bmp.h +++ b/source/blender/imbuf/intern/IMB_bmp.h @@ -44,7 +44,7 @@ struct ImBuf; int imb_is_a_bmp(void *buf); struct ImBuf *imb_bmp_decode(unsigned char *mem, int size, int flags); -int bmp_savebmp(struct ImBuf *ibuf, int file, int flags); +short imb_savebmp(struct ImBuf *ibuf, int outfile, int flags); #endif diff --git a/source/blender/readblenfile/intern/BLO_readblenfile.c b/source/blender/readblenfile/intern/BLO_readblenfile.c index 7fdad840895..9b81b3bdd0d 100644 --- a/source/blender/readblenfile/intern/BLO_readblenfile.c +++ b/source/blender/readblenfile/intern/BLO_readblenfile.c @@ -136,7 +136,6 @@ blo_read_runtime( BlendReadError *error_r) { BlendFileData *bfd= NULL; - void *filedata= NULL; int fd, actualsize, datastart; char buf[8]; diff --git a/source/blender/src/sequence.c b/source/blender/src/sequence.c index 3ff185626a0..24822cb268f 100644 --- a/source/blender/src/sequence.c +++ b/source/blender/src/sequence.c @@ -32,6 +32,7 @@ #include #include +#include #ifdef HAVE_CONFIG_H #include @@ -989,7 +990,7 @@ float check_zone(int x, int y, int xo, int yo, Sequence *seq, float facf0) { /*some future stuff float hyp3,hyp4,b4,b5 */ - float temp1,temp2,temp3,temp4,hold; //some placeholder variables + float temp1,temp2,temp3,temp4; //some placeholder variables float halfx = xo/2; float halfy = yo/2; float widthf,output=0; @@ -1293,7 +1294,7 @@ void RVBlurBitmap2 ( unsigned char* map, int width,int height,float blur, float *filter=NULL; int x,y,i,fx,fy; int index, ix, halfWidth; - float fval, k, weight, curColor[3], curColor2[3]; + float fval, k, curColor[3], curColor2[3], weight=0; /* If we're not really blurring, bail out */ if (blur<=0) diff --git a/source/blender/src/space.c b/source/blender/src/space.c index 467c84d649c..d80f892f1fe 100644 --- a/source/blender/src/space.c +++ b/source/blender/src/space.c @@ -270,7 +270,6 @@ void copy_view3d_lock(short val) void handle_view3d_around() { bScreen *sc; - int bit; if ((U.uiflag & USER_LOCKAROUND)==0) return; diff --git a/source/blender/src/view.c b/source/blender/src/view.c index 9d876712567..6e3c1652536 100644 --- a/source/blender/src/view.c +++ b/source/blender/src/view.c @@ -1145,4 +1145,5 @@ void view3d_align_axis_to_vector(View3D *v3d, int axisidx, float vec[3]) v3d->view= 0; if (v3d->persp>=2) v3d->persp= 0; /* switch out of camera mode */ -} \ No newline at end of file +} + diff --git a/source/gameengine/Converter/BL_MeshDeformer.cpp b/source/gameengine/Converter/BL_MeshDeformer.cpp index f7df35af21d..7a469c668eb 100644 --- a/source/gameengine/Converter/BL_MeshDeformer.cpp +++ b/source/gameengine/Converter/BL_MeshDeformer.cpp @@ -58,7 +58,6 @@ bool BL_MeshDeformer::Apply(RAS_IPolyMaterial *mat) vecVertexArray array; vecIndexArrays mvarray; vecIndexArrays diarray; - float co[3]; RAS_TexVert *tv; MVert *mvert;