r1224 - in trunk: code/sys misc/msvc

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Sat Dec 1 19:49:00 EST 2007


Author: juz
Date: 2007-12-01 19:48:59 -0500 (Sat, 01 Dec 2007)
New Revision: 1224

Modified:
   trunk/code/sys/con_log.c
   trunk/misc/msvc/quake3.vcproj
Log:
* Add con_log.c and con_passive.c from r1222 to quake3.vcproj.
* Rename 'write' and 'read' variables in con_log.c, as these are already
defined in io.h in the MSVC environment.

Modified: trunk/code/sys/con_log.c
===================================================================
--- trunk/code/sys/con_log.c	2007-12-01 19:39:03 UTC (rev 1223)
+++ trunk/code/sys/con_log.c	2007-12-02 00:48:59 UTC (rev 1224)
@@ -27,8 +27,8 @@
 #define MAX_LOG 32768
 
 static char          consoleLog[ MAX_LOG ];
-static unsigned int  write = 0;
-static unsigned int  read = 0;
+static unsigned int  writePos = 0;
+static unsigned int  readPos = 0;
 
 /*
 ==================
@@ -37,10 +37,10 @@
 */
 unsigned int CON_LogSize( void )
 {
-	if( read <= write )
-		return write - read;
+	if( readPos <= writePos )
+		return writePos - readPos;
 	else
-		return write + MAX_LOG - read;
+		return writePos + MAX_LOG - readPos;
 }
 
 /*
@@ -67,19 +67,19 @@
 	while( CON_LogFree( ) < length && CON_LogSize( ) > 0 )
 	{
 		// Free enough space
-		while( consoleLog[ read ] != '\n' && CON_LogSize( ) > 1 )
-			read = ( read + 1 ) % MAX_LOG;
+		while( consoleLog[ readPos ] != '\n' && CON_LogSize( ) > 1 )
+			readPos = ( readPos + 1 ) % MAX_LOG;
 
 		// Skip past the '\n'
-		read = ( read + 1 ) % MAX_LOG;
+		readPos = ( readPos + 1 ) % MAX_LOG;
 	}
 
 	if( CON_LogFree( ) < length )
 		return 0;
 
-	if( write + length > MAX_LOG )
+	if( writePos + length > MAX_LOG )
 	{
-		firstChunk  = MAX_LOG - write;
+		firstChunk  = MAX_LOG - writePos;
 		secondChunk = length - firstChunk;
 	}
 	else
@@ -88,10 +88,10 @@
 		secondChunk = 0;
 	}
 
-	Com_Memcpy( consoleLog + write, in, firstChunk );
+	Com_Memcpy( consoleLog + writePos, in, firstChunk );
 	Com_Memcpy( consoleLog, in + firstChunk, secondChunk );
 
-	write = ( write + length ) % MAX_LOG;
+	writePos = ( writePos + length ) % MAX_LOG;
 
 	return length;
 }
@@ -109,9 +109,9 @@
 	if( CON_LogSize( ) < outSize )
 		outSize = CON_LogSize( );
 
-	if( read + outSize > MAX_LOG )
+	if( readPos + outSize > MAX_LOG )
 	{
-		firstChunk  = MAX_LOG - read;
+		firstChunk  = MAX_LOG - readPos;
 		secondChunk = outSize - firstChunk;
 	}
 	else
@@ -120,10 +120,10 @@
 		secondChunk = 0;
 	}
 
-	Com_Memcpy( out, consoleLog + read, firstChunk );
+	Com_Memcpy( out, consoleLog + readPos, firstChunk );
 	Com_Memcpy( out + firstChunk, out, secondChunk );
 
-	read = ( read + outSize ) % MAX_LOG;
+	readPos = ( readPos + outSize ) % MAX_LOG;
 
 	return outSize;
 }

Modified: trunk/misc/msvc/quake3.vcproj
===================================================================
--- trunk/misc/msvc/quake3.vcproj	2007-12-01 19:39:03 UTC (rev 1223)
+++ trunk/misc/msvc/quake3.vcproj	2007-12-02 00:48:59 UTC (rev 1224)
@@ -1150,6 +1150,14 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\code\sys\con_log.c"
+				>
+			</File>
+			<File
+				RelativePath="..\..\code\sys\con_passive.c"
+				>
+			</File>
+			<File
 				RelativePath="..\..\code\qcommon\cvar.c"
 				>
 				<FileConfiguration




More information about the quake3-commits mailing list