[Scummvm-cvs-logs] SF.net SVN: scummvm: [30776] scummvm/trunk/engines/parallaction

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sun Feb 3 18:06:45 CET 2008


Revision: 30776
          http://scummvm.svn.sourceforge.net/scummvm/?rev=30776&view=rev
Author:   peres001
Date:     2008-02-03 09:06:45 -0800 (Sun, 03 Feb 2008)

Log Message:
-----------
Fixed maximum token length for the parser.

Modified Paths:
--------------
    scummvm/trunk/engines/parallaction/graphics.cpp
    scummvm/trunk/engines/parallaction/parallaction.cpp
    scummvm/trunk/engines/parallaction/parallaction.h
    scummvm/trunk/engines/parallaction/parser.cpp
    scummvm/trunk/engines/parallaction/parser.h

Modified: scummvm/trunk/engines/parallaction/graphics.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/graphics.cpp	2008-02-03 17:06:25 UTC (rev 30775)
+++ scummvm/trunk/engines/parallaction/graphics.cpp	2008-02-03 17:06:45 UTC (rev 30776)
@@ -699,11 +699,11 @@
 	uint16 blankWidth = _font->getStringWidth(" ");
 	uint16 tokenWidth = 0;
 
-	char token[40];
+	char token[MAX_TOKEN_LEN];
 
 	while (strlen(text) != 0) {
 
-		text = parseNextToken(text, token, 40, "   ", true);
+		text = parseNextToken(text, token, MAX_TOKEN_LEN, "   ", true);
 		tokenWidth = _font->getStringWidth(token);
 
 		w += tokenWidth;
@@ -969,14 +969,14 @@
 	uint16 blankWidth = _font->getStringWidth(" ");
 	uint16 tokenWidth = 0;
 
-	char token[40];
+	char token[MAX_TOKEN_LEN];
 
 	if (wrapwidth == -1)
 		wrapwidth = _vm->_screenWidth;
 
 	while (strlen(text) > 0) {
 
-		text = parseNextToken(text, token, 40, "   ", true);
+		text = parseNextToken(text, token, MAX_TOKEN_LEN, "   ", true);
 
 		if (!scumm_stricmp(token, "%p")) {
 			lines++;

Modified: scummvm/trunk/engines/parallaction/parallaction.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.cpp	2008-02-03 17:06:25 UTC (rev 30775)
+++ scummvm/trunk/engines/parallaction/parallaction.cpp	2008-02-03 17:06:45 UTC (rev 30776)
@@ -49,7 +49,7 @@
 
 char		_saveData1[30] = { '\0' };
 uint16		_language = 0;
-char		_slideText[2][40];
+char		_slideText[2][MAX_TOKEN_LEN];
 uint32		_engineFlags = 0;
 
 uint16		_score = 1;

Modified: scummvm/trunk/engines/parallaction/parallaction.h
===================================================================
--- scummvm/trunk/engines/parallaction/parallaction.h	2008-02-03 17:06:25 UTC (rev 30775)
+++ scummvm/trunk/engines/parallaction/parallaction.h	2008-02-03 17:06:45 UTC (rev 30776)
@@ -150,7 +150,7 @@
 extern Command		*_forwardedCommands[];
 extern char			_forwardedAnimationNames[][20];
 extern uint16		_numForwards;
-extern char			_slideText[][40];
+extern char			_slideText[][MAX_TOKEN_LEN];
 extern uint16		_introSarcData3;		 // sarcophagus stuff to be saved
 extern uint16		_introSarcData2;		 // sarcophagus stuff to be saved
 extern char			_saveData1[];

Modified: scummvm/trunk/engines/parallaction/parser.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser.cpp	2008-02-03 17:06:25 UTC (rev 30775)
+++ scummvm/trunk/engines/parallaction/parser.cpp	2008-02-03 17:06:45 UTC (rev 30776)
@@ -28,7 +28,7 @@
 
 namespace Parallaction {
 
-char			_tokens[20][40];
+char			_tokens[20][MAX_TOKEN_LEN];
 
 Script::Script(Common::ReadStream *input, bool disposeSource) : _input(input), _disposeSource(disposeSource), _line(0) {
 }
@@ -153,7 +153,7 @@
 
 	uint16 i = 0;
 	while (strlen(line) > 0 && i < 20) {
-		line = parseNextToken(line, _tokens[i], 40, " \t\n");
+		line = parseNextToken(line, _tokens[i], MAX_TOKEN_LEN, " \t\n");
 		line = Common::ltrim(line);
 		i++;
 	}

Modified: scummvm/trunk/engines/parallaction/parser.h
===================================================================
--- scummvm/trunk/engines/parallaction/parser.h	2008-02-03 17:06:25 UTC (rev 30775)
+++ scummvm/trunk/engines/parallaction/parser.h	2008-02-03 17:06:45 UTC (rev 30776)
@@ -34,7 +34,8 @@
 
 char   *parseNextToken(char *s, char *tok, uint16 count, const char *brk, bool ignoreQuotes = false);
 
-extern char _tokens[][40];
+#define MAX_TOKEN_LEN	50
+extern char _tokens[][MAX_TOKEN_LEN];
 
 class Script {
 


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