From fc421a05bcfb7a830a2c6602ef8586ca539ca00c Mon Sep 17 00:00:00 2001 From: Lance Date: Mon, 30 May 2011 13:36:44 +0000 Subject: [PATCH] Added parentheses around some assignments (where they're meant to assign instead of compare in an if statement) which GCC was giving this warning "warning: suggest parentheses around assignment used as truth value" git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3803 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_parse.c | 4 ++-- engine/common/fs.c | 10 +++++----- engine/qclib/qccmain.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index cc15ee22e..8ecc33b84 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -695,11 +695,11 @@ qboolean CL_CheckHLBspWads(char *file) if (!strcmp(key, "wad")) { s = wads; - while (s = COM_ParseToken(s, ";")) + while ((s = COM_ParseToken(s, ";"))) { if (!strcmp(com_token, ";")) continue; - while (w = strchr(com_token, '\\')) + while ((w = strchr(com_token, '\\'))) *w = '/'; w = COM_SkipPath(com_token); Con_Printf("wads: %s\n", w); diff --git a/engine/common/fs.c b/engine/common/fs.c index 642f61712..eed7127b8 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -1890,7 +1890,7 @@ static qboolean Sys_SteamHasFile(char *basepath, int basepathlen, char *steamdir RegQueryValueEx(key, "SteamPath", NULL, NULL, basepath, &resultlen); RegCloseKey(key); Q_strncatz(basepath, va("/SteamApps/common/%s", steamdir), basepathlen); - if (f = fopen(va("%s/%s", basepath, fname), "rb")) + if ((f = fopen(va("%s/%s", basepath, fname), "rb"))) { fclose(f); return true; @@ -1937,7 +1937,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base //well, okay, so they don't have quake installed from steam. //quite a lot of people have it in c:\quake, as that's the default install location from the quake cd. - if (f = fopen("c:/quake/quake.exe", "rb")) + if ((f = fopen("c:/quake/quake.exe", "rb"))) { //HAHAHA! Found it! fclose(f); @@ -1958,7 +1958,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base resultlen = basepathlen; RegQueryValueEx(key, "Path", NULL, NULL, basepath, &resultlen); RegCloseKey(key); - if (f = fopen(va("%s/quake2.exe", basepath), "rb")) + if ((f = fopen(va("%s/quake2.exe", basepath), "rb"))) { fclose(f); return true; @@ -1981,7 +1981,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base RegQueryValueEx(key, "InstallPath", NULL, NULL, basepath, &resultlen); RegCloseKey(key); - if (f = fopen(va("%s/ET.exe", basepath), "rb")) + if ((f = fopen(va("%s/ET.exe", basepath), "rb"))) { fclose(f); return true; @@ -2003,7 +2003,7 @@ qboolean Sys_FindGameData(const char *poshname, const char *gamename, char *base RegQueryValueEx(key, "InstallPath", NULL, NULL, basepath, &resultlen); RegCloseKey(key); - if (f = fopen(va("%s/quake3.exe", basepath), "rb")) + if ((f = fopen(va("%s/quake3.exe", basepath), "rb"))) { fclose(f); return true; diff --git a/engine/qclib/qccmain.c b/engine/qclib/qccmain.c index b51876a2f..ebe1377c3 100644 --- a/engine/qclib/qccmain.c +++ b/engine/qclib/qccmain.c @@ -3220,7 +3220,7 @@ newstyle: if (stat(destfile, &os) != -1) { - while (pr_file_p=QCC_COM_Parse(pr_file_p)) + while ((pr_file_p=QCC_COM_Parse(pr_file_p))) { if (stat(qcc_token, &s) == -1 || s.st_mtime > os.st_mtime) {