[Scummvm-cvs-logs] SF.net SVN: scummvm:[42009] scummvm/trunk

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Wed Jul 1 22:51:04 CEST 2009


Revision: 42009
          http://scummvm.svn.sourceforge.net/scummvm/?rev=42009&view=rev
Author:   fingolfin
Date:     2009-07-01 20:51:04 +0000 (Wed, 01 Jul 2009)

Log Message:
-----------
- Added GCC_PRINTF attribute to several funcs where it makes sense
- change some constants from double to float, to avoid "loss of precision due to implicit conversion" warnings
- removed duplicate prototypes for some funcs
- fixed some "increases required alignment of target type" warnings

Modified Paths:
--------------
    scummvm/trunk/Makefile
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agos/agos.h
    scummvm/trunk/engines/agos/vga_ff.cpp
    scummvm/trunk/engines/cine/texte.cpp
    scummvm/trunk/engines/cine/various.h
    scummvm/trunk/engines/cruise/cruise_main.h
    scummvm/trunk/engines/igor/igor.cpp
    scummvm/trunk/engines/igor/staticres.cpp
    scummvm/trunk/engines/kyra/gui.h
    scummvm/trunk/engines/sci/gfx/operations.cpp
    scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
    scummvm/trunk/engines/scumm/boxes.cpp
    scummvm/trunk/engines/scumm/gfx.cpp
    scummvm/trunk/engines/sword2/screen.h
    scummvm/trunk/engines/tinsel/actors.h
    scummvm/trunk/engines/tinsel/pdisplay.cpp
    scummvm/trunk/engines/tinsel/polygons.h
    scummvm/trunk/engines/tinsel/tinlib.cpp
    scummvm/trunk/engines/tinsel/tinsel.cpp
    scummvm/trunk/gui/debugger.cpp
    scummvm/trunk/sound/softsynth/mt32/partial.cpp
    scummvm/trunk/sound/softsynth/mt32/synth.cpp
    scummvm/trunk/sound/softsynth/mt32/synth.h
    scummvm/trunk/sound/softsynth/mt32/tables.cpp
    scummvm/trunk/sound/vorbis.cpp

Modified: scummvm/trunk/Makefile
===================================================================
--- scummvm/trunk/Makefile	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/Makefile	2009-07-01 20:51:04 UTC (rev 42009)
@@ -26,6 +26,13 @@
 # Enable even more warnings...
 CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wcast-align
 CXXFLAGS+= -Wshadow -Wimplicit -Wnon-virtual-dtor -Wwrite-strings
+# TODO: Consider using -Wold-style-cast at some point
+# CXXFLAGS+= -Wno-sign-compare
+#CXXFLAGS+= -Wextra
+CXXFLAGS+= -Wmissing-format-attribute
+CXXFLAGS+= -Wredundant-decls
+CXXFLAGS+= -Wconversion
+#CXXFLAGS+= -Wshorten-64-to-32
 
 # Disable RTTI and exceptions, and enabled checking of pointers returned by "new"
 CXXFLAGS+= -fno-rtti -fno-exceptions -fcheck-new

Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/agi/agi.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -993,7 +993,7 @@
 	bool predictiveDialog(void);
 
 private:
-	void printStatus(const char *message, ...);
+	void printStatus(const char *message, ...) GCC_PRINTF(2, 3);
 	void printText2(int l, const char *msg, int foff, int xoff, int yoff, int len, int fg, int bg, bool checkerboard = false);
 	void blitTextbox(const char *p, int y, int x, int len);
 	void eraseTextbox();

Modified: scummvm/trunk/engines/agos/agos.h
===================================================================
--- scummvm/trunk/engines/agos/agos.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/agos/agos.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -1977,7 +1977,7 @@
 	virtual void printScreenText(uint vgaSpriteId, uint color, const char *stringPtr, int16 x, int16 y, int16 width);
 
 	void printInteractText(uint16 num, const char *string);
-	void sendInteractText(uint16 num, const char *fmt, ...);
+	void sendInteractText(uint16 num, const char *fmt, ...) GCC_PRINTF(3, 4);
 
 	void checkLinkBox();
 	void hyperLinkOn(uint16 x);

Modified: scummvm/trunk/engines/agos/vga_ff.cpp
===================================================================
--- scummvm/trunk/engines/agos/vga_ff.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/agos/vga_ff.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -70,7 +70,7 @@
 
 void AGOSEngine::vc75_setScale() {
 	_baseY = vcReadNextWord();
-	_scale = (float)vcReadNextWord() / 1000000.;
+	_scale = vcReadNextWord() / 1000000.0f;
 }
 
 void AGOSEngine::vc76_setScaleXOffs() {

Modified: scummvm/trunk/engines/cine/texte.cpp
===================================================================
--- scummvm/trunk/engines/cine/texte.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/cine/texte.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -37,8 +37,6 @@
 const char *defaultCommandPreposition;
 const char **commandPrepositionTable;
 
-void generateMask(const byte *sprite, byte *mask, uint16 size, byte transparency);
-
 /*! \brief Loads font data from the given file.
  * The number of characters used in the font varies between game versions:
  * 78 (Most PC, Amiga and Atari ST versions of Future Wars, but also Operation Stealth's Amiga demo),

Modified: scummvm/trunk/engines/cine/various.h
===================================================================
--- scummvm/trunk/engines/cine/various.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/cine/various.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -80,8 +80,6 @@
 extern char currentDatName[30];
 extern uint16 musicIsPlaying;
 
-void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4);
-
 extern uint16 errorVar;
 extern byte menuVar;
 

Modified: scummvm/trunk/engines/cruise/cruise_main.h
===================================================================
--- scummvm/trunk/engines/cruise/cruise_main.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/cruise/cruise_main.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -96,7 +96,6 @@
 uint8 *mainProc14(uint16 overlay, uint16 idx);
 void printInfoBlackBox(const char *string);
 void waitForPlayerInput(void);
-int initCt(const char * ctpName);
 void loadPackedFileToMem(int fileIdx, uint8 * buffer);
 int getNumObjectsByClass(int scriptIdx, int param);
 void resetFileEntryRange(int param1, int param2);
@@ -108,7 +107,6 @@
 void getFileExtention(const char *name, char *buffer);
 void *allocAndZero(int size);
 void freeStuff2(void);
-const char *getObjectName(int index, const char * string);
 void mainLoop(void);
 void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY);
 bool testMask(int x, int y, unsigned char* pData, int stride);

Modified: scummvm/trunk/engines/igor/igor.cpp
===================================================================
--- scummvm/trunk/engines/igor/igor.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/igor/igor.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -2095,7 +2095,7 @@
 	float r2 = _walkScaleSpeedTable[scale - 1];
 	debugC(9, kDebugWalk, "getHorizontalStepsCount() maxX - minX = %d r1 = %f r2 = %f", maxX - minX, r1, r2);
 
-	int16 steps = roundReal((maxX - minX) / ((r1 + r2) / 2.));
+	int16 steps = roundReal((maxX - minX) / ((r1 + r2) / 2.0f));
 	int count = 0;
 	if (steps != 0) {
 		float r3 = (maxY - minY) / (float)steps;

Modified: scummvm/trunk/engines/igor/staticres.cpp
===================================================================
--- scummvm/trunk/engines/igor/staticres.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/igor/staticres.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -230,11 +230,11 @@
 };
 
 const float IgorEngine::_walkScaleSpeedTable[] = {
-	0.6250, 1.0000, 1.0000, 1.0000, 1.0000, 1.0000, 1.1250, 1.3750, 1.6250,	1.6250,
-	1.6250, 1.6250, 2.0000, 2.1250, 2.3750, 2.3750, 2.6250, 2.6250, 2.7500,	2.7500,
-	2.7500, 3.0000, 3.0000, 3.0000, 3.0000, 3.6250, 3.6250, 3.6250, 3.8750,	3.8750,
-	3.8750, 4.0000, 4.0000, 4.3750, 4.3750, 4.6250, 4.6250, 5.0000, 5.0000,	5.0000,
-	5.0000, 5.2500, 5.5000, 5.6250, 5.6250, 5.6250, 5.6250, 5.6250, 5.6250,	5.6250
+	0.6250f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.1250f, 1.3750f, 1.6250f,	1.6250f,
+	1.6250f, 1.6250f, 2.0000f, 2.1250f, 2.3750f, 2.3750f, 2.6250f, 2.6250f, 2.7500f,	2.7500f,
+	2.7500f, 3.0000f, 3.0000f, 3.0000f, 3.0000f, 3.6250f, 3.6250f, 3.6250f, 3.8750f,	3.8750f,
+	3.8750f, 4.0000f, 4.0000f, 4.3750f, 4.3750f, 4.6250f, 4.6250f, 5.0000f, 5.0000f,	5.0000f,
+	5.0000f, 5.2500f, 5.5000f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f, 5.6250f,	5.6250f
 };
 
 const uint8 IgorEngine::_walkScaleTable[] = {

Modified: scummvm/trunk/engines/kyra/gui.h
===================================================================
--- scummvm/trunk/engines/kyra/gui.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/kyra/gui.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -260,7 +260,7 @@
 	void drawBox(int x, int y, int w, int h, int fill);
 	bool getInput();
 
-	void printString(const char *string, int x, int y, int col1, int col2, int flags, ...);
+	void printString(const char *string, int x, int y, int col1, int col2, int flags, ...) GCC_PRINTF(2, 8);
 };
 
 } // end of namesapce Kyra

Modified: scummvm/trunk/engines/sci/gfx/operations.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/operations.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/sci/gfx/operations.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -662,7 +662,7 @@
 			return line_check_bar(&(line->x), &(line->width), clip.x, clip.width);
 
 		} else { // "normal" line
-			float start = 0.0, end = 1.0;
+			float start = 0.0f, end = 1.0f;
 			float xv = (float)line->width;
 			float yv = (float)line->height;
 
@@ -682,7 +682,7 @@
 			line->width = (int)(xv * (end - start));
 			line->height = (int)(yv * (end - start));
 
-			return (start > 1.0 || end < 0.0);
+			return (start > 1.0f || end < 0.0f);
 		}
 	}
 
@@ -902,7 +902,7 @@
 int gfxop_draw_box(GfxState *state, rect_t box, gfx_color_t color1, gfx_color_t color2, gfx_box_shade_t shade_type) {
 	GfxDriver *drv = state->driver;
 	int reverse = 0; // switch color1 and color2
-	float mod_offset = 0.0, mod_breadth = 1.0; // 0.0 to 1.0: Color adjustment
+	float mod_offset = 0.0f, mod_breadth = 1.0f; // 0.0 to 1.0: Color adjustment
 	gfx_rectangle_fill_t driver_shade_type;
 	rect_t new_box;
 

Modified: scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/sci/sfx/softseq/adlib.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -482,7 +482,7 @@
 
 	if (bend < 8192)
 		bend = 8192 - bend;
-	delta = pow(2.0, (float)(bend % 8192) / 8192.0);
+	delta = (float)pow(2.0, (bend % 8192) / 8192.0);
 
 	if (bend > 8192)
 		fre = (int)(ym3812_note[n] * delta);

Modified: scummvm/trunk/engines/scumm/boxes.cpp
===================================================================
--- scummvm/trunk/engines/scumm/boxes.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/scumm/boxes.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -369,7 +369,7 @@
 	 */
 
 	// Search for the bend on the left side
-	m = (resptr[199] - resptr[0]) / 199.0;
+	m = (resptr[199] - resptr[0]) / 199.0f;
 	for (lowerIdx = 0; lowerIdx < 199 && (resptr[lowerIdx] == 1 || resptr[lowerIdx] == 255); lowerIdx++) {
 		oldM = m;
 		m = (resptr[199] - resptr[lowerIdx+1]) / (float)(199 - (lowerIdx+1));
@@ -383,7 +383,7 @@
 	}
 
 	// Search for the bend on the right side
-	m = (resptr[199] - resptr[0]) / 199.0;
+	m = (resptr[199] - resptr[0]) / 199.0f;
 	for (upperIdx = 199; upperIdx > 1 && (resptr[upperIdx] == 1 || resptr[upperIdx] == 255); upperIdx--) {
 		oldM = m;
 		m = (resptr[upperIdx-1] - resptr[0]) / (float)(upperIdx-1);

Modified: scummvm/trunk/engines/scumm/gfx.cpp
===================================================================
--- scummvm/trunk/engines/scumm/gfx.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/scumm/gfx.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -574,13 +574,13 @@
 	if (width <= 0 || height <= 0)
 		return;
 
-	const byte *src = vs->getPixels(x, top);
+	const void *src = vs->getPixels(x, top);
 	int m = _textSurfaceMultiplier;
 	int vsPitch;
 	int pitch = vs->pitch;
 
 	if (_useCJKMode && _textSurfaceMultiplier == 2) {
-		scale2x(_fmtownsBuf, _screenWidth * m, src, vs->pitch,  width, height);
+		scale2x(_fmtownsBuf, _screenWidth * m, (const byte *)src, vs->pitch,  width, height);
 		src = _fmtownsBuf;
 
 		vsPitch = _screenWidth * m - width * m;
@@ -599,7 +599,7 @@
 
 		// Compute pointer to the text surface
 		assert(_compositeBuf);
-		const byte *text = (byte *)_textSurface.getBasePtr(x * m, y * m);
+		const void *text = _textSurface.getBasePtr(x * m, y * m);
 
 		// The values x, width, etc. are all multiples of 8 at this point,
 		// so loop unrolloing might be a good idea...
@@ -677,7 +677,7 @@
 	}
 
 	// Finally blit the whole thing to the screen
-	_system->copyRectToScreen(src, pitch, x, y, width, height);
+	_system->copyRectToScreen((const byte *)src, pitch, x, y, width, height);
 }
 
 // CGA

Modified: scummvm/trunk/engines/sword2/screen.h
===================================================================
--- scummvm/trunk/engines/sword2/screen.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/sword2/screen.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -423,8 +423,8 @@
 	void setPalette(int16 startEntry, int16 noEntries, byte *palette, uint8 setNow);
 	void setSystemPalette(const byte *colors, uint start, uint num);
 	uint8 quickMatch(uint8 r, uint8 g, uint8 b);
-	int32 fadeUp(float time = 0.75);
-	int32 fadeDown(float time = 0.75);
+	int32 fadeUp(float time = 0.75f);
+	int32 fadeDown(float time = 0.75f);
 	uint8 getFadeStatus();
 	void dimPalette(bool dim);
 	void waitForFade();

Modified: scummvm/trunk/engines/tinsel/actors.h
===================================================================
--- scummvm/trunk/engines/tinsel/actors.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/tinsel/actors.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -137,8 +137,6 @@
 void StoreActorReel(int actor, int column, OBJECT *pObj);
 void NotPlayingReel(int actor, int filmNumber, int column);
 bool ActorReelPlaying(int actor, int column);
-void SetActorPlayFilm(int ano, SCNHANDLE hFilm);
-SCNHANDLE GetActorPlayFilm(int ano);
 
 /*----------------------------------------------------------------------*/
 
@@ -161,8 +159,6 @@
 	int		z;
 };
 
-int SaveActors(SAVED_ACTOR *sActorInfo);
-
 void RestoreActorProcess(int id, INT_CONTEXT *pic);
 
 int SaveActors(PSAVED_ACTOR sActorInfo);

Modified: scummvm/trunk/engines/tinsel/pdisplay.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/pdisplay.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/tinsel/pdisplay.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -55,14 +55,6 @@
 #endif
 
 
-//----------------- EXTERNAL FUNCTIONS ---------------------
-
-// in BG.C
-extern int BgWidth(void);
-extern int BgHeight(void);
-
-
-
 //----------------- LOCAL DEFINES --------------------
 
 #define LPOSX	295		// X-co-ord of lead actor's position display

Modified: scummvm/trunk/engines/tinsel/polygons.h
===================================================================
--- scummvm/trunk/engines/tinsel/polygons.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/tinsel/polygons.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -92,7 +92,6 @@
 int GetScale(HPOLYGON path, int y);
 int GetBrightness(HPOLYGON hPath, int y);
 void getNpathNode(HPOLYGON npath, int node, int *px, int *py);
-void GetTagTag(HPOLYGON p, SCNHANDLE *hTagText, int *tagx, int *tagy);
 SCNHANDLE GetPolyFilm(HPOLYGON p);
 void GetPolyNode(HPOLYGON hp, int *pNodeX, int *pNodeY);
 SCNHANDLE GetPolyScript(HPOLYGON p);
@@ -108,8 +107,6 @@
 void EnablePath(int path);
 void DisableRefer(int refer);
 void EnableRefer(int refer);
-void DisableBlock(int blockno);
-void EnableBlock(int blockno);
 HPOLYGON GetTagHandle(int tagno);
 void DisableTag(CORO_PARAM, int tag);
 void EnableTag(CORO_PARAM, int tag);
@@ -152,8 +149,7 @@
 bool PolyTagFollowsCursor(HPOLYGON hp);
 SCNHANDLE GetPolyTagHandle(HPOLYGON hp);
 bool IsTagPolygon(int tagno);
-int GetTagPolyId(HPOLYGON hp);
-void GetPolyMidBottom(	HPOLYGON hp, int *pX, int *pY);
+void GetPolyMidBottom(HPOLYGON hp, int *pX, int *pY);
 int PathCount(void);
 void MovePolygon(PTYPE ptype, int id, int x, int y);
 void MovePolygonTo(PTYPE ptype, int id, int x, int y);

Modified: scummvm/trunk/engines/tinsel/tinlib.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinlib.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/tinsel/tinlib.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -89,8 +89,6 @@
 
 // in BG.CPP
 extern void ChangePalette(SCNHANDLE hPal);
-extern int BgWidth(void);
-extern int BgHeight(void);
 
 // in BMV.CPP
 void PlayBMV(CORO_PARAM, SCNHANDLE hFileStem, int myEscape);
@@ -278,7 +276,6 @@
 //----------------- FORWARD REFERENCES --------------------
 
 static int HeldObject(void);
-void Offset(EXTREME extreme, int x, int y);
 static void PostTag(CORO_PARAM, int tagno, TINSEL_EVENT event, HPOLYGON hp, int myEscape);
 void ResetIdleTime(void);
 static void SendTag(CORO_PARAM, int tagno, TINSEL_EVENT event, HPOLYGON hp, int myEscape, bool *result);

Modified: scummvm/trunk/engines/tinsel/tinsel.cpp
===================================================================
--- scummvm/trunk/engines/tinsel/tinsel.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/engines/tinsel/tinsel.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -93,10 +93,6 @@
 extern void PrimeBackground();
 extern SCNHANDLE GetSceneHandle(void);
 
-// In TIMER.CPP
-extern void FettleTimers(void);
-extern void RebootTimers(void);
-
 //----------------- FORWARD DECLARATIONS  ---------------------
 void SetNewScene(SCNHANDLE scene, int entrance, int transition);
 

Modified: scummvm/trunk/gui/debugger.cpp
===================================================================
--- scummvm/trunk/gui/debugger.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/gui/debugger.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -39,7 +39,7 @@
 	_isAttached = false;
 	_errStr = NULL;
 	_firstTime = true;
-	_debuggerDialog = new GUI::ConsoleDialog(1.0, 0.67F);
+	_debuggerDialog = new GUI::ConsoleDialog(1.0f, 0.67f);
 	_debuggerDialog->setInputCallback(debuggerInputCallback, this);
 	_debuggerDialog->setCompletionCallback(debuggerCompletionCallback, this);
 

Modified: scummvm/trunk/sound/softsynth/mt32/partial.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/partial.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/sound/softsynth/mt32/partial.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -35,9 +35,9 @@
 // powf, resulting in a linker error because of multiple definitions.
 // Hence we re-define them here. The only potential drawback is that it
 // might be a little bit slower this way.
-#define powf pow
-#define floorf floor
-#define fabsf fabs
+#define powf(x,y)	((float)pow(x,y))
+#define floorf(x)	((float)floorf(x))
+#define fabsf(x)	((float)fabs(x))
 #endif
 
 #define FIXEDPOINT_UDIV(x, y, point) (((x) << (point)) / ((y)))
@@ -504,10 +504,10 @@
 		a = ((float)*buf1) / 8192.0f;
 		b = ((float)*buf2) / 8192.0f;
 		a = (a * b) + a;
-		if (a>1.0)
-			a = 1.0;
-		if (a<-1.0)
-			a = -1.0;
+		if (a > 1.0f)
+			a = 1.0f;
+		if (a < -1.0f)
+			a = -1.0f;
 		*buf1 = (Bit16s)(a * 8192.0f);
 		buf1++;
 		buf2++;
@@ -537,10 +537,10 @@
 		a = ((float)*buf1) / 8192.0f;
 		b = ((float)*buf2) / 8192.0f;
 		a *= b;
-		if (a>1.0)
-			a = 1.0;
-		if (a<-1.0)
-			a = -1.0;
+		if (a > 1.0f)
+			a = 1.0f;
+		if (a < -1.0f)
+			a = -1.0f;
 		*buf1 = (Bit16s)(a * 8192.0f);
 		buf1++;
 		buf2++;

Modified: scummvm/trunk/sound/softsynth/mt32/synth.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/synth.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/sound/softsynth/mt32/synth.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -35,9 +35,9 @@
 // powf, resulting in a linker error because of multiple definitions.
 // Hence we re-define them here. The only potential drawback is that it
 // might be a little bit slower this way.
-#define powf pow
-#define floorf floor
-#define fabsf fabs
+#define powf(x,y)	((float)pow(x,y))
+#define floorf(x)	((float)floorf(x))
+#define fabsf(x)	((float)fabs(x))
 #endif
 
 namespace MT32Emu {

Modified: scummvm/trunk/sound/softsynth/mt32/synth.h
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/synth.h	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/sound/softsynth/mt32/synth.h	2009-07-01 20:51:04 UTC (rev 42009)
@@ -22,7 +22,7 @@
 #ifndef MT32EMU_SYNTH_H
 #define MT32EMU_SYNTH_H
 
-#include <stdarg.h>
+#include "common/scummsys.h"
 
 class revmodel;
 
@@ -256,7 +256,7 @@
 	int report(ReportType type, const void *reportData);
 	File *openFile(const char *filename, File::OpenMode mode);
 	void closeFile(File *file);
-	void printDebug(const char *fmt, ...);
+	void printDebug(const char *fmt, ...) GCC_PRINTF(2, 3);
 
 public:
 	static Bit8u calcSysexChecksum(const Bit8u *data, Bit32u len, Bit8u checksum);

Modified: scummvm/trunk/sound/softsynth/mt32/tables.cpp
===================================================================
--- scummvm/trunk/sound/softsynth/mt32/tables.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/sound/softsynth/mt32/tables.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -35,9 +35,9 @@
 // powf, resulting in a linker error because of multiple definitions.
 // Hence we re-define them here. The only potential drawback is that it
 // might be a little bit slower this way.
-#define powf pow
-#define floorf floor
-#define fabsf fabs
+#define powf(x,y)	((float)pow(x,y))
+#define floorf(x)	((float)floorf(x))
+#define fabsf(x)	((float)fabs(x))
 #endif
 
 #define FIXEDPOINT_MAKE(x, point) ((Bit32u)((1 << point) * x))
@@ -730,7 +730,7 @@
 
 bool Tables::init(Synth *synth, PCMWaveEntry *pcmWaves, float sampleRate, float masterTune) {
 	if (sampleRate <= 0.0f) {
-		synth->printDebug("Bad sampleRate (%d <= 0.0f)", sampleRate);
+		synth->printDebug("Bad sampleRate (%f <= 0.0f)", sampleRate);
 		return false;
 	}
 	if (initialisedSampleRate == 0.0f) {

Modified: scummvm/trunk/sound/vorbis.cpp
===================================================================
--- scummvm/trunk/sound/vorbis.cpp	2009-07-01 20:11:44 UTC (rev 42008)
+++ scummvm/trunk/sound/vorbis.cpp	2009-07-01 20:51:04 UTC (rev 42009)
@@ -60,7 +60,7 @@
 
 static int seek_stream_wrap(void *datasource, ogg_int64_t offset, int whence) {
 	Common::SeekableReadStream *stream = (Common::SeekableReadStream *)datasource;
-	stream->seek(offset, whence);
+	stream->seek((int32)offset, whence);
 	return stream->pos();
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list