[Scummvm-cvs-logs] SF.net SVN: scummvm:[42151] tools/branches/gsoc2009-gui
remere at users.sourceforge.net
remere at users.sourceforge.net
Sun Jul 5 23:14:23 CEST 2009
Revision: 42151
http://scummvm.svn.sourceforge.net/scummvm/?rev=42151&view=rev
Author: remere
Date: 2009-07-05 21:14:23 +0000 (Sun, 05 Jul 2009)
Log Message:
-----------
*Updated makefile, you can now only compile the extraction/compression tools into the GUI. You can no longer compile them independently (although it is theoretically possible by using -DSTANDALONE_MAIN). In$
*Stifled many compiler warnings. Also changed compiler flags alittle.
*compress_tinsel / extract_cine will not compile (and there is no make for them eihter)
Modified Paths:
--------------
tools/branches/gsoc2009-gui/Makefile
tools/branches/gsoc2009-gui/compress.cpp
tools/branches/gsoc2009-gui/compress_agos.cpp
tools/branches/gsoc2009-gui/compress_gob.cpp
tools/branches/gsoc2009-gui/compress_kyra.cpp
tools/branches/gsoc2009-gui/compress_queen.cpp
tools/branches/gsoc2009-gui/compress_saga.cpp
tools/branches/gsoc2009-gui/compress_scumm_bun.cpp
tools/branches/gsoc2009-gui/compress_scumm_san.cpp
tools/branches/gsoc2009-gui/compress_scumm_sou.cpp
tools/branches/gsoc2009-gui/compress_sword1.cpp
tools/branches/gsoc2009-gui/compress_sword2.cpp
tools/branches/gsoc2009-gui/compress_tinsel.cpp
tools/branches/gsoc2009-gui/compress_touche.cpp
tools/branches/gsoc2009-gui/compress_tucker.cpp
tools/branches/gsoc2009-gui/extract_gob_stk.cpp
tools/branches/gsoc2009-gui/extract_kyra.cpp
tools/branches/gsoc2009-gui/extract_loom_tg16.cpp
tools/branches/gsoc2009-gui/extract_mm_apple.cpp
tools/branches/gsoc2009-gui/extract_mm_c64.cpp
tools/branches/gsoc2009-gui/extract_parallaction.cpp
tools/branches/gsoc2009-gui/extract_scumm_mac.cpp
tools/branches/gsoc2009-gui/extract_zak_c64.cpp
tools/branches/gsoc2009-gui/kyra_pak.cpp
tools/branches/gsoc2009-gui/util.cpp
tools/branches/gsoc2009-gui/util.h
Modified: tools/branches/gsoc2009-gui/Makefile
===================================================================
--- tools/branches/gsoc2009-gui/Makefile 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/Makefile 2009-07-05 21:14:23 UTC (rev 42151)
@@ -7,7 +7,10 @@
srcdir ?= .
-DEFINES := -DUNIX -DEXPORT_MAIN
+DEFINES := -DUNIX
+STANDALONE :=
+# This one will go away once all tools are converted
+NO_MAIN := -DEXPORT_MAIN
LDFLAGS := $(LDFLAGS)
INCLUDES := -I. -I$(srcdir)
LIBS :=
@@ -19,7 +22,7 @@
# manually create a config.mk files with overrides, if needed.
-include config.mk
-CXXFLAGS += -g -O -Wuninitialized
+CXXFLAGS += -g -O
# Additional warnings
CXXFLAGS:= -Wall $(CXXFLAGS)
@@ -27,7 +30,7 @@
CXXFLAGS+= -Wno-long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reorder
# Enable even more warnings...
#CXXFLAGS+= -pedantic # -pedantic is too pedantic, at least on Mac OS X
-CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wconversion
+CXXFLAGS+= -Wpointer-arith -Wcast-qual -Wuninitialized -Wcast-align -Wconversion
CXXFLAGS+= -Wshadow -Wimplicit -Wundef -Wnon-virtual-dtor -Wwrite-strings
# Enable checking of pointers returned by "new"
@@ -58,37 +61,11 @@
#######################################################################
TARGETS := \
- compress_agos$(EXEEXT) \
- compress_gob$(EXEEXT) \
- compress_kyra$(EXEEXT) \
- compress_queen$(EXEEXT) \
- compress_saga$(EXEEXT) \
- compress_scumm_bun$(EXEEXT) \
- compress_scumm_san$(EXEEXT) \
- compress_scumm_sou$(EXEEXT) \
- compress_sword1$(EXEEXT) \
- compress_sword2$(EXEEXT) \
- compress_tinsel$(EXEEXT) \
- compress_touche$(EXEEXT) \
- compress_tucker$(EXEEXT) \
decine$(EXEEXT) \
dekyra$(EXEEXT) \
descumm$(EXEEXT) \
desword2$(EXEEXT) \
degob$(EXEEXT) \
- encode_dxa$(EXEEXT) \
- extract_agos$(EXEEXT) \
- extract_cine$(EXEEXT) \
- extract_kyra$(EXEEXT) \
- extract_loom_tg16$(EXEEXT) \
- extract_mm_apple$(EXEEXT) \
- extract_mm_c64$(EXEEXT) \
- extract_mm_nes$(EXEEXT) \
- extract_parallaction$(EXEEXT) \
- extract_scumm_mac$(EXEEXT) \
- extract_t7g_mac$(EXEEXT) \
- extract_zak_c64$(EXEEXT) \
- extract_gob_stk$(EXEEXT) \
tools_gui$(EXEEXT)
UTILS := \
@@ -115,44 +92,44 @@
cp $(TARGETS) $(bundle_name)/Contents/Resources/
mv $(bundle_name)/Contents/Resources/tools_gui $(bundle_name)/Contents/MacOS/
-compress_agos$(EXEEXT): compress_agos.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_agos$(EXEEXT): compress_agos.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_gob$(EXEEXT): compress_gob.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#compress_gob$(EXEEXT): compress_gob.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-compress_kyra$(EXEEXT): compress_kyra.o kyra_pak.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_kyra$(EXEEXT): compress_kyra.o kyra_pak.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_queen$(EXEEXT): compress_queen.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_queen$(EXEEXT): compress_queen.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_saga$(EXEEXT): compress_saga.o compress.o util.o $(UTILS)
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_saga$(EXEEXT): compress_saga.o compress.o util.o tool.o $(UTILS)
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_scumm_bun$(EXEEXT): compress_scumm_bun.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_scumm_bun$(EXEEXT): compress_scumm_bun.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_scumm_san$(EXEEXT): compress_scumm_san.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lz -lvorbis -logg -lvorbisenc -lFLAC
+#compress_scumm_san$(EXEEXT): compress_scumm_san.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lz -lvorbis -logg -lvorbisenc -lFLAC
-compress_scumm_sou$(EXEEXT): compress_scumm_sou.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_scumm_sou$(EXEEXT): compress_scumm_sou.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_sword1$(EXEEXT): compress_sword1.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_sword1$(EXEEXT): compress_sword1.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_sword2$(EXEEXT): compress_sword2.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_sword2$(EXEEXT): compress_sword2.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_tinsel$(EXEEXT): compress_tinsel.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_tinsel$(EXEEXT): compress_tinsel.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_touche$(EXEEXT): compress_touche.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_touche$(EXEEXT): compress_touche.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
-compress_tucker$(EXEEXT): compress_tucker.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
+#compress_tucker$(EXEEXT): compress_tucker.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lvorbis -logg -lvorbisenc -lFLAC
decine$(EXEEXT): decine.o
$(CXX) $(LDFLAGS) -o $@ $+
@@ -160,60 +137,60 @@
dekyra$(EXEEXT): dekyra.o dekyra_v1.o util.o
$(CXX) $(LDFLAGS) -o $@ $+
-descumm$(EXEEXT): descumm-tool.o descumm.o descumm6.o descumm-common.o util.o
+descumm$(EXEEXT): descumm-tool.o descumm.o descumm6.o descumm-common.o util.o tool.o
$(CXX) $(LDFLAGS) -o $@ $+
-desword2$(EXEEXT): desword2.o util.o
+desword2$(EXEEXT): desword2.o util.o tool.o
$(CXX) $(LDFLAGS) -o $@ $+
-degob$(EXEEXT): degob.o degob_script.o degob_script_v1.o degob_script_v2.o degob_script_v3.o degob_script_v4.o degob_script_v5.o degob_script_v6.o degob_script_bargon.o util.o
+degob$(EXEEXT): degob.o degob_script.o degob_script_v1.o degob_script_v2.o degob_script_v3.o degob_script_v4.o degob_script_v5.o degob_script_v6.o degob_script_bargon.o util.o tool.o
$(CXX) $(LDFLAGS) -o $@ $+
-encode_dxa$(EXEEXT): encode_dxa.o compress.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+ -lpng -lz -lvorbis -logg -lvorbisenc -lFLAC
+#encode_dxa$(EXEEXT): encode_dxa.o compress.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+ -lpng -lz -lvorbis -logg -lvorbisenc -lFLAC
-extract_cine$(EXEEXT): extract_cine.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_cine$(EXEEXT): extract_cine.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_agos$(EXEEXT): extract_agos.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_agos$(EXEEXT): extract_agos.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_gob_stk$(EXEEXT): extract_gob_stk.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_gob_stk$(EXEEXT): extract_gob_stk.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_kyra$(EXEEXT): extract_kyra.o kyra_pak.o kyra_ins.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_kyra$(EXEEXT): extract_kyra.o kyra_pak.o kyra_ins.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_loom_tg16$(EXEEXT): extract_loom_tg16.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_loom_tg16$(EXEEXT): extract_loom_tg16.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_mm_apple$(EXEEXT): extract_mm_apple.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_mm_apple$(EXEEXT): extract_mm_apple.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_mm_c64$(EXEEXT): extract_mm_c64.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_mm_c64$(EXEEXT): extract_mm_c64.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_mm_nes$(EXEEXT): extract_mm_nes.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_mm_nes$(EXEEXT): extract_mm_nes.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_parallaction$(EXEEXT): extract_parallaction.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_parallaction$(EXEEXT): extract_parallaction.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_scumm_mac$(EXEEXT): extract_scumm_mac.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_scumm_mac$(EXEEXT): extract_scumm_mac.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_t7g_mac$(EXEEXT): extract_t7g_mac.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_t7g_mac$(EXEEXT): extract_t7g_mac.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
-extract_zak_c64$(EXEEXT): extract_zak_c64.o util.o
- $(CXX) $(LDFLAGS) -o $@ $+
+#extract_zak_c64$(EXEEXT): extract_zak_c64.o util.o tool.o
+# $(CXX) $(LDFLAGS) -o $@ $+
tools_gui$(EXEEXT): gui/main.o gui/pages.o gui/tools.o compress_agos.o compress_gob.o compress_kyra.o \
compress_queen.o compress_saga.o compress_scumm_bun.o compress_scumm_san.o compress_scumm_sou.o \
compress_sword1.o compress_sword2.o compress_touche.o compress_tucker.o encode_dxa.o \
extract_agos.o extract_gob_stk.o extract_kyra.o extract_loom_tg16.o extract_mm_apple.o \
extract_mm_c64.o extract_mm_nes.o extract_parallaction.o extract_scumm_mac.o \
- extract_zak_c64.o kyra_pak.o kyra_ins.o compress.o util.o $(UTILS)
+ extract_zak_c64.o kyra_pak.o kyra_ins.o compress.o util.o tool.o $(UTILS)
$(CXX) $(LDFLAGS) -o $@ $+ `wx-config --libs` -lpng -lz -lvorbis -logg -lvorbisenc -lFLAC
sword2_clue$(EXEEXT): sword2_clue.o util.o
@@ -251,7 +228,7 @@
%.o: %.cpp
$(MKDIR) $(*D)/$(DEPDIR)
- $(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+ $(CXX) $(NO_MAIN) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
# Include the dependency tracking files.
-include $(wildcard $(addsuffix /*.d,$(DEPDIRS)))
Modified: tools/branches/gsoc2009-gui/compress.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -415,7 +415,7 @@
}
}
- printf(outputString);
+ puts(outputString);
vorbis_encode_setup_init(&vi);
vorbis_comment_init(&vc);
@@ -922,7 +922,7 @@
if (!process_flac_parms(argc - 2, argv, i))
return AUDIO_NONE;
break;
- case AUDIO_NONE: // cannot occur but we check anyway to avoid compiler warnings
+ default: // cannot occur but we check anyway to avoid compiler warnings
break;
}
Modified: tools/branches/gsoc2009-gui/compress_agos.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_agos.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_agos.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -111,7 +111,7 @@
}
/* Append the converted data to the master output file */
- sprintf(outname, tempEncoded);
+ sprintf(outname, "%s", tempEncoded);
File f(outname, "rb");
tot_size = 0;
while ((size = fread(fbuf, 1, 2048, f)) > 0) {
Modified: tools/branches/gsoc2009-gui/compress_gob.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_gob.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_gob.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -538,9 +538,8 @@
}
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_gob)(argc, argv);
}
-#endif
\ No newline at end of file
+#endif
Modified: tools/branches/gsoc2009-gui/compress_kyra.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_kyra.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_kyra.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -421,8 +421,7 @@
error("Unknown filetype of file: '%s'", infile->getFullPath().c_str());
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_kyra)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_queen.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_queen.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_queen.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -385,8 +385,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALON_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_queen)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_saga.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_saga.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_saga.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -495,8 +495,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_saga)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_scumm_bun.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_scumm_bun.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_scumm_bun.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -1196,8 +1196,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_scumm_bun)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_scumm_san.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_scumm_san.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_scumm_san.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -217,7 +217,7 @@
int bsize = size - 18;
byte output_data[0x1000];
byte *src = (byte *)malloc(bsize);
- fread(src, bsize, 1, input);
+ (void)fread(src, bsize, 1, input);
sprintf(tmpPath, "%s/%s.wav", outputDir, inputFilename);
decompressComiIACT(tmpPath, output_data, src, bsize);
@@ -265,7 +265,7 @@
int fileSize = ftell(_audioTracks[l].file);
fseek(_audioTracks[l].file, 0, SEEK_SET);
byte *audioBuf = (byte *)malloc(fileSize);
- fread(audioBuf, fileSize, 1, _audioTracks[l].file);
+ (void)fread(audioBuf, fileSize, 1, _audioTracks[l].file);
fclose(_audioTracks[l].file);
_audioTracks[l].file = NULL;
@@ -402,13 +402,13 @@
int fileSize = ftell(_audioTracks[l].file);
fseek(_audioTracks[l].file, 0, SEEK_SET);
byte *tmpBuf = (byte *)malloc(fileSize);
- fread(tmpBuf, fileSize, 1, _audioTracks[l].file);
+ (void)fread(tmpBuf, fileSize, 1, _audioTracks[l].file);
fclose(_audioTracks[l].file);
unlink(filename);
byte *wavBuf = (byte *)malloc(fileSize);
fseek(wavFile, 44 + (frameAudioSize * _audioTracks[l].animFrame), SEEK_SET);
- fread(wavBuf, fileSize, 1, wavFile);
+ (void)fread(wavBuf, fileSize, 1, wavFile);
int offset = 0;
for (z = 0; z < _audioTracks[l].countFrames; z++) {
@@ -562,7 +562,7 @@
}
}
byte *buffer = (byte *)malloc(size);
- fread(buffer, size, 1, input);
+ (void)fread(buffer, size, 1, input);
fwrite(buffer, size, 1, audioTrack->file);
free(buffer);
audioTrack->volumes[index] = volume;
@@ -891,8 +891,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_scumm_san)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_scumm_sou.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_scumm_sou.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_scumm_sou.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -212,8 +212,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_scumm_sou)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_sword1.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_sword1.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_sword1.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -645,8 +645,7 @@
return EXIT_SUCCESS;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_sword1)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_sword2.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_sword2.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_sword2.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -239,8 +239,7 @@
return EXIT_SUCCESS;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_sword2)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_tinsel.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_tinsel.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_tinsel.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -25,6 +25,8 @@
#include "compress.h"
#include "util.h"
+#if 0
+
// data-format of index-file:
// [pointer to data file DWORD] [pointer to data file DWORD] [pointer to data file DWORD]
// we use index[0] to signal the engine what data format it's supposed to expect. It may be 'MP3 ', 'OGG ' or 'FLAC'
@@ -407,3 +409,6 @@
return 0;
}
+
+#endif
+
Modified: tools/branches/gsoc2009-gui/compress_touche.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_touche.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_touche.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -221,8 +221,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_touche)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/compress_tucker.cpp
===================================================================
--- tools/branches/gsoc2009-gui/compress_tucker.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/compress_tucker.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -458,8 +458,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(compress_tucker)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_gob_stk.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_gob_stk.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_gob_stk.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -35,7 +35,7 @@
Chunk *next;
Chunk() : next(0) { }
- ~Chunk() : { delete next; }
+ ~Chunk() { delete next; }
};
ExtractGobStk::ExtractGobStk(const std::string &name) : Tool(name) {
@@ -77,7 +77,7 @@
stk.read(signature, 1, 6);
if (strncmp(signature, "STK2.1", 6) == 0) {
- print("Signature of new STK format (STK 2.1) detected in file \"%s\"", inpath.getFullPath());
+ print("Signature of new STK format (STK 2.1) detected in file \"%s\"", inpath.getFullPath().c_str());
fprintf(gobConf, "%s\n", confSTK21);
readChunkListV2(stk, gobConf);
} else {
Modified: tools/branches/gsoc2009-gui/extract_kyra.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_kyra.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_kyra.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -113,8 +113,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_kyra)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_loom_tg16.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_loom_tg16.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_loom_tg16.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -1415,8 +1415,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_loom_tg16)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_mm_apple.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_apple.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_mm_apple.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -177,8 +177,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_mm_apple)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_mm_c64.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_mm_c64.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_mm_c64.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -175,8 +175,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_mm_c64)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_parallaction.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_parallaction.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_parallaction.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -348,8 +348,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_parallaction)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_scumm_mac.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_scumm_mac.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_scumm_mac.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -155,8 +155,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_scumm_mac)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/extract_zak_c64.cpp
===================================================================
--- tools/branches/gsoc2009-gui/extract_zak_c64.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/extract_zak_c64.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -177,8 +177,7 @@
return 0;
}
-#if defined(UNIX) && defined(EXPORT_MAIN)
-int main(int argc, char *argv[]) __attribute__((weak));
+#ifdef STANDALONE_MAIN
int main(int argc, char *argv[]) {
return export_main(extract_zak_c64)(argc, argv);
}
Modified: tools/branches/gsoc2009-gui/kyra_pak.cpp
===================================================================
--- tools/branches/gsoc2009-gui/kyra_pak.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/kyra_pak.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -96,7 +96,7 @@
uint8 *buffer = new uint8[filesize];
assert(buffer);
- fread(buffer, filesize, 1, pakfile);
+ (void)fread(buffer, filesize, 1, pakfile);
fclose(pakfile);
@@ -477,7 +477,7 @@
outputPath->setFullName(cur->filename);
FILE *file = fopen(outputPath->getFullPath().c_str(), "wb");
if (!file) {
- error("couldn't open file '%s' for writing", outputPath->getFullPath());
+ error("couldn't open file '%s' for writing", outputPath->getFullPath().c_str());
return false;
}
printf("Exracting file '%s'...", cur->filename);
Modified: tools/branches/gsoc2009-gui/util.cpp
===================================================================
--- tools/branches/gsoc2009-gui/util.cpp 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/util.cpp 2009-07-05 21:14:23 UTC (rev 42151)
@@ -336,33 +336,33 @@
uint16 File::readU16BE() {
uint16 ret = 0;
- ret |= readByte() << 8;
- ret |= readByte();
+ ret |= uint16(readByte() << 8ul);
+ ret |= uint16(readByte());
return ret;
}
uint16 File::readU16LE() {
uint16 ret = 0;
- ret |= readByte();
- ret |= readByte() << 8;
+ ret |= uint16(readByte());
+ ret |= uint16(readByte() << 8ul);
return ret;
}
uint32 File::readU32BE() {
uint32 ret = 0;
- ret |= readByte() << 24;
- ret |= readByte() << 16;
- ret |= readByte() << 8;
- ret |= readByte();
+ ret |= uint32(readByte() << 24);
+ ret |= uint32(readByte() << 16);
+ ret |= uint32(readByte() << 8);
+ ret |= uint32(readByte());
return ret;
}
uint32 File::readU32LE() {
uint32 ret = 0;
- ret |= readByte();
- ret |= readByte() << 8;
- ret |= readByte() << 16;
- ret |= readByte() << 24;
+ ret |= uint32(readByte());
+ ret |= uint32(readByte() << 8);
+ ret |= uint32(readByte() << 16);
+ ret |= uint32(readByte() << 24);
return ret;
}
Modified: tools/branches/gsoc2009-gui/util.h
===================================================================
--- tools/branches/gsoc2009-gui/util.h 2009-07-05 19:58:09 UTC (rev 42150)
+++ tools/branches/gsoc2009-gui/util.h 2009-07-05 21:14:23 UTC (rev 42151)
@@ -142,12 +142,12 @@
#endif
static inline uint32 SWAP_32(uint32 a) {
- return ((a >> 24) & 0xFF) | ((a >> 8) & 0xFF00) | ((a << 8) & 0xFF0000) |
- ((a << 24) & 0xFF000000);
+ return uint16(((a >> 24) & 0xFF) | ((a >> 8) & 0xFF00) | ((a << 8) & 0xFF0000) |
+ ((a << 24) & 0xFF000000));
}
static inline uint16 SWAP_16(uint16 a) {
- return ((a >> 8) & 0xFF) | ((a << 8) & 0xFF00);
+ return uint16(((a >> 8) & 0xFF) | ((a << 8) & 0xFF00));
}
#ifndef FORCEINLINE
@@ -156,7 +156,7 @@
FORCEINLINE uint16 READ_LE_UINT16(const void *ptr) {
const byte *b = (const byte *)ptr;
- return (b[1] << 8) + b[0];
+ return uint16((b[1] << 8) + b[0]);
}
FORCEINLINE uint32 READ_LE_UINT32(const void *ptr) {
const byte *b = (const byte *)ptr;
@@ -177,11 +177,11 @@
FORCEINLINE uint16 READ_BE_UINT16(const void *ptr) {
const byte *b = (const byte *)ptr;
- return (b[0] << 8) + b[1];
+ return uint16((b[0] << 8) + b[1]);
}
FORCEINLINE uint32 READ_BE_UINT32(const void *ptr) {
const byte *b = (const byte *)ptr;
- return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
+ return uint32((b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]));
}
FORCEINLINE void WRITE_BE_UINT16(void *ptr, uint16 value) {
byte *b = (byte *)ptr;
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