[ioquake3] 112/136: Unify checks for missing COM_Parse() token

Simon McVittie smcv at debian.org
Thu Jun 15 09:09:16 UTC 2017


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

smcv pushed a commit to branch debian/master
in repository ioquake3.

commit 1048073e2624102dff884c38d5f6417ae860b2f5
Author: Zack Middleton <zack at cloemail.com>
Date:   Wed Jun 7 19:16:05 2017 -0500

    Unify checks for missing COM_Parse() token
---
 code/cgame/cg_main.c        |  4 ++--
 code/cgame/cg_servercmds.c  | 10 +++++-----
 code/q3_ui/ui_startserver.c |  2 +-
 code/ui/ui_main.c           | 14 +++++++-------
 4 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/code/cgame/cg_main.c b/code/cgame/cg_main.c
index d5ecd81..780ed3e 100644
--- a/code/cgame/cg_main.c
+++ b/code/cgame/cg_main.c
@@ -1417,7 +1417,7 @@ qboolean CG_Load_Menu(char **p) {
 			return qtrue;
 		}
 
-		if ( !token || token[0] == 0 ) {
+		if (!token[0]) {
 			return qfalse;
 		}
 
@@ -1464,7 +1464,7 @@ void CG_LoadMenus(const char *menuFile) {
 
 	while ( 1 ) {
 		token = COM_ParseExt( &p, qtrue );
-		if( !token || token[0] == 0 || token[0] == '}') {
+		if (!token[0]) {
 			break;
 		}
 
diff --git a/code/cgame/cg_servercmds.c b/code/cgame/cg_servercmds.c
index e863edc..d1c8b28 100644
--- a/code/cgame/cg_servercmds.c
+++ b/code/cgame/cg_servercmds.c
@@ -566,7 +566,7 @@ int CG_ParseVoiceChats( const char *filename, voiceChatList_t *voiceChatList, in
 		voiceChats[i].id[0] = 0;
 	}
 	token = COM_ParseExt(p, qtrue);
-	if (!token || token[0] == 0) {
+	if (!token[0]) {
 		return qtrue;
 	}
 	if (!Q_stricmp(token, "female")) {
@@ -586,7 +586,7 @@ int CG_ParseVoiceChats( const char *filename, voiceChatList_t *voiceChatList, in
 	voiceChatList->numVoiceChats = 0;
 	while ( 1 ) {
 		token = COM_ParseExt(p, qtrue);
-		if (!token || token[0] == 0) {
+		if (!token[0]) {
 			return qtrue;
 		}
 		Com_sprintf(voiceChats[voiceChatList->numVoiceChats].id, sizeof( voiceChats[voiceChatList->numVoiceChats].id ), "%s", token);
@@ -598,7 +598,7 @@ int CG_ParseVoiceChats( const char *filename, voiceChatList_t *voiceChatList, in
 		voiceChats[voiceChatList->numVoiceChats].numSounds = 0;
 		while(1) {
 			token = COM_ParseExt(p, qtrue);
-			if (!token || token[0] == 0) {
+			if (!token[0]) {
 				return qtrue;
 			}
 			if (!Q_stricmp(token, "}"))
@@ -606,7 +606,7 @@ int CG_ParseVoiceChats( const char *filename, voiceChatList_t *voiceChatList, in
 			sound = trap_S_RegisterSound( token, compress );
 			voiceChats[voiceChatList->numVoiceChats].sounds[voiceChats[voiceChatList->numVoiceChats].numSounds] = sound;
 			token = COM_ParseExt(p, qtrue);
-			if (!token || token[0] == 0) {
+			if (!token[0]) {
 				return qtrue;
 			}
 			Com_sprintf(voiceChats[voiceChatList->numVoiceChats].chats[
@@ -674,7 +674,7 @@ int CG_HeadModelVoiceChats( char *filename ) {
 	p = &ptr;
 
 	token = COM_ParseExt(p, qtrue);
-	if (!token || token[0] == 0) {
+	if ( !token[0] ) {
 		return -1;
 	}
 
diff --git a/code/q3_ui/ui_startserver.c b/code/q3_ui/ui_startserver.c
index cb09a3b..82865ad 100644
--- a/code/q3_ui/ui_startserver.c
+++ b/code/q3_ui/ui_startserver.c
@@ -119,7 +119,7 @@ static int GametypeBits( char *string ) {
 	p = string;
 	while( 1 ) {
 		token = COM_ParseExt( &p, qfalse );
-		if( token[0] == 0 ) {
+		if ( !token[0] ) {
 			break;
 		}
 
diff --git a/code/ui/ui_main.c b/code/ui/ui_main.c
index bb43ec4..6017061 100644
--- a/code/ui/ui_main.c
+++ b/code/ui/ui_main.c
@@ -4549,7 +4549,7 @@ static qboolean Team_Parse(char **p) {
       return qtrue;
     }
 
-    if ( !token || token[0] == 0 ) {
+    if (!token[0]) {
       return qfalse;
     }
 
@@ -4610,7 +4610,7 @@ static qboolean Character_Parse(char **p) {
       return qtrue;
     }
 
-    if ( !token || token[0] == 0 ) {
+    if (!token[0]) {
       return qfalse;
     }
 
@@ -4666,7 +4666,7 @@ static qboolean Alias_Parse(char **p) {
       return qtrue;
     }
 
-    if ( !token || token[0] == 0 ) {
+    if (!token[0]) {
       return qfalse;
     }
 
@@ -4715,7 +4715,7 @@ static void UI_ParseTeamInfo(const char *teamFile) {
 
 	while ( 1 ) {
 		token = COM_ParseExt( &p, qtrue );
-		if( !token || token[0] == 0 || token[0] == '}') {
+		if (!token[0] || token[0] == '}') {
 			break;
 		}
 
@@ -4767,7 +4767,7 @@ static qboolean GameType_Parse(char **p, qboolean join) {
 			return qtrue;
 		}
 
-		if ( !token || token[0] == 0 ) {
+		if (!token[0]) {
 			return qfalse;
 		}
 
@@ -4824,7 +4824,7 @@ static qboolean MapList_Parse(char **p) {
 			return qtrue;
 		}
 
-		if ( !token || token[0] == 0 ) {
+		if (!token[0]) {
 			return qfalse;
 		}
 
@@ -4885,7 +4885,7 @@ static void UI_ParseGameInfo(const char *teamFile) {
 
 	while ( 1 ) {
 		token = COM_ParseExt( &p, qtrue );
-		if( !token || token[0] == 0 || token[0] == '}') {
+		if (!token[0] || token[0] == '}') {
 			break;
 		}
 

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



More information about the Pkg-games-commits mailing list