]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Remove unreached lines
authorAndrew Deason <adeason@sinenomine.net>
Mon, 22 Nov 2010 02:29:11 +0000 (21:29 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 8 Feb 2011 21:01:10 +0000 (13:01 -0800)
Fix some macros to eliminate unreached trailing empty statements (such
as: "{code = foo; goto error;};"), and other oddities causing
"statement not reached" warnings. Also eliminate a couple of code
blocks that were never reached.

(cherry picked from commit 1c45cc746e7484e72191fc8d010640692e90bc82)
Reviewed-on: http://gerrit.openafs.org/3368
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Change-Id: Ibe9a94c64d38fe102fdf4fb9c182a5eb3b2adaa5
Reviewed-on: http://gerrit.openafs.org/3906
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
27 files changed:
src/afs/afs_disconnected.c
src/afs/afs_pioctl.c
src/bozo/bnode.c
src/bu_utils/fms.c
src/bucoord/commands.c
src/bucoord/error_macros.h
src/budb/error_macros.h
src/butc/dump.c
src/butc/error_macros.h
src/butc/recoverDb.c
src/butm/error_macros.h
src/butm/file_tm.c
src/kauth/krb_tf.c
src/rxgen/rpc_parse.c
src/ubik/ubik.c
src/venus/up.c
src/vlserver/vlprocs.c
src/vlserver/vlutils.c
src/vol/clone.c
src/vol/daemon_com_inline.h
src/vol/fssync-debug.c
src/vol/fssync_inline.h
src/vol/namei_ops.c
src/vol/volume.c
src/vol/volume_inline.h
src/volser/vos.c
src/volser/vsprocs.c

index 6bb41fdbb466d4b408494ecec78690537fc99837..f85c26ebc7c082b7e523124fca10f09cf65224b1 100644 (file)
@@ -185,7 +185,6 @@ afs_GetParentDirFid(struct vcache *avc, struct VenusFid *afid)
        break;
     default:
        return -1;
-       break;
     }
 
     return 0;
index 86a8abc73ab2c5ed5c28bf72e828b0c6cb12e1c6..2b9286dad37c232abe14c42090e7137d8a3249da 100644 (file)
@@ -4309,7 +4309,6 @@ DECL_PIOCTL(PGetInitParams)
 
     return afs_pd_putBytes(aout, &cm_initParams,
                           sizeof(struct cm_initparams));
-    return 0;
 }
 
 #ifdef AFS_SGI65_ENV
index c2d1fdd4f148e15ef34523b985845e1326b9b610..891e871e32f1dee7613c9d689362d8055e31698c 100644 (file)
@@ -946,7 +946,6 @@ bnode_ParseLine(char *aline, struct bnode_token **alist)
            return 0;
        }
     }
-    return 0;
 }
 
 #define        MAXVARGS            128
index 03ed62603ff140471ed77dc93caddba6ea610563..6d4878bb58db7d3e66376dab32cc6545ab42efd2 100644 (file)
@@ -39,11 +39,10 @@ static int tt_fileMarkSize(struct cmd_syndesc *as, void *arock);
 afs_int32 rewindTape(usd_handle_t hTape);
 int dataBlock(usd_handle_t, afs_int32);
 
-#define ERROR(evalue)                                           \
-        {                                                       \
+#define ERROR(evalue) do {                                      \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
 #define MAXV   100
 
index babb070cefe99680010b5e4bdd1376290dae8602..9b2570715f05c0525f48396930244f89bf5d5375 100644 (file)
@@ -1127,7 +1127,6 @@ bc_KillCmd(struct cmd_syndesc *as, void *arock)
        }
        statusPtr->flags |= ABORT_REQUEST;
        unlock_Status();
-       return (0);
     }
     return 0;
 }
index c1d0a5f7713eefd62d834e698f005b8d5ecdc432..aac6bd6ccf1cb4ebb579297194fa80eb5ce163d4 100644 (file)
@@ -8,15 +8,13 @@
  */
 
 #undef ERROR
-#define ERROR(evalue)                                           \
-       {                                                       \
+#define ERROR(evalue) do {                                      \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
 #undef ABORT
-#define ABORT(evalue)                                           \
-       {                                                       \
+#define ABORT(evalue) do {                                      \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
index 99531be118abc3a04e5e082f927997a0857af1f6..71c35c36ec5316c482a2a97d47243ee17503fda3 100644 (file)
@@ -7,20 +7,17 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#define ERROR(evalue)                                           \
-       {                                                       \
+#define ERROR(evalue) do {                                      \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
-#define ABORT(evalue)                                           \
-       {                                                       \
+#define ABORT(evalue) do {                                      \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
 
-#define BUDB_EXIT(evalue)                                       \
-       {                                                       \
+#define BUDB_EXIT(evalue) do {                                  \
             osi_audit(BUDB_ExitEvent, evalue, AUD_END);         \
            exit(evalue);                                       \
-        }
+        } while (0)
index 94bc76a4ca66f279e6647ec476e3f985c91d31bb..085355b19a16011078fe3636a310bbc557855ea4 100644 (file)
@@ -167,11 +167,9 @@ calcExpirationDate(afs_int32 expType, afs_int32 expDate, afs_int32 createTime)
         */
        Int32To_ktimeRelDate(expDate, &kd);
        return (Add_RelDate_to_Time(&kd, createTime));
-       break;
 
     case BC_ABS_EXPDATE:
        return (expDate);
-       break;
 
     case BC_NO_EXPDATE:
     default:
@@ -939,7 +937,6 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
                         curDump->name, curDump->vid);
                curDump->hostAddr = 0;
                continue;
-               break;
            }
 
            if (e >= vldbEntry.nServers) {
@@ -1031,7 +1028,6 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
                case 'r':       /* retry */
                    dparamsPtr->curVolume--;    /* redump this volume */
                    continue;
-                   break;
                case 'o':       /* omit */
                    ErrorLog(1, taskId, 0, 0, "Volume %s (%u) omitted\n",
                             curDump->name, curDump->vid);
@@ -1063,7 +1059,6 @@ dumpPass(struct dumpRock * dparamsPtr, int passNumber)
 
            dparamsPtr->curVolume--;    /* redump this volume */
            continue;
-           break;
 
        case DUMP_NORETRYEOT:
            ErrorLog(1, taskId, 0, 0,
index 7042426d6dbcdfb1ee5592b4b1562849cee3da40..d9c199c24469411398b3b2f75212dde6e514d6b6 100644 (file)
@@ -7,23 +7,20 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#define ERROR_EXIT(evalue)                                      \
-       {                                                       \
+#define ERROR_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
-#define ERROR_EXIT2(evalue)                                     \
-       {                                                       \
+#define ERROR_EXIT2(evalue) do {                                \
             code = evalue;                                      \
             goto error_exit2;                                   \
-        }
+        } while (0)
 
-#define ABORT_EXIT(evalue)                                      \
-       {                                                       \
+#define ABORT_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
 
 extern void ErrorLog(int debug, afs_int32 task, afs_int32 error1,
                     afs_int32 error2, char *fmt, ...)
index 1446f7984be3a9963c795248b0f43cd99cc4a39d..3a116fd6c6817581dae460cdaef0ca9285e53c30 100644 (file)
@@ -190,7 +190,7 @@ scanVolData(afs_int32 taskId, struct butm_tapeInfo *curTapePtr,
 
     tcode = NextFile(curTapePtr);      /* guarantees we are at a filemark */
     if (tcode)
-       ERROR_EXIT(tcode)
+       ERROR_EXIT(tcode);
 
            /* Read the FileBegin FileMark */
            code = butm_ReadFileBegin(curTapePtr);
@@ -247,7 +247,7 @@ scanVolData(afs_int32 taskId, struct butm_tapeInfo *curTapePtr,
 
            ErrorLog(0, taskId, rcode, curTapePtr->error,
                     "Can't read FileData on tape\n");
-           ERROR_EXIT(rcode)
+           ERROR_EXIT(rcode);
        }
        hasdata[curr] = 1;
        *bytesRead += nbytes;
index 7a387cf3bdb0d33faf59a7364c5a0915106c9ba8..f5e2f632717a18b665610bd2ef68deaa56612572 100644 (file)
@@ -7,14 +7,12 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#define ERROR_EXIT(evalue)                                      \
-       {                                                       \
+#define ERROR_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto error_exit;                                    \
-        }
+        } while (0)
 
-#define ABORT_EXIT(evalue)                                      \
-       {                                                       \
+#define ABORT_EXIT(evalue) do {                                 \
             code = evalue;                                      \
             goto abort_exit;                                    \
-        }
+        } while (0)
index dfed4b5f2a81d99a3370f90f24ce31ba074d3762..ecc21bf8010819b500fffbefabb2bf16e5217999 100644 (file)
@@ -586,7 +586,7 @@ Rewind(usd_handle_t fid)
        return (USD_SEEK(fid, startOff, SEEK_SET, &stopOff));
     } else {
        return (ForkIoctl(fid, USDTAPE_REW, 0));
-    };
+    }
 }
 
 /* prepare tape drive for access */
index 53653ef9602909990a3e47fcafcafeadbe08e7ff..9fdaaf8aef1f5eb5841ced53503749b2fd27ab77 100644 (file)
 #include "kautils.h"
 #include "kauth_internal.h"
 
-#ifndef WORDS_BIGENDIAN
-/* This was taken from jhutz's patch for heimdal krb4. It only
- * applies to little endian systems. Big endian systems have a
- * less elegant solution documented below.
- *
- * This record is written after every real ticket, to ensure that
- * both 32- and 64-bit readers will perceive the next real ticket
- * as starting in the same place.  This record looks like a ticket
- * with the following properties:
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         "."                "."
- *   sinst         ""                 ""
- *   srealm        ".."               ".."
- *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- */
-static unsigned char align_rec[] = {
-    0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0x00, 0x2e,
-    0x2e, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
-    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00
-};
-
-#else /* AFSLITTLE_ENDIAN */
-
-/* This was taken from asedeno's patch for MIT Kerberos. These
- * alignment records are for big endian systems. We need more of them
- * because the portion of the 64-bit issue_date that overlaps with the
- * start of a ticket on 32-bit systems contains an unpredictable
- * number of NULL bytes. Preceeding these records is a second copy of
- * the 32-bit issue_date. The srealm for the alignment records is
- * always one of ".." or "?.."
- */
-
-/* No NULL bytes
- * This is actually two alignment records since both 32- and 64-bit
- * readers will agree on everything in the first record up through the
- * issue_date size, except where sname starts.
- *   Field (1)     32-bit             64-bit
- *   ============  =================  =================
- *   sname         "????."            "."
- *   sinst         ""                 ""
- *   srealm        ".."               ".."
- *   session key   00000000 xxxxxxxx  00000000 xxxxxxxx
- *   lifetime      0                  0
- *   kvno          0                  0
- *   ticket        4 nulls           4 nulls
- *   issue         0                  0
- *
- *   Field (2)     32-bit             64-bit
- *   ============  =================  =================
- *   sname         "."                "."
- *   sinst         ""                 ""
- *   srealm        ".."               ".."
- *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- *
- */
-static unsigned char align_rec_0[] = {
-    0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00,
-    0x00, 0x2e, 0x2e, 0x00, 0xff, 0xff, 0xff, 0xff,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00
-};
-
-/* One NULL byte
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         "x"  |"xx"|"xxx"   "."
- *   sinst         "xx."|"x."|"."     ".."
- *   srealm        ".."               "..."
- *   session key   2E2E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- */
-static unsigned char align_rec_1[] = {
-    0x2e, 0x00, 0x2e, 0x2e, 0x00, 0x2e, 0x2e, 0x2e,
-    0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00
-};
-
-/* Two NULL bytes
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         "x"  |"x" |"xx"    ".."
- *   sinst         ""   |"x" |""      ""
- *   srealm        "x.."|".."|".."    ".."
- *   session key   002E2E00 xxxxxxxx  xxxxxxxx 00000000
- *   lifetime      0                  0
- *   kvno          0                  12
- *   ticket        12 nulls           4 nulls
- *   issue         0                  0
- */
- static unsigned char align_rec_2[] = {
-    0x2e, 0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0xff,
-    0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00,
-    0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-/* Three NULL bytes
- * Things break here for 32-bit krb4 libraries that don't
- * understand this alignment record. We can't really do
- * anything about the fact that the three strings ended
- * in the duplicate timestamp. The good news is that this
- * only happens once every 0x1000000 seconds, once roughly
- * every six and a half months. We'll live.
- *
- * Discussion on the krbdev list has suggested the
- * issue_date be incremented by one in this case to avoid
- * the problem. I'm leaving this here just in case.
- *
- *   Field         32-bit             64-bit
- *   ============  =================  =================
- *   sname         ""                 "."
- *   sinst         ""                 ""
- *   srealm        ""                 ".."
- *   session key   2E00002E 2E00FFFF  xxxx0000 0000xxxx
- *   lifetime      0                  0
- *   kvno          4294901760         917504
- *   ticket        14 nulls           4 nulls
- *   issue         0                  0
- */
-/*
-static unsigned char align_rec_3[] = {
-    0x2e, 0x00, 0x00, 0x2e, 0x2e, 0x00, 0xff, 0xff,
-    0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-    0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-*/
-#endif /* AFSLITTLE_ENDIAN */
-
 afs_int32
 krb_write_ticket_file(char *realm)
 {
@@ -302,67 +147,6 @@ krb_write_ticket_file(char *realm)
     close(fd);
     return 0;
 
-    /* Alignment Record, from MIT Kerberos */
-#ifndef WORDS_BIGENDIAN
-    if (write(fd, align_rec, sizeof(align_rec)) != sizeof(align_rec))
-       goto bad;
-#else /* AFSLITTLE_ENDIAN */
-    {
-       int null_bytes = 0;
-       if (0 == (token.startTime & 0xff000000))
-           ++null_bytes;
-       if (0 == (token.startTime & 0x00ff0000))
-           ++null_bytes;
-       if (0 == (token.startTime & 0x0000ff00))
-           ++null_bytes;
-       if (0 == (token.startTime & 0x000000ff))
-           ++null_bytes;
-
-       switch(null_bytes) {
-       case 0:
-            /* Issue date */
-           if (write(fd, (char *) token.startTime, sizeof(afs_int32))
-               != sizeof(afs_int32))
-               goto bad;
-           if (write(fd, align_rec_0, sizeof(align_rec_0))
-               != sizeof(align_rec_0))
-               goto bad;
-           break;
-
-       case 1:
-           /* Issue date */
-           if (write(fd, (char *) &token.startTime, sizeof(afs_int32))
-               != sizeof(afs_int32))
-               goto bad;
-           if (write(fd, align_rec_1, sizeof(align_rec_1))
-               != sizeof(align_rec_1))
-               goto bad;
-           break;
-
-       case 3:
-           /* Three NULLS are troublesome but rare. We'll just pretend
-            * they don't exist by decrementing the token.startTime.
-            */
-           --token.startTime;
-       case 2:
-           /* Issue date */
-           if (write(fd, (char *) &token.startTime, sizeof(afs_int32))
-               != sizeof(afs_int32))
-               goto bad;
-           if (write(fd, align_rec_2, sizeof(align_rec_2))
-               != sizeof(align_rec_2))
-               goto bad;
-           break;
-
-       default:
-            goto bad;
-       }
-    }
-#endif  /* AFSLITTLE_ENDIAN */
-    close(fd);
-    return 0;
-
-
   bad:
     close(fd);
     return -1;
index eeb67634acf97a4ca4ae1fc1bff85fa9c433deb2..a75b111a479e8d1fc835f1ce15f74a73af141dfa 100644 (file)
@@ -182,7 +182,6 @@ get_definition(void)
        break;
     case TOK_EOF:
        return (NULL);
-       break;
     case TOK_PACKAGE:
        def_package(defp);
        break;
index aeebae58fc6ef091d815cc6da71e38d1d76d8078..cfa3d85f6be317627f9e094496d1a1521da6e828 100644 (file)
 
 #include <lwp.h>   /* temporary hack by klm */
 
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 /*!
  * \file
index eee164857597eac0b5427817639777ff1ba25688..e21cfffeebd4d73d519ea4fad6d50484269eb35f 100644 (file)
@@ -778,5 +778,4 @@ isMountPoint(char *name, struct ViceIoctl *blob)
             */
        }
     }
-    return 4;
 }
index 55d5e6f9b2d0432eb7022754b874ee0cc72d24c0..ad0971f3bb414e4f88ce58b0e9546f5b8f1abf93 100644 (file)
@@ -45,9 +45,15 @@ struct vlheader cheader;     /* kept in network byte order */
 extern afs_uint32 HostAddress[];       /* host addresses kept in host byte order */
 int maxnservers;
 struct extentaddr *ex_addr[VL_MAX_ADDREXTBLKS] = { 0, 0, 0, 0 };
-#define ABORT(c) { errorcode = (c); goto abort; }
+#define ABORT(c) do { \
+    errorcode = (c); \
+    goto abort; \
+} while (0)
 #undef END
-#define END(c) { errorcode = (c); goto end; }
+#define END(c) do { \
+    errorcode = (c); \
+    goto end; \
+} while (0)
 
 #define VLDBALLOCLIMIT 10000
 #define VLDBALLOCINCR  2048
index b5ad49a101e1c4569ce42bc5f8f44bb25a6b1158..18c051d2fd696f7d03893ada122e89ac12c3e8fb 100644 (file)
@@ -35,7 +35,10 @@ int vldbversion = 0;
 
 static int index_OK(struct ubik_trans *trans, afs_int32 blockindex);
 
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 /* Hashing algorithm based on the volume id; HASHSIZE must be prime */
 afs_int32
index 945253a60320dc3e8a4d924f42cfb941eeb8dc46..f6fb040235bfa37f592ea778fdde53a9614e9371 100644 (file)
 
 int (*vol_PollProc) (void) = 0;        /* someone must init this */
 
-#define ERROR_EXIT(code) {error = code; goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = code; \
+    goto error_exit; \
+} while (0)
 
 /* parameters for idec call - this could just be an IHandle_t, but leaving
  * open the possibility of decrementing the special files as well.
index a6f5ea777b1a21ccccd31ca655c0502bd1133f8e..bd612443841886da67535646d0ba9659828d1263 100644 (file)
@@ -13,9 +13,7 @@
 #include "daemon_com.h"
 
 #define SYNC_ENUMCASE(en) \
-    case en: \
-        return #en; \
-        break
+    case en: return #en
 
 static_inline char *
 SYNC_res2string(afs_int32 response)
index a4776debb8c6bf8a486ce79b2e97024d994b4632..6bd430bda6f14a62e7787c709f51c22e79df7f8b 100644 (file)
@@ -384,9 +384,7 @@ do_volop(struct state * state, afs_int32 command, SYNC_response * res)
 
 #define ENUMTOSTRING(en)  #en
 #define ENUMCASE(en) \
-    case en: \
-        return ENUMTOSTRING(en); \
-        break
+    case en: return ENUMTOSTRING(en)
 
 #define FLAGTOSTRING(fl)  #fl
 #define FLAGCASE(bitstr, fl, str, count) \
index ce91dd73c2b2bae3be05bce0fa7bc7a09cc32d98..87c1a1fbb68a2c7cf8a0ee9f8e2461f7c57eb390 100644 (file)
@@ -13,9 +13,7 @@
 #include "fssync.h"
 
 #define FSYNC_ENUMCASE(en) \
-    case en: \
-        return #en; \
-        break
+    case en: return #en
 
 static_inline char *
 FSYNC_com2string(afs_int32 command)
index 7d1a5c14c7e03e15fd64311ec61825a4464fb6f7..ee86bd3dd671b432fcfafdc5e376e69e991f93c2 100644 (file)
@@ -1527,7 +1527,7 @@ GetFreeTag(IHandle_t * ih, int vno)
     FDH_SYNC(fdP);
     FDH_UNLOCKFILE(fdP, offset);
     FDH_REALLYCLOSE(fdP);
-    return col;;
+    return col;
 
   badGetFreeTag:
     FDH_UNLOCKFILE(fdP, offset);
index 78aaa21b3c0d1bb714c1ab30675d50871e2499f7..6feaef81cda2f6f09f33f4d2b410d83f1e08f261 100644 (file)
@@ -8395,9 +8395,7 @@ VVLRUExtStats_r(struct VLRUExtStats * stats, afs_uint32 nvols)
 
 #define ENUMTOSTRING(en)  #en
 #define ENUMCASE(en) \
-    case en: \
-        return ENUMTOSTRING(en); \
-        break
+    case en: return ENUMTOSTRING(en)
 
 static char *
 vlru_idx_to_string(int idx)
index 2d8e4987bc47619f539769c1eda7c3df504503ac..159e8a21e651a3ca266d20ec71c793779902680c 100644 (file)
@@ -474,9 +474,7 @@ VChangeState_r(Volume * vp, VolState new_state)
 #endif /* AFS_DEMAND_ATTACH_FS */
 
 #define VENUMCASE(en) \
-    case en: \
-        return #en; \
-        break
+    case en: return #en
 
 /**
  * translate a ProgramType code to a string.
index 8d06d82e441af60193a4dd2b8e57445652e2067c..1e6e58c103048e515e0e72114c552fd1566c287d 100644 (file)
@@ -95,7 +95,10 @@ cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\
 cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\
 cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses"); \
 
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 int rxInitDone = 0;
 struct rx_connection *tconn;
index 662ccf188cc3eb89d8ba5b5a5268bb23f4f3bb08..b1b00502cdc584e6c5f0e81a829177da9e6b04a5 100644 (file)
@@ -163,7 +163,10 @@ do { \
 
 
 /* getting rid of this */
-#define ERROR_EXIT(code) {error=(code); goto error_exit;}
+#define ERROR_EXIT(code) do { \
+    error = (code); \
+    goto error_exit; \
+} while (0)
 
 
 /* Protos for static routines */
@@ -3304,9 +3307,24 @@ DelVol(struct rx_connection *conn, afs_uint32 vid, afs_int32 part,
     return acode;
 }
 
-#define ONERROR(ec, ep, es) if (ec) { fprintf(STDERR, (es), (ep)); error = (ec); goto rfail; }
-#define ONERROR0(ec, es) if (ec) { fprintf(STDERR, (es)); error = (ec); goto rfail; }
-#define ERROREXIT(ec) { error = (ec); goto rfail; }
+#define ONERROR(ec, ep, es) do { \
+    if (ec) { \
+        fprintf(STDERR, (es), (ep)); \
+        error = (ec); \
+        goto rfail; \
+    } \
+} while (0)
+#define ONERROR0(ec, es) do { \
+    if (ec) { \
+        fprintf(STDERR, (es)); \
+        error = (ec); \
+        goto rfail; \
+    } \
+} while (0)
+#define ERROREXIT(ec) do { \
+    error = (ec); \
+    goto rfail; \
+} while (0)
 
 /* Get a "transaction" on this replica.  Create the volume
  * if necessary.  Return the time from which a dump should