[Scummvm-cvs-logs] SF.net SVN: scummvm: [33028] residual/trunk/engine

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Sun Jul 13 12:53:40 CEST 2008


Revision: 33028
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33028&view=rev
Author:   aquadran
Date:     2008-07-13 03:53:39 -0700 (Sun, 13 Jul 2008)

Log Message:
-----------
fixed some uninitialised warnings

Modified Paths:
--------------
    residual/trunk/engine/engine.cpp
    residual/trunk/engine/lua/ltask.cpp
    residual/trunk/engine/lua.cpp
    residual/trunk/engine/scene.cpp
    residual/trunk/engine/smush/blocky16.cpp
    residual/trunk/engine/tinygl/ztriangle.cpp
    residual/trunk/engine/tinygl/ztriangle.h
    residual/trunk/engine/tinygl/ztriangle_shadow.cpp

Modified: residual/trunk/engine/engine.cpp
===================================================================
--- residual/trunk/engine/engine.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/engine.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -178,7 +178,7 @@
 }
 
 void Engine::handleDebugLoadResource() {
-	void *resource;
+	void *resource = NULL;
 	int c, i = 0;
 	char buf[512];
 

Modified: residual/trunk/engine/lua/ltask.cpp
===================================================================
--- residual/trunk/engine/lua/ltask.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/lua/ltask.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -71,7 +71,7 @@
 void stop_script (void) {
 	struct lua_Task *prev, *t;
 	TObject *f = L->stack.stack + L->Cstack.lua2C;
-	int match;
+	int match = 0;
 
 	if ((f == LUA_NOOBJECT) || (ttype(f) != LUA_T_CLOSURE && ttype(f) != LUA_T_PROTO && ttype(f) != LUA_T_TASK))
 		lua_error("Bad argument to stop_script");
@@ -110,7 +110,7 @@
 }
 
 void next_script (void) {
-	struct lua_Task *t, *prev;
+	struct lua_Task *t = NULL, *prev;
 	TObject *f = L->stack.stack + L->Cstack.lua2C;
 
 	if (f == LUA_NOOBJECT)
@@ -165,7 +165,7 @@
 }
 
 void find_script (void) {
-	struct lua_Task *t, *foundTask = NULL;
+	struct lua_Task *t = NULL, *foundTask = NULL;
 	TObject *f = L->stack.stack + L->Cstack.lua2C;
 	int countTasks = 0, taskId;
 

Modified: residual/trunk/engine/lua.cpp
===================================================================
--- residual/trunk/engine/lua.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/lua.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -422,7 +422,7 @@
 static void SetSayLineDefaults() {
 	char *key_text = NULL;
 	lua_Object table_obj;
-	lua_Object key;
+	lua_Object key = LUA_NOOBJECT;
 
 	DEBUG_FUNCTION();
 	table_obj = lua_getparam(1);
@@ -2326,7 +2326,7 @@
 
 void getTextObjectParams(TextObject *textObject, lua_Object table_obj) {
 	char *key_text = NULL;
-	lua_Object key;
+	lua_Object key = LUA_NOOBJECT;
 	
 	DEBUG_FUNCTION();
 	for (;;) {
@@ -2640,7 +2640,7 @@
 
 static void DrawPolygon() {
 	lua_Object tableObj1, tableObj2, pointObj;
-	int x1, y1, x2, y2, x3, y3, x4, y4;
+	int x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0, x4 = 0, y4 = 0;
 	Color color;
 
 	color._vals[0] = 255;
@@ -3918,7 +3918,7 @@
 
 lua_Object getTableValue(lua_Object table, char *name) {
 	char *key_text = NULL;
-	lua_Object key;
+	lua_Object key = LUA_NOOBJECT;
 
 	if (!lua_istable(table)) {
 		error("getTableValue(): Parameter not a table!\n");

Modified: residual/trunk/engine/scene.cpp
===================================================================
--- residual/trunk/engine/scene.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/scene.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -242,7 +242,7 @@
 void Scene::findClosestSector(Vector3d p, Sector **sect, Vector3d *closestPt) {
 	Sector *resultSect = NULL;
 	Vector3d resultPt = p;
-	float minDist;
+	float minDist = 0.0;
 
 	for (int i = 0; i < _numSectors; i++) {
 		Sector *sector = _sectors + i;

Modified: residual/trunk/engine/smush/blocky16.cpp
===================================================================
--- residual/trunk/engine/smush/blocky16.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/smush/blocky16.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -429,7 +429,7 @@
 
 void Blocky16::level2(byte *d_dst) {
 	int32 tmp2;
-	uint32 t, val;
+	uint32 t = 0, val;
 	byte code = *_d_src++;
 	int i;
 
@@ -510,7 +510,7 @@
 
 void Blocky16::level1(byte *d_dst) {
 	int32 tmp2;
-	uint32 t, val;
+	uint32 t = 0, val;
 	byte code = *_d_src++;
 	int i;
 

Modified: residual/trunk/engine/tinygl/ztriangle.cpp
===================================================================
--- residual/trunk/engine/tinygl/ztriangle.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/tinygl/ztriangle.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -130,7 +130,7 @@
 
 #define NB_INTERP 8
 
-	ZBufferPoint *t, *pr1, *pr2, *l1, *l2;
+	ZBufferPoint *t, *pr1 = 0, *pr2 = 0, *l1 = 0, *l2 = 0;
 	float fdx1, fdx2, fdy1, fdy2, fz, d1, d2;
 	unsigned short *pz1;
 	unsigned long *pz2;
@@ -139,19 +139,19 @@
 
 	int nb_lines, dx1, dy1, tmp, dx2, dy2;
 
-	int error, derror;
-	int x1, dxdy_min, dxdy_max;
+	int error = 0, derror = 0;
+	int x1 = 0, dxdy_min = 0, dxdy_max = 0;
 	// warning: x2 is multiplied by 2^16
-	int x2, dx2dy2;  
+	int x2 = 0, dx2dy2 = 0;
 
-	int z1, dzdx, dzdy, dzdl_min, dzdl_max;
+	int z1 = 0, dzdx, dzdy, dzdl_min = 0, dzdl_max = 0;
 
-	int r1, drdx, drdy, drdl_min, drdl_max;
-	int g1, dgdx, dgdy, dgdl_min, dgdl_max;
-	int b1, dbdx, dbdy, dbdl_min, dbdl_max;
+	int r1 = 0, drdx, drdy, drdl_min = 0, drdl_max = 0;
+	int g1 = 0, dgdx, dgdy, dgdl_min = 0, dgdl_max = 0;
+	int b1 = 0, dbdx, dbdy, dbdl_min = 0, dbdl_max = 0;
 
-	float sz1, dszdx, dszdy, dszdl_min, dszdl_max;
-	float tz1, dtzdx, dtzdy, dtzdl_min, dtzdl_max;
+	float sz1 = 0.0, dszdx, dszdy, dszdl_min = 0.0, dszdl_max = 0.0;
+	float tz1 = 0.0, dtzdx, dtzdy, dtzdl_min = 0.0, dtzdl_max = 0.0;
 
 	// we sort the vertex with increasing y
 	if (p1->y < p0->y) {

Modified: residual/trunk/engine/tinygl/ztriangle.h
===================================================================
--- residual/trunk/engine/tinygl/ztriangle.h	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/tinygl/ztriangle.h	2008-07-13 10:53:39 UTC (rev 33028)
@@ -2,7 +2,7 @@
 // We draw a triangle with various interpolations
 
 {
-	ZBufferPoint *t, *pr1, *pr2, *l1, *l2;
+	ZBufferPoint *t, *pr1 = 0, *pr2 = 0, *l1 = 0, *l2 = 0;
 	float fdx1, fdx2, fdy1, fdy2, fz, d1, d2;
 	unsigned short *pz1;
 	unsigned long *pz2;
@@ -11,22 +11,22 @@
 
 	int nb_lines, dx1, dy1, tmp, dx2, dy2;
 
-	int error, derror;
-	int x1, dxdy_min, dxdy_max;
+	int error = 0, derror = 0;
+	int x1 = 0, dxdy_min = 0, dxdy_max = 0;
 	// warning: x2 is multiplied by 2^16
-	int x2, dx2dy2;  
+	int x2 = 0, dx2dy2 = 0;
 
 #ifdef INTERP_Z
-	int z1, dzdx, dzdy, dzdl_min, dzdl_max;
+	int z1 = 0, dzdx, dzdy, dzdl_min = 0, dzdl_max = 0;
 #endif
 #ifdef INTERP_RGB
-	int r1, drdx, drdy, drdl_min, drdl_max;
-	int g1, dgdx, dgdy, dgdl_min, dgdl_max;
-	int b1, dbdx, dbdy, dbdl_min, dbdl_max;
+	int r1 = 0, drdx, drdy, drdl_min = 0, drdl_max = 0;
+	int g1 = 0, dgdx, dgdy, dgdl_min = 0, dgdl_max = 0;
+	int b1 = 0, dbdx, dbdy, dbdl_min = 0, dbdl_max = 0;
 #endif
 #ifdef INTERP_ST
-	int s1, dsdx, dsdy, dsdl_min, dsdl_max;
-	int t1, dtdx, dtdy, dtdl_min, dtdl_max;
+	int s1 = 0, dsdx, dsdy, dsdl_min = 0, dsdl_max = 0;
+	int t1 = 0, dtdx, dtdy, dtdl_min = 0, dtdl_max = 0;
 #endif
 #ifdef INTERP_STZ
 	float sz1, dszdx, dszdy, dszdl_min, dszdl_max;

Modified: residual/trunk/engine/tinygl/ztriangle_shadow.cpp
===================================================================
--- residual/trunk/engine/tinygl/ztriangle_shadow.cpp	2008-07-13 10:50:57 UTC (rev 33027)
+++ residual/trunk/engine/tinygl/ztriangle_shadow.cpp	2008-07-13 10:53:39 UTC (rev 33028)
@@ -4,17 +4,17 @@
 #define ZCMP(z, zpix) ((z) >= (zpix))
 
 void ZB_fillTriangleFlatShadowMask(ZBuffer *zb, ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2) {
-	ZBufferPoint *t, *pr1, *pr2, *l1, *l2;
+	ZBufferPoint *t, *pr1 = 0, *pr2 = 0, *l1 = 0, *l2 = 0;
 	float fdx1, fdx2, fdy1, fdy2, fz;
 	unsigned char *pm1;
 	int part, update_left, update_right;
 
 	int nb_lines, dx1, dy1, tmp, dx2, dy2;
 
-	int error, derror;
-	int x1, dxdy_min, dxdy_max;
+	int error = 0, derror = 0;
+	int x1 = 0, dxdy_min = 0, dxdy_max = 0;
 	// warning: x2 is multiplied by 2^16
-	int x2, dx2dy2;  
+	int x2 = 0, dx2dy2 = 0;
 
 	// we sort the vertex with increasing y
 	if (p1->y < p0->y) {
@@ -160,7 +160,7 @@
 
 void ZB_fillTriangleFlatShadow(ZBuffer *zb, ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2) {
 	int color;
-	ZBufferPoint *t, *pr1, *pr2, *l1, *l2;
+	ZBufferPoint *t, *pr1 = 0, *pr2 = 0, *l1 = 0, *l2 = 0;
 	float fdx1, fdx2, fdy1, fdy2, fz, d1, d2;
 	unsigned char *pm1;
 	unsigned short *pz1;
@@ -170,12 +170,12 @@
 
 	int nb_lines, dx1, dy1, tmp, dx2, dy2;
 
-	int error, derror;
-	int x1, dxdy_min, dxdy_max;
+	int error = 0, derror = 0;
+	int x1 = 0, dxdy_min = 0, dxdy_max = 0;
 	// warning: x2 is multiplied by 2^16
-	int x2, dx2dy2;  
+	int x2 = 0, dx2dy2 = 0;
 
-	int z1, dzdx, dzdy, dzdl_min, dzdl_max;
+	int z1 = 0, dzdx, dzdy, dzdl_min = 0, dzdl_max = 0;
 
 	// we sort the vertex with increasing y
 	if (p1->y < p0->y) {


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