diff options
author | Max Horn | 2007-09-22 09:51:33 +0000 |
---|---|---|
committer | Max Horn | 2007-09-22 09:51:33 +0000 |
commit | 893c42c3d8cf4bd5ba0564267f8d9b704b01441f (patch) | |
tree | 1203eff8a920a64dc50a8b5f73c6ee416961681d | |
parent | 924a9074fbedadd9b1d402d71899c6bc9d45bcb1 (diff) | |
download | scummvm-rg350-893c42c3d8cf4bd5ba0564267f8d9b704b01441f.tar.gz scummvm-rg350-893c42c3d8cf4bd5ba0564267f8d9b704b01441f.tar.bz2 scummvm-rg350-893c42c3d8cf4bd5ba0564267f8d9b704b01441f.zip |
Added legal headers, fixed various warnings
svn-id: r29014
-rw-r--r-- | tools/skycpt/AsciiCptCompile.cpp | 22 | ||||
-rw-r--r-- | tools/skycpt/KmpSearch.cpp | 22 | ||||
-rw-r--r-- | tools/skycpt/KmpSearch.h | 22 | ||||
-rw-r--r-- | tools/skycpt/TextFile.cpp | 24 | ||||
-rw-r--r-- | tools/skycpt/TextFile.h | 24 | ||||
-rw-r--r-- | tools/skycpt/cptcompiler.cpp | 33 | ||||
-rw-r--r-- | tools/skycpt/cpthelp.cpp | 30 | ||||
-rw-r--r-- | tools/skycpt/cpthelp.h | 30 | ||||
-rw-r--r-- | tools/skycpt/idFinder.cpp | 22 | ||||
-rw-r--r-- | tools/skycpt/stdafx.h | 1 |
10 files changed, 214 insertions, 16 deletions
diff --git a/tools/skycpt/AsciiCptCompile.cpp b/tools/skycpt/AsciiCptCompile.cpp index df5f1dfd30..15434262b2 100644 --- a/tools/skycpt/AsciiCptCompile.cpp +++ b/tools/skycpt/AsciiCptCompile.cpp @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + // AsciiCptCompile.cpp // diff --git a/tools/skycpt/KmpSearch.cpp b/tools/skycpt/KmpSearch.cpp index f353520edb..93318de15e 100644 --- a/tools/skycpt/KmpSearch.cpp +++ b/tools/skycpt/KmpSearch.cpp @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include "stdafx.h" #include "KmpSearch.h" #include <stdio.h> diff --git a/tools/skycpt/KmpSearch.h b/tools/skycpt/KmpSearch.h index 717a77b93d..ddf151046b 100644 --- a/tools/skycpt/KmpSearch.h +++ b/tools/skycpt/KmpSearch.h @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #ifndef __KmpSearch__ #define __KmpSearch__ diff --git a/tools/skycpt/TextFile.cpp b/tools/skycpt/TextFile.cpp index 20d75ce6a3..1aa2d4611d 100644 --- a/tools/skycpt/TextFile.cpp +++ b/tools/skycpt/TextFile.cpp @@ -1,7 +1,29 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include "stdafx.h" #include "TextFile.h" -TextFile::TextFile(char *name) { +TextFile::TextFile(const char *name) { FILE *inf = fopen(name, "r"); if (!inf) { printf("Unable to open file %s\n", name); diff --git a/tools/skycpt/TextFile.h b/tools/skycpt/TextFile.h index 093826d0be..9ba31d76ce 100644 --- a/tools/skycpt/TextFile.h +++ b/tools/skycpt/TextFile.h @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #ifndef __TextFile__ #define __TextFile__ @@ -8,7 +30,7 @@ class TextFile { public: - TextFile(char *name); + TextFile(const char *name); ~TextFile(void); char *giveLine(uint32 num); int32 findLine(KmpSearch *kmp, uint32 fromLine = 0); diff --git a/tools/skycpt/cptcompiler.cpp b/tools/skycpt/cptcompiler.cpp index 63a0b630e2..c68f034d59 100644 --- a/tools/skycpt/cptcompiler.cpp +++ b/tools/skycpt/cptcompiler.cpp @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include "stdafx.h" #include "cpthelp.h" #include "textfile.h" @@ -163,7 +185,7 @@ void processTurntabs(FILE *inf, CptObj *destArr) { free(resBuf); } -void processBins(FILE *inf, CptObj *destArr, char *typeName, char *objName, uint8 cTypeId) { +void processBins(FILE *inf, CptObj *destArr, const char *typeName, const char *objName, uint8 cTypeId) { char line[1024]; dofgets(line, 1024, inf); assert(lineMatchSection(line, typeName)); @@ -478,9 +500,8 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * fwrite(&tmp, 2, 1, debOutf); tmp = 0; fwrite(&tmp, 2, 1, debOutf); - printf("reset destination: %d\n", ftell(debOutf)); + printf("reset destination: %ld\n", ftell(debOutf)); for (int cnt = 0; cnt < 6; cnt++) { - uint16 diff[8192]; uint16 diffPos = 0; sprintf(inName, "reset.%03d", gameVers[cnt]); FILE *resDiff = fopen(inName, "rb"); @@ -504,7 +525,7 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * printf("diff v0.0%03d: 2 * 2 * %d\n", gameVers[cnt], diffPos); } } else { - printf("Creating CPT file with Dummy reset data @ %d\n", ftell(debOutf)); + printf("Creating CPT file with Dummy reset data @ %ld\n", ftell(debOutf)); uint16 resetFields16 = 4; fwrite(&resetFields16, 2, 1, debOutf); uint32 blah = 8; @@ -524,8 +545,8 @@ void doCompile(FILE *inf, FILE *debOutf, FILE *resOutf, TextFile *cptDef, FILE * fwrite(cptSize + 1, 1, 4, resOutf); printf("%d diffs\n", diffNo); - printf("%d Compacts in total\n", numCpts); + printf("%ld Compacts in total\n", numCpts); printf("max strlen = %d\n", maxStrl); - printf("raw size = 2 * %d\n", binSize); + printf("raw size = 2 * %ld\n", binSize); printf("max cptlen = %d\n", maxCptl); } diff --git a/tools/skycpt/cpthelp.cpp b/tools/skycpt/cpthelp.cpp index 355b214ac4..6fe2827b5d 100644 --- a/tools/skycpt/cpthelp.cpp +++ b/tools/skycpt/cpthelp.cpp @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include "stdafx.h" #include "cpthelp.h" @@ -5,7 +27,7 @@ void assertEmpty(CptObj *cpt) { assert((cpt->len == 0) && (cpt->data == NULL) && (cpt->dbgName == NULL) && (cpt->type == 0)); } -uint16 getInfo(char *line, char *type, char *nameDest) { +uint16 getInfo(const char *line, const char *type, char *nameDest) { assert(*line == '\t'); line++; assert(!memcmp(line, type, strlen(type))); @@ -32,7 +54,7 @@ void dofgets(char *dest, int len, FILE *inf) { dest++; } -bool lineMatchSection(char *line, char *sec) { +bool lineMatchSection(const char *line, const char *sec) { if (memcmp(line, "SECTION::", 9)) return false; if (memcmp(line + 9, sec, strlen(sec))) @@ -40,13 +62,13 @@ bool lineMatchSection(char *line, char *sec) { return true; } -bool isEndOfSection(char *line) { +bool isEndOfSection(const char *line) { if (strcmp(line, "SECTION::ENDS")) return false; return true; } -bool isEndOfObject(char *line, char *type, uint16 id) { +bool isEndOfObject(const char *line, const char *type, uint16 id) { if (*line != '\t') return false; line++; diff --git a/tools/skycpt/cpthelp.h b/tools/skycpt/cpthelp.h index 15e6bfac90..be7eec82c9 100644 --- a/tools/skycpt/cpthelp.h +++ b/tools/skycpt/cpthelp.h @@ -1,8 +1,30 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include "stdafx.h" void assertEmpty(CptObj *cpt); -uint16 getInfo(char *line, char *type, char *nameDest); +uint16 getInfo(const char *line, const char *type, char *nameDest); void dofgets(char *dest, int len, FILE *inf); -bool lineMatchSection(char *line, char *sec); -bool isEndOfSection(char *line); -bool isEndOfObject(char *line, char *type, uint16 id); +bool lineMatchSection(const char *line, const char *sec); +bool isEndOfSection(const char *line); +bool isEndOfObject(const char *line, const char *type, uint16 id); diff --git a/tools/skycpt/idFinder.cpp b/tools/skycpt/idFinder.cpp index 8d692d230b..70452363e1 100644 --- a/tools/skycpt/idFinder.cpp +++ b/tools/skycpt/idFinder.cpp @@ -1,3 +1,25 @@ +/* ScummVM Tools + * Copyright (C) 2007 The ScummVM project + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * $URL$ + * $Id$ + * + */ + #include "stdafx.h" #include "TextFile.h" #include "KmpSearch.h" diff --git a/tools/skycpt/stdafx.h b/tools/skycpt/stdafx.h index a477c70f55..2f06f57952 100644 --- a/tools/skycpt/stdafx.h +++ b/tools/skycpt/stdafx.h @@ -23,6 +23,7 @@ typedef signed long int32; #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <assert.h> struct CptObj { |