[iortcw] 05/89: All: Fix 'missing token' in parsers

Simon McVittie smcv at debian.org
Fri Sep 8 10:44:09 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to tag 1.51b
in repository iortcw.

commit 82abba3f1f28afe765e090cd0e02dce37dea479f
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date:   Mon Jun 12 16:56:08 2017 -0400

    All: Fix 'missing token' in parsers
---
 MP/code/cgame/cg_players.c  |  2 +-
 MP/code/cgame/cg_weapons.c  | 18 +++++++++---------
 MP/code/game/bg_animation.c | 22 +++++++++++-----------
 MP/code/ui/ui_players.c     | 14 +++++++-------
 SP/code/cgame/cg_players.c  |  2 +-
 SP/code/cgame/cg_weapons.c  | 18 +++++++++---------
 SP/code/game/bg_animation.c | 20 ++++++++++----------
 SP/code/ui/ui_players.c     | 14 +++++++-------
 8 files changed, 55 insertions(+), 55 deletions(-)

diff --git a/MP/code/cgame/cg_players.c b/MP/code/cgame/cg_players.c
index 4bee246..36cc1d3 100644
--- a/MP/code/cgame/cg_players.c
+++ b/MP/code/cgame/cg_players.c
@@ -169,7 +169,7 @@ static qboolean CG_ParseGibModels( const char *filename, clientInfo_t *ci ) {
 
 	for ( i = 0; i < MAX_GIB_MODELS; i++ ) {
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		// cache this model
diff --git a/MP/code/cgame/cg_weapons.c b/MP/code/cgame/cg_weapons.c
index 2b7f55e..af8930b 100644
--- a/MP/code/cgame/cg_weapons.c
+++ b/MP/code/cgame/cg_weapons.c
@@ -948,12 +948,12 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 	while ( 1 ) {
 		prev = text_p;  // so we can unget
 		token = COM_Parse( &text_p );
-		if ( !token ) {                     // get the variable
+		if ( !token[0] ) {                     // get the variable
 			break;
 		}
 		if ( !Q_stricmp( token, "whatever_variable" ) ) {
 			token = COM_Parse( &text_p );   // get the value
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			continue;
@@ -976,19 +976,19 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 	for ( i = 0 ; i < MAX_WP_ANIMATIONS  ; i++ ) {
 
 		token = COM_Parse( &text_p );   // first frame
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		wi->weapAnimations[i].firstFrame = atoi( token );
 
 		token = COM_Parse( &text_p );   // length
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		wi->weapAnimations[i].numFrames = atoi( token );
 
 		token = COM_Parse( &text_p );   // fps
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		fps = atof( token );
@@ -1000,7 +1000,7 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 		wi->weapAnimations[i].initialLerp = 1000 / fps;
 
 		token = COM_Parse( &text_p );   // looping frames
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		wi->weapAnimations[i].loopFrames = atoi( token );
@@ -1017,13 +1017,13 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 
 		if ( newfmt ) {
 			token = COM_Parse( &text_p );   // barrel anim bits
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			wi->weapAnimations[i].moveSpeed = atoi( token );
 
 			token = COM_Parse( &text_p );   // animated weapon
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( atoi( token ) ) {
@@ -1031,7 +1031,7 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 
 			}
 			token = COM_Parse( &text_p );   // barrel hide bits (so objects can be flagged to not be drawn during all sequences (a reloading hand that comes in from off screen for that one animation for example)
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			wi->weapAnimations[i].moveSpeed |= ( ( atoi( token ) ) << 8 ); // use 2nd byte for draw bits
diff --git a/MP/code/game/bg_animation.c b/MP/code/game/bg_animation.c
index da025eb..04be86b 100644
--- a/MP/code/game/bg_animation.c
+++ b/MP/code/game/bg_animation.c
@@ -531,12 +531,12 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 	// read optional parameters
 	while ( 1 ) {
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		if ( !Q_stricmp( token, "footsteps" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( !Q_stricmp( token, "default" ) || !Q_stricmp( token, "normal" ) ) {
@@ -556,7 +556,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 		} else if ( !Q_stricmp( token, "headoffset" ) ) {
 			for ( i = 0 ; i < 3 ; i++ ) {
 				token = COM_Parse( &text_p );
-				if ( !token ) {
+				if ( !token[0] ) {
 					break;
 				}
 				animModelInfo->headOffset[i] = atof( token );
@@ -564,7 +564,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 			continue;
 		} else if ( !Q_stricmp( token, "sex" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( token[0] == 'f' || token[0] == 'F' ) {
@@ -577,7 +577,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 			continue;
 		} else if ( !Q_stricmp( token, "version" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			animModelInfo->version = atoi( token );
@@ -606,7 +606,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 	for ( i = 0 ; ( animModelInfo->version > 1 ) || ( i < MAX_ANIMATIONS ) ; i++ ) {
 
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 
@@ -682,7 +682,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 
 		// animation blending
 		token = COM_ParseExt( &text_p, qfalse );    // must be on same line
-		if ( !token ) {
+		if ( !token[0] ) {
 			animations[i].animBlend = 0;
 		} else {
 			animations[i].animBlend = atoi( token );
@@ -1167,7 +1167,7 @@ void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scrip
 				defineStr[defineType][numDefines[defineType]].hash = BG_StringHashValue( defineStr[defineType][numDefines[defineType]].string );
 				// expecting an =
 				token = COM_ParseExt( &text_p, qfalse );
-				if ( !token ) {
+				if ( !token[0] ) {
 					BG_AnimParseError( "BG_AnimParseAnimScript: expected '=', found end of line" );  // RF mod
 				}
 				if ( Q_stricmp( token, "=" ) ) {
@@ -1223,7 +1223,7 @@ void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scrip
 
 				// read in the state type
 				token = COM_ParseExt( &text_p, qfalse );
-				if ( !token ) {
+				if ( !token[0] ) {
 					BG_AnimParseError( "BG_AnimParseAnimScript: expected state type" );  // RF mod
 				}
 				indexes[indentLevel] = BG_IndexForString( token, animStateStr, qfalse );
@@ -1336,14 +1336,14 @@ void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scrip
 
 					// read in the old state type
 					token = COM_ParseExt( &text_p, qfalse );
-					if ( !token ) {
+					if ( !token[0] ) {
 						BG_AnimParseError( "BG_AnimParseAnimScript: expected <state type>" );    // RF mod
 					}
 					oldState = BG_IndexForString( token, animStateStr, qfalse );
 
 					// read in the new state type
 					token = COM_ParseExt( &text_p, qfalse );
-					if ( !token ) {
+					if ( !token[0] ) {
 						BG_AnimParseError( "BG_AnimParseAnimScript: expected <state type>" );    // RF mod
 					}
 					indexes[indentLevel] = BG_IndexForString( token, animStateStr, qfalse );
diff --git a/MP/code/ui/ui_players.c b/MP/code/ui/ui_players.c
index 67efd9c..10075d4 100644
--- a/MP/code/ui/ui_players.c
+++ b/MP/code/ui/ui_players.c
@@ -1064,12 +1064,12 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 	// read optional parameters
 	while ( 1 ) {
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		if ( !Q_stricmp( token, "footsteps" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( !Q_stricmp( token, "default" ) || !Q_stricmp( token, "normal" ) ) {
@@ -1089,7 +1089,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 		} else if ( !Q_stricmp( token, "headoffset" ) ) {
 			for ( i = 0 ; i < 3 ; i++ ) {
 				token = COM_Parse( &text_p );
-				if ( !token ) {
+				if ( !token[0] ) {
 					break;
 				}
 				animModelInfo->headOffset[i] = atof( token );
@@ -1097,7 +1097,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 			continue;
 		} else if ( !Q_stricmp( token, "sex" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( token[0] == 'f' || token[0] == 'F' ) {
@@ -1110,7 +1110,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 			continue;
 		} else if ( !Q_stricmp( token, "version" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			animModelInfo->version = atoi( token );
@@ -1139,7 +1139,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 	for ( i = 0 ; ( animModelInfo->version > 1 ) || ( i < MAX_ANIMATIONS ) ; i++ ) {
 
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 
@@ -1215,7 +1215,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 
 		// animation blending
 		token = COM_ParseExt( &text_p, qfalse );    // must be on same line
-		if ( !token ) {
+		if ( !token[0] ) {
 			animations[i].animBlend = 0;
 		} else {
 			animations[i].animBlend = atoi( token );
diff --git a/SP/code/cgame/cg_players.c b/SP/code/cgame/cg_players.c
index 1df1143..5be6d0b 100644
--- a/SP/code/cgame/cg_players.c
+++ b/SP/code/cgame/cg_players.c
@@ -165,7 +165,7 @@ static qboolean CG_ParseGibModels( const char *filename, clientInfo_t *ci ) {
 
 	for ( i = 0; i < MAX_GIB_MODELS; i++ ) {
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		// cache this model
diff --git a/SP/code/cgame/cg_weapons.c b/SP/code/cgame/cg_weapons.c
index e23aa4d..e458413 100644
--- a/SP/code/cgame/cg_weapons.c
+++ b/SP/code/cgame/cg_weapons.c
@@ -891,12 +891,12 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 	while ( 1 ) {
 		prev = text_p;  // so we can unget
 		token = COM_Parse( &text_p );
-		if ( !token ) {                     // get the variable
+		if ( !token[0] ) {                     // get the variable
 			break;
 		}
 		if ( !Q_stricmp( token, "whatever_variable" ) ) {
 			token = COM_Parse( &text_p );   // get the value
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			continue;
@@ -919,19 +919,19 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 	for ( i = 0 ; i < MAX_WP_ANIMATIONS  ; i++ ) {
 
 		token = COM_Parse( &text_p );   // first frame
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		wi->weapAnimations[i].firstFrame = atoi( token );
 
 		token = COM_Parse( &text_p );   // length
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		wi->weapAnimations[i].numFrames = atoi( token );
 
 		token = COM_Parse( &text_p );   // fps
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		fps = atof( token );
@@ -943,7 +943,7 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 		wi->weapAnimations[i].initialLerp = 1000 / fps;
 
 		token = COM_Parse( &text_p );   // looping frames
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		wi->weapAnimations[i].loopFrames = atoi( token );
@@ -960,13 +960,13 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 
 		if ( newfmt ) {
 			token = COM_Parse( &text_p );   // barrel anim bits
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			wi->weapAnimations[i].moveSpeed = atoi( token );
 
 			token = COM_Parse( &text_p );   // animated weapon
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( atoi( token ) ) {
@@ -974,7 +974,7 @@ static qboolean CG_ParseWeaponConfig( const char *filename, weaponInfo_t *wi ) {
 
 			}
 			token = COM_Parse( &text_p );   // barrel hide bits (so objects can be flagged to not be drawn during all sequences (a reloading hand that comes in from off screen for that one animation for example)
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			wi->weapAnimations[i].moveSpeed |= ( ( atoi( token ) ) << 8 ); // use 2nd byte for draw bits
diff --git a/SP/code/game/bg_animation.c b/SP/code/game/bg_animation.c
index c351755..1f06e27 100644
--- a/SP/code/game/bg_animation.c
+++ b/SP/code/game/bg_animation.c
@@ -541,12 +541,12 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 	// read optional parameters
 	while ( 1 ) {
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		if ( !Q_stricmp( token, "footsteps" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( !Q_stricmp( token, "default" ) || !Q_stricmp( token, "normal" ) ) {
@@ -566,7 +566,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 		} else if ( !Q_stricmp( token, "headoffset" ) ) {
 			for ( i = 0 ; i < 3 ; i++ ) {
 				token = COM_Parse( &text_p );
-				if ( !token ) {
+				if ( !token[0] ) {
 					break;
 				}
 				animModelInfo->headOffset[i] = atof( token );
@@ -574,7 +574,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 			continue;
 		} else if ( !Q_stricmp( token, "sex" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( token[0] == 'f' || token[0] == 'F' ) {
@@ -587,7 +587,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 			continue;
 		} else if ( !Q_stricmp( token, "version" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			animModelInfo->version = atoi( token );
@@ -616,7 +616,7 @@ qboolean BG_AnimParseAnimConfig( animModelInfo_t *animModelInfo, const char *fil
 	for ( i = 0 ; ( animModelInfo->version > 1 ) || ( i < MAX_ANIMATIONS ) ; i++ ) {
 
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 
@@ -1218,7 +1218,7 @@ void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scrip
 				defineStr[defineType][numDefines[defineType]].hash = BG_StringHashValue( defineStr[defineType][numDefines[defineType]].string );
 				// expecting an =
 				token = COM_ParseExt( &text_p, qfalse );
-				if ( !token ) {
+				if ( !token[0] ) {
 					BG_AnimParseError( "BG_AnimParseAnimScript: expected '=', found end of line" );  // RF mod
 				}
 				if ( Q_stricmp( token, "=" ) ) {
@@ -1274,7 +1274,7 @@ void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scrip
 
 				// read in the state type
 				token = COM_ParseExt( &text_p, qfalse );
-				if ( !token ) {
+				if ( !token[0] ) {
 					BG_AnimParseError( "BG_AnimParseAnimScript: expected state type" );  // RF mod
 				}
 				indexes[indentLevel] = BG_IndexForString( token, animStateStr, qfalse );
@@ -1387,14 +1387,14 @@ void BG_AnimParseAnimScript( animModelInfo_t *modelInfo, animScriptData_t *scrip
 
 					// read in the old state type
 					token = COM_ParseExt( &text_p, qfalse );
-					if ( !token ) {
+					if ( !token[0] ) {
 						BG_AnimParseError( "BG_AnimParseAnimScript: expected <state type>" );    // RF mod
 					}
 					oldState = BG_IndexForString( token, animStateStr, qfalse );
 
 					// read in the new state type
 					token = COM_ParseExt( &text_p, qfalse );
-					if ( !token ) {
+					if ( !token[0] ) {
 						BG_AnimParseError( "BG_AnimParseAnimScript: expected <state type>" );    // RF mod
 					}
 					indexes[indentLevel] = BG_IndexForString( token, animStateStr, qfalse );
diff --git a/SP/code/ui/ui_players.c b/SP/code/ui/ui_players.c
index 9618522..eb4f4e3 100644
--- a/SP/code/ui/ui_players.c
+++ b/SP/code/ui/ui_players.c
@@ -1034,12 +1034,12 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 	// read optional parameters
 	while ( 1 ) {
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 		if ( !Q_stricmp( token, "footsteps" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( !Q_stricmp( token, "default" ) || !Q_stricmp( token, "normal" ) ) {
@@ -1059,7 +1059,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 		} else if ( !Q_stricmp( token, "headoffset" ) ) {
 			for ( i = 0 ; i < 3 ; i++ ) {
 				token = COM_Parse( &text_p );
-				if ( !token ) {
+				if ( !token[0] ) {
 					break;
 				}
 				animModelInfo->headOffset[i] = atof( token );
@@ -1067,7 +1067,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 			continue;
 		} else if ( !Q_stricmp( token, "sex" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			if ( token[0] == 'f' || token[0] == 'F' ) {
@@ -1080,7 +1080,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 			continue;
 		} else if ( !Q_stricmp( token, "version" ) ) {
 			token = COM_Parse( &text_p );
-			if ( !token ) {
+			if ( !token[0] ) {
 				break;
 			}
 			animModelInfo->version = atoi( token );
@@ -1109,7 +1109,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 	for ( i = 0 ; ( animModelInfo->version > 1 ) || ( i < MAX_ANIMATIONS ) ; i++ ) {
 
 		token = COM_Parse( &text_p );
-		if ( !token ) {
+		if ( !token[0] ) {
 			break;
 		}
 
@@ -1185,7 +1185,7 @@ static qboolean AnimParseAnimConfig( playerInfo_t *animModelInfo, const char *fi
 
 		// animation blending
 		token = COM_ParseExt( &text_p, qfalse );    // must be on same line
-		if ( !token ) {
+		if ( !token[0] ) {
 			animations[i].animBlend = 0;
 		} else {
 			animations[i].animBlend = atoi( token );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list