aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-07-01 20:51:04 +0000
committerMax Horn2009-07-01 20:51:04 +0000
commita6b57dc3a986f749ca8f915b461b184d48390757 (patch)
treed6c3e5e46743dd5073b8853613d61e501fa76fcd
parent62acda5fdbe0daaeae9e1d0f08044b8be4ee98cf (diff)
downloadscummvm-rg350-a6b57dc3a986f749ca8f915b461b184d48390757.tar.gz
scummvm-rg350-a6b57dc3a986f749ca8f915b461b184d48390757.tar.bz2
scummvm-rg350-a6b57dc3a986f749ca8f915b461b184d48390757.zip
- 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 svn-id: r42009
-rw-r--r--Makefile7
-rw-r--r--engines/agi/agi.h2
-rw-r--r--engines/agos/agos.h2
-rw-r--r--engines/agos/vga_ff.cpp2
-rw-r--r--engines/cine/texte.cpp2
-rw-r--r--engines/cine/various.h2
-rw-r--r--engines/cruise/cruise_main.h2
-rw-r--r--engines/igor/igor.cpp2
-rw-r--r--engines/igor/staticres.cpp10
-rw-r--r--engines/kyra/gui.h2
-rw-r--r--engines/sci/gfx/operations.cpp6
-rw-r--r--engines/sci/sfx/softseq/adlib.cpp2
-rw-r--r--engines/scumm/boxes.cpp4
-rw-r--r--engines/scumm/gfx.cpp8
-rw-r--r--engines/sword2/screen.h4
-rw-r--r--engines/tinsel/actors.h4
-rw-r--r--engines/tinsel/pdisplay.cpp8
-rw-r--r--engines/tinsel/polygons.h6
-rw-r--r--engines/tinsel/tinlib.cpp3
-rw-r--r--engines/tinsel/tinsel.cpp4
-rw-r--r--gui/debugger.cpp2
-rw-r--r--sound/softsynth/mt32/partial.cpp22
-rw-r--r--sound/softsynth/mt32/synth.cpp6
-rw-r--r--sound/softsynth/mt32/synth.h4
-rw-r--r--sound/softsynth/mt32/tables.cpp8
-rw-r--r--sound/vorbis.cpp2
26 files changed, 52 insertions, 74 deletions
diff --git a/Makefile b/Makefile
index 99accca5fc..a72e76619d 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,13 @@ CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
# 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
diff --git a/engines/agi/agi.h b/engines/agi/agi.h
index 7cf89fa592..14e1fd448b 100644
--- a/engines/agi/agi.h
+++ b/engines/agi/agi.h
@@ -993,7 +993,7 @@ public:
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();
diff --git a/engines/agos/agos.h b/engines/agos/agos.h
index 405ee3622c..3720e35d3d 100644
--- a/engines/agos/agos.h
+++ b/engines/agos/agos.h
@@ -1977,7 +1977,7 @@ protected:
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);
diff --git a/engines/agos/vga_ff.cpp b/engines/agos/vga_ff.cpp
index 58eb2f4cc0..14451a3dbe 100644
--- a/engines/agos/vga_ff.cpp
+++ b/engines/agos/vga_ff.cpp
@@ -70,7 +70,7 @@ int AGOSEngine::getScale(int16 y, int16 x) {
void AGOSEngine::vc75_setScale() {
_baseY = vcReadNextWord();
- _scale = (float)vcReadNextWord() / 1000000.;
+ _scale = vcReadNextWord() / 1000000.0f;
}
void AGOSEngine::vc76_setScaleXOffs() {
diff --git a/engines/cine/texte.cpp b/engines/cine/texte.cpp
index ffc36b4b1a..3dceae2fa4 100644
--- a/engines/cine/texte.cpp
+++ b/engines/cine/texte.cpp
@@ -37,8 +37,6 @@ const char **otherMessages;
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),
diff --git a/engines/cine/various.h b/engines/cine/various.h
index bdbbc6fb86..1f9aa7dc78 100644
--- a/engines/cine/various.h
+++ b/engines/cine/various.h
@@ -80,8 +80,6 @@ extern int16 commandVar3[4];
extern char currentDatName[30];
extern uint16 musicIsPlaying;
-void setTextWindow(uint16 param1, uint16 param2, uint16 param3, uint16 param4);
-
extern uint16 errorVar;
extern byte menuVar;
diff --git a/engines/cruise/cruise_main.h b/engines/cruise/cruise_main.h
index 86e8dc1591..d2e9350d70 100644
--- a/engines/cruise/cruise_main.h
+++ b/engines/cruise/cruise_main.h
@@ -96,7 +96,6 @@ void *mallocAndZero(int32 size);
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 resetPtr2(scriptInstanceStruct * ptr);
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);
diff --git a/engines/igor/igor.cpp b/engines/igor/igor.cpp
index 0581f6ddc3..6cf7bda33d 100644
--- a/engines/igor/igor.cpp
+++ b/engines/igor/igor.cpp
@@ -2095,7 +2095,7 @@ int IgorEngine::getHorizontalStepsCount(int minX, int minY, int maxX, int maxY)
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;
diff --git a/engines/igor/staticres.cpp b/engines/igor/staticres.cpp
index e5df644c5e..ef19d7033f 100644
--- a/engines/igor/staticres.cpp
+++ b/engines/igor/staticres.cpp
@@ -230,11 +230,11 @@ const uint8 IgorEngine::_walkWidthScaleTable[] = {
};
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[] = {
diff --git a/engines/kyra/gui.h b/engines/kyra/gui.h
index 3989062506..95df656977 100644
--- a/engines/kyra/gui.h
+++ b/engines/kyra/gui.h
@@ -260,7 +260,7 @@ private:
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
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 613e5de1b1..7496c55868 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -662,7 +662,7 @@ static int line_clip(rect_t *line, rect_t clip, int xfact, int yfact) {
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 @@ static int line_clip(rect_t *line, rect_t clip, int xfact, int yfact) {
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_rectangle(GfxState *state, rect_t rect, gfx_color_t color, gfx_li
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;
diff --git a/engines/sci/sfx/softseq/adlib.cpp b/engines/sci/sfx/softseq/adlib.cpp
index 0bb13e120c..41c7c63fc9 100644
--- a/engines/sci/sfx/softseq/adlib.cpp
+++ b/engines/sci/sfx/softseq/adlib.cpp
@@ -482,7 +482,7 @@ void MidiDriver_Adlib::setNote(int voice, int note, bool key) {
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);
diff --git a/engines/scumm/boxes.cpp b/engines/scumm/boxes.cpp
index f1429d4261..472e04b5f3 100644
--- a/engines/scumm/boxes.cpp
+++ b/engines/scumm/boxes.cpp
@@ -369,7 +369,7 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) {
*/
// 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 @@ void ScummEngine::convertScaleTableToScaleSlot(int slot) {
}
// 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);
diff --git a/engines/scumm/gfx.cpp b/engines/scumm/gfx.cpp
index 62e18561d3..07640ca551 100644
--- a/engines/scumm/gfx.cpp
+++ b/engines/scumm/gfx.cpp
@@ -574,13 +574,13 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
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 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
// 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 @@ void ScummEngine::drawStripToScreen(VirtScreen *vs, int x, int width, int top, i
}
// 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
diff --git a/engines/sword2/screen.h b/engines/sword2/screen.h
index 2f72b75980..166245c6ef 100644
--- a/engines/sword2/screen.h
+++ b/engines/sword2/screen.h
@@ -423,8 +423,8 @@ public:
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();
diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h
index 74a5ba4185..bda0e8bbb3 100644
--- a/engines/tinsel/actors.h
+++ b/engines/tinsel/actors.h
@@ -137,8 +137,6 @@ int GetActorFilmNumber(int ano);
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 @@ struct Z_POSITIONS {
int z;
};
-int SaveActors(SAVED_ACTOR *sActorInfo);
-
void RestoreActorProcess(int id, INT_CONTEXT *pic);
int SaveActors(PSAVED_ACTOR sActorInfo);
diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp
index e0262839a2..17e9a3a517 100644
--- a/engines/tinsel/pdisplay.cpp
+++ b/engines/tinsel/pdisplay.cpp
@@ -55,14 +55,6 @@ extern int newestString; // The overrun counter, in STRRES.C
#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
diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h
index 62ec0422c6..7cb22a1b8a 100644
--- a/engines/tinsel/polygons.h
+++ b/engines/tinsel/polygons.h
@@ -92,7 +92,6 @@ bool IsPolyCorner(HPOLYGON hPath, int x, int y);
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 DisablePath(int path);
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 PolyTagIsWanted(HPOLYGON hp);
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);
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index b73a66b6d3..4b5e0ce450 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -89,8 +89,6 @@ int clRunMode = 0;
// 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 @@ static COLORREF s_talkfontColor = 0;
//----------------- 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);
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 1a08fd2420..95541e3287 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -93,10 +93,6 @@ extern void InventoryProcess(CORO_PARAM, const void *);
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);
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index c32b68f3de..181403484b 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -39,7 +39,7 @@ Debugger::Debugger() {
_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);
diff --git a/sound/softsynth/mt32/partial.cpp b/sound/softsynth/mt32/partial.cpp
index 02610798dc..871eff03d2 100644
--- a/sound/softsynth/mt32/partial.cpp
+++ b/sound/softsynth/mt32/partial.cpp
@@ -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 @@ Bit16s *Partial::mixBuffersRingMix(Bit16s * buf1, Bit16s *buf2, int len) {
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 @@ Bit16s *Partial::mixBuffersRing(Bit16s * buf1, Bit16s *buf2, int len) {
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++;
diff --git a/sound/softsynth/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp
index bedae241b3..547b2bb9b3 100644
--- a/sound/softsynth/mt32/synth.cpp
+++ b/sound/softsynth/mt32/synth.cpp
@@ -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 {
diff --git a/sound/softsynth/mt32/synth.h b/sound/softsynth/mt32/synth.h
index 9d57c8d3cd..3fc303d322 100644
--- a/sound/softsynth/mt32/synth.h
+++ b/sound/softsynth/mt32/synth.h
@@ -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 @@ protected:
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);
diff --git a/sound/softsynth/mt32/tables.cpp b/sound/softsynth/mt32/tables.cpp
index bf35db776a..16fc4f71e5 100644
--- a/sound/softsynth/mt32/tables.cpp
+++ b/sound/softsynth/mt32/tables.cpp
@@ -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 @@ Tables::Tables() {
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) {
diff --git a/sound/vorbis.cpp b/sound/vorbis.cpp
index 9658f8f257..8b8bb8f649 100644
--- a/sound/vorbis.cpp
+++ b/sound/vorbis.cpp
@@ -60,7 +60,7 @@ static size_t read_stream_wrap(void *ptr, size_t size, size_t nmemb, void *datas
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();
}