aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMax Horn2009-02-15 14:52:52 +0000
committerMax Horn2009-02-15 14:52:52 +0000
commit3ea3141e9091e349b6dbcd4b6a79ceba5f62e14f (patch)
tree9f87c3e65598c9b596d376b7b68a2987e0a5f96a /engines
parentaa3f10b2fdabd123c08354131949f7920399df70 (diff)
downloadscummvm-rg350-3ea3141e9091e349b6dbcd4b6a79ceba5f62e14f.tar.gz
scummvm-rg350-3ea3141e9091e349b6dbcd4b6a79ceba5f62e14f.tar.bz2
scummvm-rg350-3ea3141e9091e349b6dbcd4b6a79ceba5f62e14f.zip
Some more warning fixes
svn-id: r38248
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/gfx/resource/sci_pic_0.cpp7
-rw-r--r--engines/sci/include/sci_memory.h3
-rw-r--r--engines/sci/sfx/softseq/opl2.cpp55
-rw-r--r--engines/sci/sfx/timer/timer_scummvm.cpp4
4 files changed, 25 insertions, 44 deletions
diff --git a/engines/sci/gfx/resource/sci_pic_0.cpp b/engines/sci/gfx/resource/sci_pic_0.cpp
index d3c16724fb..87495dcb10 100644
--- a/engines/sci/gfx/resource/sci_pic_0.cpp
+++ b/engines/sci/gfx/resource/sci_pic_0.cpp
@@ -24,10 +24,8 @@
***************************************************************************/
+#include <time.h> // for time() to seed rand() via srand()
#include "sci/include/sci_memory.h"
-#include <assert.h>
-#include <math.h>
-#include <time.h>
#include "sci/include/gfx_resource.h"
#include "sci/include/gfx_tools.h"
@@ -577,7 +575,8 @@ enum {
#ifdef GFXR_DEBUG_PIC0
#define p0printf sciprintf
#else
-#define p0printf if (0)
+void do_nothing(...) { }
+#define p0printf do_nothing
#endif
diff --git a/engines/sci/include/sci_memory.h b/engines/sci/include/sci_memory.h
index ce66a75aa1..37ecea5b58 100644
--- a/engines/sci/include/sci_memory.h
+++ b/engines/sci/include/sci_memory.h
@@ -68,8 +68,7 @@
#ifndef _SCI_MEMORY_H
#define _SCI_MEMORY_H
-#include <stdio.h>
-#include <assert.h>
+#include "common/scummsys.h"
#include "sci/include/resource.h"
#ifdef _WIN32
diff --git a/engines/sci/sfx/softseq/opl2.cpp b/engines/sci/sfx/softseq/opl2.cpp
index dc1237ae66..f6e60215b0 100644
--- a/engines/sci/sfx/softseq/opl2.cpp
+++ b/engines/sci/sfx/softseq/opl2.cpp
@@ -78,26 +78,6 @@ static guint8 sci_adlib_vol_base[16] = {
};
static guint8 sci_adlib_vol_tables[16][64];
-/* ripped out of the linux kernel, of all places. */
-static gint8 fm_volume_table[128] = {
- -64, -48, -40, -35, -32, -29, -27, -26,
- -24, -23, -21, -20, -19, -18, -18, -17,
- -16, -15, -15, -14, -13, -13, -12, -12,
- -11, -11, -10, -10, -10, -9, -9, -8,
- -8, -8, -7, -7, -7, -6, -6, -6,
- -5, -5, -5, -5, -4, -4, -4, -4,
- -3, -3, -3, -3, -2, -2, -2, -2,
- -2, -1, -1, -1, -1, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 4,
- 4, 4, 4, 4, 4, 4, 4, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 8, 8, 8, 8, 8
-};
-
/* back to your regularly scheduled definitions */
static guint8 instr[MIDI_CHANNELS];
@@ -274,31 +254,32 @@ void synth_setvolume_R (int voice, int volume)
void synth_setnote (int voice, int note, int bend)
{
- int n, fre, oct;
- float delta;
+ int n, fre, oct;
+ float delta;
- delta = 0;
+ delta = 0;
- n = note % 12;
+ n = note % 12;
- if (bend < 8192)
- bend = 8192-bend;
- delta = pow(2, (float) (bend%8192)/8192.0);
+ if (bend < 8192)
+ bend = 8192-bend;
+ delta = pow(2, (float) (bend%8192)/8192.0);
- if (bend > 8192)
- fre = ym3812_note[n]*delta; else
- fre = ym3812_note[n]/delta;
+ if (bend > 8192)
+ fre = (int)(ym3812_note[n]*delta);
+ else
+ fre = (int)(ym3812_note[n]/delta);
- oct = note / 12 - 1;
+ oct = note / 12 - 1;
- if (oct < 0)
- oct = 0;
+ if (oct < 0)
+ oct = 0;
- opl_write(0xa0 + voice, fre & 0xff);
- opl_write(0xb0 + voice,
- 0x20 | ((oct << 2) & 0x1c) | ((fre >> 8) & 0x03));
+ opl_write(0xa0 + voice, fre & 0xff);
+ opl_write(0xb0 + voice,
+ 0x20 | ((oct << 2) & 0x1c) | ((fre >> 8) & 0x03));
#ifdef DEBUG_ADLIB
- printf("-- %02x %02x\n", adlib_reg_L[0xa0+voice], adlib_reg_L[0xb0+voice]);
+ printf("-- %02x %02x\n", adlib_reg_L[0xa0+voice], adlib_reg_L[0xb0+voice]);
#endif
}
diff --git a/engines/sci/sfx/timer/timer_scummvm.cpp b/engines/sci/sfx/timer/timer_scummvm.cpp
index c7d225e80c..80fc309d1d 100644
--- a/engines/sci/sfx/timer/timer_scummvm.cpp
+++ b/engines/sci/sfx/timer/timer_scummvm.cpp
@@ -48,5 +48,7 @@ sfx_timer_t sfx_timer_scummvm = {
DELAY/1000, 0,
NULL,
&scummvm_timer_start,
- &scummvm_timer_stop
+ &scummvm_timer_stop,
+ 0,
+ 0
};