aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--akos.cpp2
-rw-r--r--boxes.cpp4
-rw-r--r--gfx.cpp10
-rw-r--r--gui.cpp2
-rw-r--r--object.cpp2
-rw-r--r--resource.cpp2
-rw-r--r--script_v1.cpp4
-rw-r--r--sdl.cpp4
-rw-r--r--sound/imuse.cpp2
-rw-r--r--string.cpp4
11 files changed, 19 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 6af1fb6dc5..e7a0c3fd0d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
# $Header$
CC = gcc
-CFLAGS = -g -Wall -Wstrict-prototypes -Wno-long-long -Wno-multichar
+CFLAGS = -g -O -Wall -Wstrict-prototypes -Wuninitialized -Wno-long-long -Wno-multichar
DEFINES = -DUNIX -DUSE_ADLIB
LDFLAGS :=
INCLUDES:= `sdl-config --cflags` -I./ -I./sound
diff --git a/akos.cpp b/akos.cpp
index 8c1ea67d00..379b2227f9 100644
--- a/akos.cpp
+++ b/akos.cpp
@@ -552,7 +552,7 @@ void Scumm::akos_codec1(AkosRenderer *ar) {
int num_colors;
bool use_scaling;
int i,j;
- int x,x_right,x_left,skip,tmp_x,tmp_y;
+ int x,x_right,x_left,skip=0,tmp_x,tmp_y;
int y,y_top,y_bottom;
bool y_clipping;
bool charsetmask;
diff --git a/boxes.cpp b/boxes.cpp
index fce86f349f..323bf9684f 100644
--- a/boxes.cpp
+++ b/boxes.cpp
@@ -508,7 +508,7 @@ void Scumm::createBoxMatrix() {
int code;
PathVertex *vtx;
- PathNode *node, *node2;
+ PathNode *node, *node2=NULL;
_maxBoxVertexHeap = 1000;
@@ -861,7 +861,7 @@ int Scumm::findPathTowardsOld(Actor *a, byte trap1, byte trap2, byte final_trap)
void Scumm::GetGates(int trap1,int trap2) {
int i;
-int Closest1,Closest2,Closest3;
+int Closest1=0,Closest2=0,Closest3=0;
int Dist[8];
int Dist1,Dist2,Dist3;
int Box1,Box2,Box3;
diff --git a/gfx.cpp b/gfx.cpp
index 15d3c9a6fb..f72959d0e9 100644
--- a/gfx.cpp
+++ b/gfx.cpp
@@ -1305,7 +1305,7 @@ void Gdi::unkDecode9() {
byte *dst = _bgbak_ptr;
unsigned char c, bits, color, run;
int x, y, i, z;
- uint buffer, mask = 128;
+ uint buffer=0, mask = 128;
int h = _numLinesToProcess;
x = y = i = z = run = 0;
@@ -1374,7 +1374,7 @@ void Gdi::unkDecode11() {
byte *src = _smap_ptr;
byte *dst = _bgbak_ptr;
int bits, i;
- uint buffer, mask = 128;
+ uint buffer=0, mask = 128;
unsigned char inc = 1, color = *src++;
_currentX = 8;
@@ -1695,7 +1695,7 @@ void Scumm::moveCamera() {
if(_features & GF_AFTER_V7) {
CameraData *cd = &camera;
ScummPoint old = cd->_cur;
- Actor *a;
+ Actor *a=NULL;
if (cd->_follows) {
a = derefActorSafe(cd->_follows, "moveCamera");
@@ -1778,7 +1778,7 @@ void Scumm::moveCamera() {
CameraData *cd = &camera;
int pos = cd->_cur.x;
int actorx, t;
- Actor *a;
+ Actor *a=NULL;
cd->_cur.x &= 0xFFF8;
@@ -2309,7 +2309,7 @@ void Scumm::decompressDefaultCursor(int idx) {
int Scumm::remapPaletteColor(int r, int g, int b, uint threshold) {
int i;
int ar,ag,ab;
- uint sum,j,bestsum,bestitem;
+ uint sum,j,bestsum,bestitem=0;
byte *pal = _currentPalette;
if (r>255) r=255;
diff --git a/gui.cpp b/gui.cpp
index bbdb84a7eb..e68fe88a0a 100644
--- a/gui.cpp
+++ b/gui.cpp
@@ -96,7 +96,7 @@ const GuiWidget *Gui::widgetFromPos(int x, int y) {
}
void Gui::drawChar(const char str, int xx, int yy) {
- unsigned int buffer, mask = 0, x, y;
+ unsigned int buffer=0, mask = 0, x, y;
byte *tmp;
int tempc = _color;
_color = _textcolor;
diff --git a/object.cpp b/object.cpp
index e6e439db23..c7d2869a6e 100644
--- a/object.cpp
+++ b/object.cpp
@@ -670,7 +670,7 @@ byte *Scumm::getObjOrActorName(int obj) {
return getActorName(derefActorSafe(obj, "getObjOrActorName"));
if(_features & GF_SMALL_HEADER) {
- byte offset;
+ byte offset=0;
objptr = getOBCDFromObject(obj);
if (objptr)
diff --git a/resource.cpp b/resource.cpp
index 16378c79d1..96799d7e06 100644
--- a/resource.cpp
+++ b/resource.cpp
@@ -657,7 +657,7 @@ int Scumm::loadResource(int type, int idx) {
int Scumm::readSoundResource(int type, int idx) {
uint32 pos, total_size, size, tag,basetag;
int pri, best_pri;
- uint32 best_size, best_offs;
+ uint32 best_size=0, best_offs=0;
debug(9, "readSoundResource(%d,%d)", type, idx);
diff --git a/script_v1.cpp b/script_v1.cpp
index 1a1020331d..b8bf76390f 100644
--- a/script_v1.cpp
+++ b/script_v1.cpp
@@ -1655,7 +1655,7 @@ void Scumm::o5_quitPauseRestart() {
}
void Scumm::o5_resourceRoutines() {
- int resid;
+ int resid=0;
_opcode = fetchScriptByte();
if (_opcode != 17)
@@ -1742,7 +1742,7 @@ void Scumm::o5_resourceRoutines() {
}
void Scumm::o5_roomOps() {
- int a,b,c,d,e;
+ int a=0,b=0,c,d,e;
if(_features & GF_OLD256)
{
diff --git a/sdl.cpp b/sdl.cpp
index c837d2732e..23cb9baab8 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -979,8 +979,8 @@ int main(int argc, char* argv[]) {
scumm->_scummStackPos=0;
scumm->_verbMouseOver=0;
- scumm->_palDirtyMax=-1;
- scumm->_palDirtyMin=-1;
+ scumm->_palDirtyMax=0;
+ scumm->_palDirtyMin=0;
scumm->_debugger=0;
scumm->camera._cur.x=0;
scumm->camera._cur.y=0;
diff --git a/sound/imuse.cpp b/sound/imuse.cpp
index ce2bb84669..6b3352917e 100644
--- a/sound/imuse.cpp
+++ b/sound/imuse.cpp
@@ -695,7 +695,7 @@ int SoundEngine::enqueue_trigger(int sound, int marker) {
int32 SoundEngine::do_command(int a, int b, int c, int d, int e, int f, int g, int h) {
byte cmd = a&0xFF;
byte param = a>>8;
- Player *player;
+ Player *player=NULL;
if (!_initialized && (cmd || param))
return -1;
diff --git a/string.cpp b/string.cpp
index f07a9c5404..b51e209388 100644
--- a/string.cpp
+++ b/string.cpp
@@ -427,7 +427,7 @@ void Scumm::drawString(int a) {
byte buf[256];
byte *charsetptr,*space;
int i;
- byte byte1, chr;
+ byte byte1=0, chr;
uint color;
_msgPtrToAdd = buf;
@@ -701,7 +701,7 @@ void Scumm::initCharset(int charsetno) {
void CharsetRenderer::printCharOld(int chr) { // Loom3 / Zak256
VirtScreen *vs;
byte *char_ptr, *dest_ptr;
- unsigned int buffer, mask=0, x = 0, y = 0;
+ unsigned int buffer=0, mask=0, x = 0, y = 0;
unsigned char color;
_vm->checkRange(_vm->_maxCharsets-1, 0, _curId, "Printing with bad charset %d");