[Scummvm-cvs-logs] SF.net SVN: scummvm:[52192] scummvm/trunk/engines/hugo
eriktorbjorn at users.sourceforge.net
eriktorbjorn at users.sourceforge.net
Wed Aug 18 19:51:44 CEST 2010
Revision: 52192
http://scummvm.svn.sourceforge.net/scummvm/?rev=52192&view=rev
Author: eriktorbjorn
Date: 2010-08-18 17:51:44 +0000 (Wed, 18 Aug 2010)
Log Message:
-----------
HUGO: Fix GCC warnings.
Modified Paths:
--------------
scummvm/trunk/engines/hugo/file.cpp
scummvm/trunk/engines/hugo/parser.cpp
Modified: scummvm/trunk/engines/hugo/file.cpp
===================================================================
--- scummvm/trunk/engines/hugo/file.cpp 2010-08-18 16:58:32 UTC (rev 52191)
+++ scummvm/trunk/engines/hugo/file.cpp 2010-08-18 17:51:44 UTC (rev 52192)
@@ -745,13 +745,14 @@
debugC(1, kDebugFile, "printBootText");
- if (!ofp.open(BOOTFILE))
+ if (!ofp.open(BOOTFILE)) {
if (_vm._gameVariant == 3) {
//TODO initialize properly _boot structure
warning("printBootText - Skipping as H1 Dos may be a freeware");
return;
} else
Utils::Error(FILE_ERR, BOOTFILE);
+ }
// Allocate space for the text and print it
buf = (char *)malloc(_boot.exit_len + 1);
@@ -785,13 +786,14 @@
debugC(1, kDebugFile, "readBootFile");
- if (!ofp.open(BOOTFILE))
+ if (!ofp.open(BOOTFILE)) {
if (_vm._gameVariant == 3) {
//TODO initialize properly _boot structure
warning("readBootFile - Skipping as H1 Dos may be a freeware");
return;
} else
Utils::Error(FILE_ERR, BOOTFILE);
+ }
if (ofp.size() < (int32)sizeof(_boot))
Utils::Error(FILE_ERR, BOOTFILE);
Modified: scummvm/trunk/engines/hugo/parser.cpp
===================================================================
--- scummvm/trunk/engines/hugo/parser.cpp 2010-08-18 16:58:32 UTC (rev 52191)
+++ scummvm/trunk/engines/hugo/parser.cpp 2010-08-18 17:51:44 UTC (rev 52192)
@@ -678,9 +678,9 @@
void Parser::showDosInventory() {
// Show user all objects being carried in a variable width 2 column format
-static char *intro = "You are carrying:";
-static char *outro = "\nPress ESCAPE to continue";
-static char *blanks = " ";
+static const char *intro = "You are carrying:";
+static const char *outro = "\nPress ESCAPE to continue";
+static const char *blanks = " ";
uint16 index, len, len1 = 0, len2 = 0;
char buffer[XBYTES * NUM_ROWS] = "\0";
@@ -701,12 +701,14 @@
strncat (buffer, blanks, (len1 + len2 - strlen(intro)) / 2);
strcat (strcat (buffer, intro), "\n");
index = 0;
- for (int i = 0; i < _vm._numObj; i++) /* Assign strings */
- if (_vm._objects[i].carriedFl)
+ for (int i = 0; i < _vm._numObj; i++) { /* Assign strings */
+ if (_vm._objects[i].carriedFl) {
if (index++ & 1)
strcat (strcat (buffer, _vm._arrayNouns[_vm._objects[i].nounIndex][1]), "\n");
else
strncat (strcat (buffer, _vm._arrayNouns[_vm._objects[i].nounIndex][1]), blanks, len1 - strlen(_vm._arrayNouns[_vm._objects[i].nounIndex][1]));
+ }
+ }
if (index & 1) strcat (buffer, "\n");
strcat (buffer, outro);
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