[Scummvm-cvs-logs] SF.net SVN: scummvm:[38282] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sun Feb 15 20:15:44 CET 2009


Revision: 38282
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38282&view=rev
Author:   fingolfin
Date:     2009-02-15 19:15:43 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
cleanup, fixed warnings

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kfile.cpp
    scummvm/trunk/engines/sci/engine/message.cpp
    scummvm/trunk/engines/sci/gfx/font.cpp
    scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
    scummvm/trunk/engines/sci/gfx/widgets.cpp
    scummvm/trunk/engines/sci/include/game_select.h
    scummvm/trunk/engines/sci/include/list.h
    scummvm/trunk/engines/sci/include/resource.h
    scummvm/trunk/engines/sci/include/sci_dos.h
    scummvm/trunk/engines/sci/scicore/decompress01.cpp
    scummvm/trunk/engines/sci/scicore/resource.cpp
    scummvm/trunk/engines/sci/sfx/iterator.cpp
    scummvm/trunk/engines/sci/sfx/player/polled.cpp

Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -31,10 +31,6 @@
 
 
 #ifdef _WIN32
-#define MAX_PATHLEN MAXPATHLEN
-#  ifndef PATH_MAX
-#    define PATH_MAX 255
-#  endif
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 #  include <sys/types.h>
@@ -414,7 +410,7 @@
 reg_t
 kDeviceInfo_Win32(state_t *s, int funct_nr, int argc, reg_t *argv)
 {
-	char dir_buffer [MAXPATHLEN], dir_buffer2 [MAX_PATHLEN];
+	char dir_buffer[MAXPATHLEN], dir_buffer2[MAXPATHLEN];
 	int mode = UKPV(0);
 
 

Modified: scummvm/trunk/engines/sci/engine/message.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/message.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/engine/message.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -222,7 +222,7 @@
 
 void message_state_initialize(resource_mgr_t *resmgr, message_state_t *state)
 {
-	resource_t *tester = scir_find_resource(resmgr, sci_message, 0, 0);
+//	resource_t *tester = scir_find_resource(resmgr, sci_message, 0, 0);
 	//int version;
 
 //	if (tester == NULL) return;

Modified: scummvm/trunk/engines/sci/gfx/font.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/font.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/gfx/font.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -319,7 +319,7 @@
 	int fore_0, fore_1, back;
 	int i;
 	int hack = 0;
-	gfx_pixmap_color_t dummy = {0};
+	gfx_pixmap_color_t dummy = {0, 0, 0, 0};
 	byte *offset;
 
 	for (i = 0; i < characters; i++) {

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -123,10 +123,8 @@
 void
 gfxr_init_static_palette()
 {
-	int i;
-
 	if (!_gfxr_pic0_colors_initialized) {
-		for (i = 0; i < 256; i++) {
+		for (int i = 0; i < 256; i++) {
 			gfx_sci0_pic_colors[i].global_index = GFX_COLOR_INDEX_UNMAPPED;
 			gfx_sci0_pic_colors[i].r = INTERCOL(gfx_sci0_image_colors[sci0_palette][i & 0xf].r,
 							    gfx_sci0_image_colors[sci0_palette][i >> 4].r);
@@ -285,7 +283,6 @@
 	int y = line.y + sci_titlebar_size;
 	unsigned char *buffer = pic->aux_map;
 	int linewidth = 320;
-	int color2 = color;
 
 	dx = line.xl;
 	dy = line.yl;
@@ -341,14 +338,13 @@
 		| (bitmask << (3+8))
 		| (bitmask << (3+16))
 		| (bitmask << (3+24));
-	int i;
 
 	if (sizeof(unsigned long) == 8) { /* UltraSparc, Alpha, newer MIPSens, etc */
 		andmask |= (andmask << 32);
 		clearmask |= (clearmask << 32);
 	}
 
-	for (i = 0; i < GFXR_AUX_MAP_SIZE / sizeof(unsigned long); i++) {
+	for (int i = 0; i < GFXR_AUX_MAP_SIZE / sizeof(unsigned long); i++) {
 		unsigned long temp = *data & andmask;
 		temp >>= 3;
 		*data = (temp | *data) & clearmask;
@@ -1396,7 +1392,6 @@
 	};
 	int palette[GFXR_PIC0_NUM_PALETTES][GFXR_PIC0_PALETTE_SIZE];
 	int priority_table[GFXR_PIC0_PALETTE_SIZE];
-	int i;
 	int drawenable = GFX_MASK_VISUAL | GFX_MASK_PRIORITY;
 	int priority = 0;
 	int color = 0;
@@ -1420,7 +1415,7 @@
 #endif /* FILL_RECURSIVE_DEBUG */
 
 	/* Initialize palette */
-	for (i = 0; i < GFXR_PIC0_NUM_PALETTES; i++)
+	for (int i = 0; i < GFXR_PIC0_NUM_PALETTES; i++)
 		memcpy(palette[i], default_palette_table, sizeof(int) * GFXR_PIC0_PALETTE_SIZE);
 
 	memcpy(priority_table, default_priority_table, sizeof(int) * GFXR_PIC0_PALETTE_SIZE);
@@ -1839,7 +1834,6 @@
 
 			case PIC_SCI0_OPX_SET_PRIORITY_TABLE: 
 			case PIC_SCI1_OPX_PRIORITY_TABLE_EXPLICIT: {
-				int i;
 				int *pri_table;
 
 				p0printf("Explicit priority table @%d\n", pos);
@@ -1856,7 +1850,7 @@
 				pri_table[0] = 0;
 				pri_table[15] = 190;
 
-				for (i = 1; i < 15; i++)
+				for (int i = 1; i < 15; i++)
 					pri_table[i] = resource[pos++];
 			}
 				goto end_op_loop;

Modified: scummvm/trunk/engines/sci/gfx/widgets.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/widgets.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/gfx/widgets.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -2472,7 +2472,7 @@
 gfxw_get_chrono_port(gfxw_visual_t *visual, gfxw_list_t **temp_widgets_list, int flags)
 {
 	gfxw_port_t *result = NULL;
-	gfx_color_t transparent = {0};
+	gfx_color_t transparent = {{0, 0, 0, 0}, 0, 0, 0, 0};
 	int id = 0;
 
 	if (!(flags & GFXW_CHRONO_NON_TOPMOST))

Modified: scummvm/trunk/engines/sci/include/game_select.h
===================================================================
--- scummvm/trunk/engines/sci/include/game_select.h	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/include/game_select.h	2009-02-15 19:15:43 UTC (rev 38282)
@@ -1,12 +1,12 @@
-#include "list.h"
-
 #ifndef _SCI_GAME_SELECT_H
 #define _SCI_GAME_SELECT_H
 
+#include "sci/include/list.h"
+
 typedef struct game
 {
 	char *name;
-	char dir[PATH_MAX];
+	char dir[MAXPATHLEN];
 	int conf_nr;
 } game_t;
 

Modified: scummvm/trunk/engines/sci/include/list.h
===================================================================
--- scummvm/trunk/engines/sci/include/list.h	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/include/list.h	2009-02-15 19:15:43 UTC (rev 38282)
@@ -31,11 +31,11 @@
 
 /* 2006-04-21 Modified by Walter van Niftrik. */
 
-#include <stdlib.h>
-
 #ifndef _SCI_LIST_H
 #define _SCI_LIST_H
 
+#include "common/scummsys.h"
+
 /* List definitions. */
 #define LIST_HEAD(name, type)						\
 struct name {								\

Modified: scummvm/trunk/engines/sci/include/resource.h
===================================================================
--- scummvm/trunk/engines/sci/include/resource.h	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/include/resource.h	2009-02-15 19:15:43 UTC (rev 38282)
@@ -60,7 +60,6 @@
 #ifdef SCUMMVM
 //TODO: Remove these defines by replacing their functionality by their ScummVM counterparts
 #ifndef _MSC_VER
-#define HAVE_ISBLANK
 #define HAVE_UNISTD_H
 #define HAVE_FCNTL_H
 #define HAVE_UNLINK
@@ -102,19 +101,9 @@
 
 #include "sci/include/scitypes.h"
 
-#ifdef HAVE_UNISTD_H
-#  include <unistd.h>
-#endif
+// FIXME: Mostly for close() in lots of places. Get rid of this!
+#include <unistd.h>
 
-#ifdef _WIN32
-#  include <io.h>
-#endif /* !_WIN32 */
-
-#ifdef __BEOS__
-#  include <kernel/OS.h>
-#  define usleep snooze
-#endif
-
 #ifdef _MSC_VER
 #	include <sys/timeb.h>
 #   include <fcntl.h>
@@ -150,10 +139,6 @@
 #  define G_DIR_SEPARATOR '/'
 #endif
 
-#if defined(__MORPHOS__) || defined(_MSC_VER) || defined(ARM_WINCE) || defined(__amigaos4__)
-#  define PATH_MAX 255
-#endif
-
 #ifndef MIN
 #  define MIN(a, b)  (((a) < (b)) ? (a) : (b))
 #endif
@@ -229,14 +214,6 @@
 **             (int) src: value to write
 */
 
-#ifndef HAVE_ISBLANK
-static inline int
-isblank(int foo)
-{
-	return (foo == ' ') || (foo == '\t');
-}
-#endif
-
 #ifdef _cplusplus
 #  define delete _freesci_cplusplus_workaround_delete
 #  define new _freesci_cplusplus_workaround_new
@@ -493,9 +470,3 @@
 #define WARNING(foo) {char i; i = 500;}
 
 #endif
-
-
-
-
-
-

Modified: scummvm/trunk/engines/sci/include/sci_dos.h
===================================================================
--- scummvm/trunk/engines/sci/include/sci_dos.h	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/include/sci_dos.h	2009-02-15 19:15:43 UTC (rev 38282)
@@ -74,9 +74,6 @@
 /* directory separator */
 #define G_DIR_SEPARATOR_S "/"
 
-/* paths longer than 128 chars? nah... */
-#define PATH_MAX 128
-
 #define SSIZE_MAX 1024
 
 #define g_get_current_time(x) gettimeofday(x,NULL)

Modified: scummvm/trunk/engines/sci/scicore/decompress01.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/scicore/decompress01.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -44,7 +44,7 @@
 static gint8 stak[0x1014] = {0};
 static gint8 lastchar = 0;
 static gint16 stakptr = 0;
-static guint16 numbits, bitstring, lastbits, decryptstart;
+static guint16 numbits, s_bitstring, lastbits, decryptstart;
 static gint16 curtoken, endtoken;
 
 
@@ -53,7 +53,7 @@
 void decryptinit3(void)
 {
 	int i;
-	lastchar = lastbits = bitstring = stakptr = 0;
+	lastchar = lastbits = s_bitstring = stakptr = 0;
 	numbits = 9;
 	curtoken = 0x102;
 	endtoken = 0x1ff;
@@ -73,26 +73,26 @@
 		switch (decryptstart) {
 		case 0:
 		case 1:
-			bitstring = gbits(numbits, src, complength);
-			if (bitstring == 0x101) { /* found end-of-data signal */
+			s_bitstring = gbits(numbits, src, complength);
+			if (s_bitstring == 0x101) { /* found end-of-data signal */
 				decryptstart = 4;
 				return 0;
 			}
 			if (decryptstart == 0) { /* first char */
 				decryptstart = 1;
-				lastbits = bitstring;
-				*(dest++) = lastchar = (bitstring & 0xff);
+				lastbits = s_bitstring;
+				*(dest++) = lastchar = (s_bitstring & 0xff);
 				if (--length != 0) continue;
 				return 0;
 			}
-			if (bitstring == 0x100) { /* start-over signal */
+			if (s_bitstring == 0x100) { /* start-over signal */
 				numbits = 9;
 				endtoken = 0x1ff;
 				curtoken = 0x102;
 				decryptstart = 0;
 				continue;
 			}
-			token = bitstring;
+			token = s_bitstring;
 			if (token >= curtoken) { /* index past current point */
 				token = lastbits;
 				stak[stakptr++] = lastchar;
@@ -122,7 +122,7 @@
 					endtoken++;
 				}
 			}
-			lastbits = bitstring;
+			lastbits = s_bitstring;
 			continue; /* When are "break" and "continue" synonymous? */
 		case 4:
 			return 0;

Modified: scummvm/trunk/engines/sci/scicore/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/scicore/resource.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -489,7 +489,7 @@
 	int preset_version = mgr->sci_version;
 	int resource_error = 0;
 	int dummy = mgr->sci_version;
-	resource_t **concat_ptr = &(mgr->resources[mgr->resources_nr-1].next);
+//	resource_t **concat_ptr = &(mgr->resources[mgr->resources_nr-1].next);
 
 	if (detected_version == NULL)
 		detected_version = &dummy;

Modified: scummvm/trunk/engines/sci/sfx/iterator.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/sfx/iterator.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -1879,7 +1879,7 @@
 	do {
 		retval = (*it)->next(*it, buf, result);
 		if (retval == SI_MORPH) {
-			fprintf(stderr, "  Morphing %p (stored at %p)\n", *it, it);
+			fprintf(stderr, "  Morphing %p (stored at %p)\n", (void *)*it, (void *)it);
 			if (!SIMSG_SEND((*it), SIMSG_ACK_MORPH)) {
 				BREAKPOINT();
 			} else fprintf(stderr, "SI_MORPH successful\n");

Modified: scummvm/trunk/engines/sci/sfx/player/polled.cpp
===================================================================
--- scummvm/trunk/engines/sci/sfx/player/polled.cpp	2009-02-15 19:12:21 UTC (rev 38281)
+++ scummvm/trunk/engines/sci/sfx/player/polled.cpp	2009-02-15 19:15:43 UTC (rev 38282)
@@ -30,6 +30,8 @@
 #include "sci/sfx/softseq.h"
 #include "sci/sfx/mixer.h"
 
+#include <unistd.h> // for close()
+
 static song_iterator_t *play_it;
 static int play_paused = 0;
 static sfx_softseq_t *seq;


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