]> The Tcpdump Group git mirrors - tcpdump/commitdiff
AppleTalk: Address a few cppcheck style notices.
authorDenis Ovsienko <[email protected]>
Wed, 6 Sep 2017 08:57:20 +0000 (09:57 +0100)
committerDenis Ovsienko <[email protected]>
Wed, 6 Sep 2017 08:58:36 +0000 (09:58 +0100)
[print-atalk.c:283]: (style) The scope of the variable 'c' can be
reduced.
[print-atalk.c:380]: (style) The scope of the variable 'c' can be
reduced.
[print-atalk.c:360]: (style) Variable 'c' is assigned a value that is
never used.

print-atalk.c

index 9d7d69d3d790189f01ca5d430980b98d021d2ac4..08376b6296d242b7d74a78179814f60b7e462a0c 100644 (file)
@@ -280,7 +280,6 @@ static void
 atp_print(netdissect_options *ndo,
           register const struct atATP *ap, u_int length)
 {
 atp_print(netdissect_options *ndo,
           register const struct atATP *ap, u_int length)
 {
-       char c;
        uint32_t data;
 
        if ((const u_char *)(ap + 1) > ndo->ndo_snapend) {
        uint32_t data;
 
        if ((const u_char *)(ap + 1) > ndo->ndo_snapend) {
@@ -346,7 +345,7 @@ atp_print(netdissect_options *ndo,
 
                /* there shouldn't be any control flags */
                if (ap->control & (atpXO|atpEOM|atpSTS)) {
 
                /* there shouldn't be any control flags */
                if (ap->control & (atpXO|atpEOM|atpSTS)) {
-                       c = '[';
+                       char c = '[';
                        if (ap->control & atpXO) {
                                ND_PRINT((ndo, "%cXO", c));
                                c = ',';
                        if (ap->control & atpXO) {
                                ND_PRINT((ndo, "%cXO", c));
                                c = ',';
@@ -357,7 +356,6 @@ atp_print(netdissect_options *ndo,
                        }
                        if (ap->control & atpSTS) {
                                ND_PRINT((ndo, "%cSTS", c));
                        }
                        if (ap->control & atpSTS) {
                                ND_PRINT((ndo, "%cSTS", c));
-                               c = ',';
                        }
                        ND_PRINT((ndo, "]"));
                }
                        }
                        ND_PRINT((ndo, "]"));
                }
@@ -377,7 +375,6 @@ static void
 atp_bitmap_print(netdissect_options *ndo,
                  register u_char bm)
 {
 atp_bitmap_print(netdissect_options *ndo,
                  register u_char bm)
 {
-       register char c;
        register int i;
 
        /*
        register int i;
 
        /*
@@ -386,7 +383,7 @@ atp_bitmap_print(netdissect_options *ndo,
         * (gcc is smart enough to eliminate it, at least on the Sparc).
         */
        if ((bm + 1) & (bm & 0xff)) {
         * (gcc is smart enough to eliminate it, at least on the Sparc).
         */
        if ((bm + 1) & (bm & 0xff)) {
-               c = '<';
+               register char c = '<';
                for (i = 0; bm; ++i) {
                        if (bm & 1) {
                                ND_PRINT((ndo, "%c%d", c, i));
                for (i = 0; bm; ++i) {
                        if (bm & 1) {
                                ND_PRINT((ndo, "%c%d", c, i));