rxgen: Remove inlist from autogenerated code
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Fri, 11 Jun 2010 22:33:07 +0000 (23:33 +0100)
committerDerrick Brashear <shadow@dementia.org>
Sun, 13 Jun 2010 05:33:02 +0000 (22:33 -0700)
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 <rra@stanford.edu>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/rxgen/rpc_parse.c

index 46772a6..adf551f 100644 (file)
@@ -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");