From: Simon Wilkinson Date: Fri, 11 Jun 2010 22:33:07 +0000 (+0100) Subject: rxgen: Remove inlist from autogenerated code X-Git-Tag: openafs-devel-1_5_75~154 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=07bd99c9d52712b0282d709d294d33d382dcbe81;p=packages%2Fo%2Fopenafs.git rxgen: Remove inlist from autogenerated code The 'inlist' variable is only used by code that is #if 0, and never emitted by the rxgen source. Remove the definition, and assignment, to this variable. Caught by clang-analyzer Change-Id: Ife162d392a47c48e1eebd75fe2c0af9524cd758a Reviewed-on: http://gerrit.openafs.org/2133 Reviewed-by: Russ Allbery Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index 46772a6c3..adf551f49 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -1849,9 +1849,9 @@ ucs_ProcTail_setup(definition * defp, int split_flag) proc1_list *plist; f_print(fout, "{\tafs_int32 rcode, code, newHost, thisHost, i, _ucount;\n"); - f_print(fout, "\tint chaseCount, pass, needsync, inlist;\n"); + f_print(fout, "\tint chaseCount, pass, needsync;\n"); #if 0 /* goes with block below */ - f_print(fout, "\tint j;\n"); + f_print(fout, "\tint j, inlist;\n"); #endif f_print(fout, "\tstruct rx_connection *tc;\n"); f_print(fout, "\tstruct rx_peer *rxp;\n"); @@ -1862,8 +1862,9 @@ ucs_ProcTail_setup(definition * defp, int split_flag) f_print(fout, "\t restart:\n"); f_print(fout, "\torigLevel = aclient->initializationState;\n"); f_print(fout, "\trcode = UNOSERVERS;\n"); - f_print(fout, "\tchaseCount = inlist = needsync = 0;\n\n"); + f_print(fout, "\tchaseCount = needsync = 0;\n\n"); #if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */ + f_print(fout, "\tinlist = 0;\n"); f_print(fout, "\tLOCK_UCLNT_CACHE;\n"); f_print(fout, "\tfor (j = 0; ((j < SYNCCOUNT) && calls_needsync[j]); j++) {\n"); f_print(fout, "\t\tif (calls_needsync[j] == (int *)%s%s%s) {\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name); @@ -1958,15 +1959,16 @@ ucs_ProcTail_setup(definition * defp, int split_flag) f_print(fout, "\t} /*p */\n\n"); f_print(fout, "\tdone:\n"); f_print(fout, "\tif (needsync) {\n"); - f_print(fout, "\t\tif (!inlist) { /* Remember proc call that needs sync site */\n"); + #if 0 /* We should do some sort of caching algorithm for this, but I need to think about it - shadow 26 jun 06 */ + f_print(fout, "\t\tif (!inlist) { /* Remember proc call that needs sync site */\n"); f_print(fout, "\t\t\tLOCK_UCLNT_CACHE;\n"); f_print(fout, "\t\t\tcalls_needsync[synccount % SYNCCOUNT] = (int *)%s%s%s;\n", prefix, PackagePrefix[PackageIndex], defp->pc.proc_name); f_print(fout, "\t\t\tsynccount++;\n"); f_print(fout, "\t\t\tUNLOCK_UCLNT_CACHE;\n"); -#endif f_print(fout, "\t\t\tinlist = 1;\n"); f_print(fout, "\t\t}\n"); +#endif f_print(fout, "\t\tif (!rcode) { /* Remember the sync site - cmd successful */\n"); f_print(fout, "\t\t\trxp = rx_PeerOf(aclient->conns[_ucount]);\n"); f_print(fout, "\t\t\taclient->syncSite = rx_HostOf(rxp);\n");