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

peres001 at users.sourceforge.net peres001 at users.sourceforge.net
Sat Aug 2 05:19:46 CEST 2008


Revision: 33512
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33512&view=rev
Author:   peres001
Date:     2008-08-02 03:19:45 +0000 (Sat, 02 Aug 2008)

Log Message:
-----------
* Increasing max number of allowed token on one line.
* Increasing buffer size to match old parser.

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

Modified: scummvm/trunk/engines/parallaction/parser.cpp
===================================================================
--- scummvm/trunk/engines/parallaction/parser.cpp	2008-08-02 02:43:05 UTC (rev 33511)
+++ scummvm/trunk/engines/parallaction/parser.cpp	2008-08-02 03:19:45 UTC (rev 33512)
@@ -28,8 +28,10 @@
 
 namespace Parallaction {
 
+#define MAX_TOKENS	50
+
 int				_numTokens;
-char			_tokens[20][MAX_TOKEN_LEN];
+char			_tokens[MAX_TOKENS][MAX_TOKEN_LEN];
 
 Script::Script(Common::ReadStream *input, bool disposeSource) : _input(input), _disposeSource(disposeSource), _line(0) {}
 
@@ -66,7 +68,7 @@
 
 void Script::clearTokens() {
 
-	for (uint16 i = 0; i < 20; i++)
+	for (uint16 i = 0; i < MAX_TOKENS; i++)
 		_tokens[i][0] = '\0';
 
 	_numTokens = 0;
@@ -154,7 +156,7 @@
 uint16 Script::fillTokens(char* line) {
 
 	uint16 i = 0;
-	while (strlen(line) > 0 && i < 20) {
+	while (strlen(line) > 0 && i < MAX_TOKENS) {
 		line = parseNextToken(line, _tokens[i], MAX_TOKEN_LEN, " \t\n");
 		line = Common::ltrim(line);
 		i++;
@@ -315,10 +317,10 @@
 
 	Common::String parseComment(Script &script) {
 		Common::String result;
-		char buf[129];
+		char buf[401];
 
 		do {
-			script.readLine(buf, 128);
+			script.readLine(buf, 400);
 			buf[strlen(buf)-1] = '\0';
 			if (!scumm_stricmp(buf, "endtext"))
 				break;


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