diff options
author | Max Horn | 2007-09-22 07:32:28 +0000 |
---|---|---|
committer | Max Horn | 2007-09-22 07:32:28 +0000 |
commit | 79e323d6dd7a6270331068a9871b18902321ba0b (patch) | |
tree | 3be5d36051dac9911bdf291851b48994061d3fc9 | |
parent | 47b8dbbf525ecc90ca869dca7219e3c22e6f79b5 (diff) | |
download | scummvm-rg350-79e323d6dd7a6270331068a9871b18902321ba0b.tar.gz scummvm-rg350-79e323d6dd7a6270331068a9871b18902321ba0b.tar.bz2 scummvm-rg350-79e323d6dd7a6270331068a9871b18902321ba0b.zip |
Added create_kyradat to our regular build system, too; fixed some warnings (and added a FIXME about ambiguious code)
svn-id: r29012
-rw-r--r-- | tools/create_kyradat/create_kyradat.cpp | 16 | ||||
-rw-r--r-- | tools/create_kyradat/module.mk | 16 | ||||
-rw-r--r-- | tools/create_lure/module.mk | 14 | ||||
-rw-r--r-- | tools/module.mk | 9 |
4 files changed, 43 insertions, 12 deletions
diff --git a/tools/create_kyradat/create_kyradat.cpp b/tools/create_kyradat/create_kyradat.cpp index 665db7d454..a6df6ae321 100644 --- a/tools/create_kyradat/create_kyradat.cpp +++ b/tools/create_kyradat/create_kyradat.cpp @@ -58,7 +58,7 @@ const ExtractType extractTypeTable[] = { { kTypeRoomList, extractRooms, createFilename }, { kTypeShapeList, extractShapes, createFilename }, { kTypeRawData, extractRaw, createFilename }, - { -1, 0 } + { -1, 0, 0} }; const ExtractFilename extractFilenames[] = { @@ -336,10 +336,16 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 // We simply skip every other string if (i == size) continue; - uint32 size = strlen((const char*) data + i); - i += size; targetsize = --targetsize - size; + uint32 len = strlen((const char*) data + i); + i += len; +#if 1 + // FIXME: Not sure whether this correct; the original code was ambiguious, see below + targetsize = targetsize - 1 - len; +#else + targetsize = --targetsize - len; // FIXME: This operation is undefined +#endif while (!data[++i]) { - if (i == size) + if (i == len) break; targetsize--; } @@ -404,7 +410,7 @@ bool extractStrings(PAKFile &out, const Game *g, const byte *data, const uint32 } else if (g->special == kAmigaVersion) { // we need to strip some aligment zeros out here int dstPos = 0; - for (int i = 0; i < size; ++i) { + for (uint32 i = 0; i < size; ++i) { if (!data[i] && ((i+1) & 0x1)) continue; *output++ = data[i]; diff --git a/tools/create_kyradat/module.mk b/tools/create_kyradat/module.mk new file mode 100644 index 0000000000..c8df680c40 --- /dev/null +++ b/tools/create_kyradat/module.mk @@ -0,0 +1,16 @@ +MODULE := tools/create_kyradat + +MODULE_DIRS += \ + tools/create_kyradat/ + +TOOLS += \ + $(MODULE)/create_kyradat$(EXEEXT) + +MODULE_OBJS := \ + $(MODULE)/create_kyradat.o \ + $(MODULE)/pak.o \ + $(MODULE)/md5.o \ + $(MODULE)/util.o + +$(MODULE)/create_kyradat$(EXEEXT): $(MODULE_OBJS) + $(CXX) $(LDFLAGS) $+ -o $@ diff --git a/tools/create_lure/module.mk b/tools/create_lure/module.mk new file mode 100644 index 0000000000..7fa5bafa7f --- /dev/null +++ b/tools/create_lure/module.mk @@ -0,0 +1,14 @@ +MODULE := tools/create_lure + +MODULE_DIRS += \ + tools/create_lure/ + +TOOLS += \ + $(MODULE)/create_lure$(EXEEXT) + +MODULE_OBJS := \ + $(MODULE)/create_lure_dat.o \ + $(MODULE)/process_actions.o + +$(MODULE)/create_lure$(EXEEXT): $(MODULE_OBJS) + $(CXX) $(LDFLAGS) $+ -o $@ diff --git a/tools/module.mk b/tools/module.mk index a82ae70cdc..06ee6a573a 100644 --- a/tools/module.mk +++ b/tools/module.mk @@ -10,9 +10,9 @@ MODULE_DIRS += \ TOOLS := \ tools/convbdf$(EXEEXT) \ - tools/md5table$(EXEEXT) \ - tools/create_lure/create_lure$(EXEEXT) + tools/md5table$(EXEEXT) +include $(srcdir)/tools/*/module.mk # Make sure the 'all' / 'clean' targets build/clean the tools, too all: tools @@ -36,10 +36,6 @@ tools/md5table$(EXEEXT): $(srcdir)/tools/md5table.c $(MKDIR) tools/$(DEPDIR) $(CC) $(CFLAGS) -Wall -o $@ $< -tools/create_lure/create_lure$(EXEEXT): tools/create_lure/create_lure_dat.o tools/create_lure/process_actions.o - $(MKDIR) tools/create_lure/$(DEPDIR) - $(CXX) $(LDFLAGS) $+ -o $@ - # # Rules to explicitly rebuild the credits / MD5 tables. # The rules for the files in the "web" resp. "docs" modules @@ -79,5 +75,4 @@ md5scumm: tools/md5table$(EXEEXT) # $(srcdir)/tools/credits.pl --cpp > $@ - .PHONY: clean-tools tools credits md5scumm md5simon |