[quake3-commits] r1850 - trunk/code/game

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Feb 4 11:09:05 EST 2011


Author: thilo
Date: 2011-02-04 11:09:05 -0500 (Fri, 04 Feb 2011)
New Revision: 1850

Modified:
   trunk/code/game/bg_lib.c
   trunk/code/game/bg_lib.h
Log:
Ben Millwood fixing his own stuff (#4598)


Modified: trunk/code/game/bg_lib.c
===================================================================
--- trunk/code/game/bg_lib.c	2011-02-04 16:04:37 UTC (rev 1849)
+++ trunk/code/game/bg_lib.c	2011-02-04 16:09:05 UTC (rev 1850)
@@ -904,7 +904,7 @@
 in the nptr string that was not used in the conversion
 ==============
 */
-double strtod( const char *nptr, const char **endptr )
+double strtod( const char *nptr, char **endptr )
 {
 	double res;
 	qboolean neg = qfalse;
@@ -919,7 +919,7 @@
 		floatint_t nan;
 
 		if( endptr )
-			*endptr = &nptr[3];
+			*endptr = (char *)&nptr[3];
 
 		// nan can be followed by a bracketed number (in hex, octal,
 		// or decimal) which is then put in the mantissa
@@ -928,7 +928,7 @@
 		// note that nan(0) is infinity!
 		if( nptr[3] == '(' )
 		{
-			const char *end;
+			char *end;
 			int mantissa = strtol( &nptr[4], &end, 0 );
 			if( *end == ')' )
 			{
@@ -948,9 +948,9 @@
 		if( endptr == NULL )
 			return inf.f;
 		if( Q_stricmpn( &nptr[3], "inity", 5 ) == 0 )
-			*endptr = &nptr[8];
+			*endptr = (char *)&nptr[8];
 		else
-			*endptr = &nptr[3];
+			*endptr = (char *)&nptr[3];
 		return inf.f;
 	}
 
@@ -1016,12 +1016,12 @@
 			float res2;
 			// apparently (confusingly) the exponent should be
 			// decimal
-			exp = strtol( &nptr[1], &end, 10 );
+			exp = strtol( &nptr[1], (char **)&end, 10 );
 			if( &nptr[1] == end )
 			{
 				// no exponent
 				if( endptr )
-					*endptr = nptr;
+					*endptr = (char *)nptr;
 				return res;
 			}
 			if( exp > 0 )
@@ -1048,7 +1048,7 @@
 			}
 		}
 		if( endptr )
-			*endptr = end;
+			*endptr = (char *)end;
 		return res;
 	}
 	// decimal
@@ -1080,12 +1080,12 @@
 		{
 			int exp;
 			float res10;
-			exp = strtol( &nptr[1], &end, 10 );
+			exp = strtol( &nptr[1], (char **)&end, 10 );
 			if( &nptr[1] == end )
 			{
 				// no exponent
 				if( endptr )
-					*endptr = nptr;
+					*endptr = (char *)nptr;
 				return res;
 			}
 			if( exp > 0 )
@@ -1114,7 +1114,7 @@
 			}
 		}
 		if( endptr )
-			*endptr = end;
+			*endptr = (char *)end;
 		return res;
 	}
 }
@@ -1224,13 +1224,13 @@
 *endptr is set to the location of the first character not used
 ==============
 */
-long strtol( const char *nptr, const char **endptr, int base )
+long strtol( const char *nptr, char **endptr, int base )
 {
 	long res;
 	qboolean pos = qtrue;
 
 	if( endptr )
-		*endptr = nptr;
+		*endptr = (char *)nptr;
 	// bases other than 0, 2, 8, 16 are very rarely used, but they're
 	// not much extra effort to support
 	if( base < 0 || base == 1 || base > 36 )
@@ -1252,14 +1252,14 @@
 		nptr++;
 		// 0 is always a valid digit
 		if( endptr )
-			*endptr = nptr;
+			*endptr = (char *)nptr;
 		if( *nptr == 'x' || *nptr == 'X' )
 		{
 			if( base != 0 && base != 16 )
 			{
 				// can't be hex, reject x (accept 0)
 				if( endptr )
-					*endptr = nptr;
+					*endptr = (char *)nptr;
 				return 0;
 			}
 			nptr++;
@@ -1292,7 +1292,7 @@
 			res = res * base - val;
 		nptr++;
 		if( endptr )
-			*endptr = nptr;
+			*endptr = (char *)nptr;
 	}
 	if( pos )
 	{

Modified: trunk/code/game/bg_lib.h
===================================================================
--- trunk/code/game/bg_lib.h	2011-02-04 16:04:37 UTC (rev 1849)
+++ trunk/code/game/bg_lib.h	2011-02-04 16:09:05 UTC (rev 1850)
@@ -95,10 +95,10 @@
 
 double atof( const char *string );
 double _atof( const char **stringPtr );
-double strtod( const char *nptr, const char **endptr );
+double strtod( const char *nptr, char **endptr );
 int atoi( const char *string );
 int _atoi( const char **stringPtr );
-long strtol( const char *nptr, const char **endptr, int base );
+long strtol( const char *nptr, char **endptr, int base );
 
 int Q_vsnprintf( char *buffer, size_t length, const char *fmt, va_list argptr );
 int Q_snprintf( char *buffer, size_t length, const char *fmt, ... ) __attribute__ ((format (printf, 3, 4)));



More information about the quake3-commits mailing list