]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ospf.c
Remove unnecessary float and double variables.
[tcpdump] / print-ospf.c
index fe06d21bf6513006d4dff7f677fc1a5b56c7998f..9bdc85841a8ebf6fef53661b1e9cd973d677013e 100644 (file)
@@ -327,7 +327,6 @@ ospf_te_tlv_link_print(netdissect_options *ndo,
 {
     u_int subtlv_type, subtlv_length;
     u_int priority_level, te_class, count_srlg;
-    float bw;
 
     while (tlv_length != 0) {
         if (tlv_length < 4) {
@@ -391,8 +390,7 @@ ospf_te_tlv_link_print(netdissect_options *ndo,
                 ND_PRINT(" != 4");
                 goto invalid;
             }
-            bw = GET_BE_F_4(tptr);
-            ND_PRINT(", %.3f Mbps", bw * 8 / 1000000);
+            ND_PRINT(", %.3f Mbps", GET_BE_F_4(tptr) * 8 / 1000000);
             break;
         case LS_OPAQUE_TE_LINK_SUBTLV_UNRES_BW:
             if (subtlv_length != 32) {
@@ -400,10 +398,9 @@ ospf_te_tlv_link_print(netdissect_options *ndo,
                 goto invalid;
             }
             for (te_class = 0; te_class < 8; te_class++) {
-                bw = GET_BE_F_4(tptr + te_class * 4);
                 ND_PRINT("\n\t\tTE-Class %u: %.3f Mbps",
                        te_class,
-                       bw * 8 / 1000000);
+                       GET_BE_F_4(tptr + te_class * 4) * 8 / 1000000);
             }
             break;
         case LS_OPAQUE_TE_LINK_SUBTLV_BW_CONSTRAINTS:
@@ -425,10 +422,9 @@ ospf_te_tlv_link_print(netdissect_options *ndo,
             }
             /* decode BCs until the subTLV ends */
             for (te_class = 0; te_class < (subtlv_length-4)/4; te_class++) {
-                bw = GET_BE_F_4(tptr + 4 + te_class * 4);
                 ND_PRINT("\n\t\t  Bandwidth constraint CT%u: %.3f Mbps",
                        te_class,
-                       bw * 8 / 1000000);
+                       GET_BE_F_4(tptr + 4 + te_class * 4) * 8 / 1000000);
             }
             break;
         case LS_OPAQUE_TE_LINK_SUBTLV_TE_METRIC:
@@ -458,10 +454,9 @@ ospf_te_tlv_link_print(netdissect_options *ndo,
             ND_PRINT("\n\t\tLSP Encoding: %s\n\t\tMax LSP Bandwidth:",
                    tok2str(gmpls_encoding_values, "Unknown", GET_U_1((tptr + 1))));
             for (priority_level = 0; priority_level < 8; priority_level++) {
-                bw = GET_BE_F_4(tptr + 4 + (priority_level * 4));
                 ND_PRINT("\n\t\t  priority level %u: %.3f Mbps",
                        priority_level,
-                       bw * 8 / 1000000);
+                       GET_BE_F_4(tptr + 4 + (priority_level * 4)) * 8 / 1000000);
             }
             break;
         case LS_OPAQUE_TE_LINK_SUBTLV_LINK_TYPE: