[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-dev] patch for warnings (3)



On Gentoo linux PPC (GCC4.1.1) I get several warnings where it seems
that there is mixed char and int arithmetic.

This patch shows the problem.

Ben
Index: Kernel/ccfile.cpp
===================================================================
--- Kernel/ccfile.cpp	(revision 1401)
+++ Kernel/ccfile.cpp	(working copy)
@@ -2854,7 +2854,7 @@ CCFile& CCStreamFile::read(StringBase* b
 		if (RetValue == 0)
 		{
 			// found end of file so make sure we return an EOF as the data
-			Ch = EOF;
+			Ch = 0xFF;
 		}
 
 		if (IOFile->fail())
@@ -2869,7 +2869,7 @@ CCFile& CCStreamFile::read(StringBase* b
 	}
 	
 	// check if found the EOF
-	if (Ch == EOF)
+	if (Ch == 0xFF)
 	{
 		// Mark the EOF has having been reached.
 		IOFile->clear(ios::eofbit);
@@ -2888,7 +2888,7 @@ CCFile& CCStreamFile::read(StringBase* b
 	{
 		// Must leave 1 character space in the buffer if we reach the maximum buffer size
 		// so that we can fit the terminating zero in below.
-		while ((Max>1) && (Ch!=CR) && (Ch!=LF) && (Ch!=EOF))
+		while ((Max>1) && (Ch!=CR) && (Ch!=LF) && (Ch!=0xFF))
 		{
 			// store the char we read
 			Text[Off++] = Ch;
@@ -2920,7 +2920,7 @@ CCFile& CCStreamFile::read(StringBase* b
 		if (RetValue == 0)
 		{
 			// found end of file so make sure we return an EOF as the data
-			Ch = EOF;
+			Ch = 0xFF;
 		}
 
 		if (IOFile->fail())
@@ -2936,7 +2936,7 @@ CCFile& CCStreamFile::read(StringBase* b
 		}
 		
 		// See if we have reached the end of the file
-		if (Ch==EOF)
+		if (Ch==0xFF)
 		{
 			// Mark the End Of File
 			IOFile->clear(ios::eofbit);
@@ -2967,7 +2967,7 @@ CCFile& CCStreamFile::read(StringBase* b
 		}
 
 		// See if we have reached the end of the file
-		if (Ch==EOF)
+		if (Ch==0xFF)
 		{
 			// Mark the End Of File
 			IOFile->clear(ios::eofbit);
@@ -3018,7 +3018,7 @@ CCFile &CCStreamFile::read( char &buf )
 			if (RetValue == 0)
 			{
 				// found end of file so make sure we return an EOF as the data
-				Ch = EOF;
+				Ch = 0xFF;
 			}
 
 			if (IOFile->fail())
@@ -3509,7 +3509,7 @@ CCFile& CCStreamFile::get( char &buf )
 			if (RetValue == 0)
 			{
 				// end of file reached so return the EOF character
-				buf = EOF;
+				buf = 0xFF;
 			}
 			else
 				buf = outbuf;