]> The Tcpdump Group git mirrors - libpcap/blobdiff - optimize.c
CI: Call print_so_deps() on rpcapd in remote enabled build
[libpcap] / optimize.c
index 89844411ed99b06543849c20cdc7ab2d7d9161b0..c617f536936eef05d4b7a4895bfebd7b1f9c54d4 100644 (file)
@@ -117,7 +117,7 @@ pcap_set_print_dot_graph(int value)
   #define lowest_set_bit(mask) ((u_int)__builtin_ctz(mask))
 #elif defined(_MSC_VER)
   /*
-   * Visual Studio; we support only 2005 and later, so use
+   * Visual Studio; we support only 2015 and later, so use
    * _BitScanForward().
    */
 #include <intrin.h>
@@ -336,10 +336,6 @@ static void find_inedges(opt_state_t *, struct block *);
 static void opt_dump(opt_state_t *, struct icode *);
 #endif
 
-#ifndef MAX
-#define MAX(a,b) ((a)>(b)?(a):(b))
-#endif
-
 static void
 find_levels_r(opt_state_t *opt_state, struct icode *ic, struct block *b)
 {
@@ -354,7 +350,7 @@ find_levels_r(opt_state_t *opt_state, struct icode *ic, struct block *b)
        if (JT(b)) {
                find_levels_r(opt_state, ic, JT(b));
                find_levels_r(opt_state, ic, JF(b));
-               level = MAX(JT(b)->level, JF(b)->level) + 1;
+               level = max(JT(b)->level, JF(b)->level) + 1;
        } else
                level = 0;
        b->level = level;
@@ -2165,7 +2161,7 @@ opt_loop(opt_state_t *opt_state, struct icode *ic, int do_stmts)
 
 #ifdef BDEBUG
        if (pcap_optimizer_debug > 1 || pcap_print_dot_graph) {
-               printf("opt_loop(root, %d) begin\n", do_stmts);
+               printf("%s(root, %d) begin\n", __func__, do_stmts);
                opt_dump(opt_state, ic);
        }
 #endif
@@ -2188,7 +2184,7 @@ opt_loop(opt_state_t *opt_state, struct icode *ic, int do_stmts)
                opt_blks(opt_state, ic, do_stmts);
 #ifdef BDEBUG
                if (pcap_optimizer_debug > 1 || pcap_print_dot_graph) {
-                       printf("opt_loop(root, %d) bottom, done=%d\n", do_stmts, opt_state->done);
+                       printf("%s(root, %d) bottom, done=%d\n", __func__, do_stmts, opt_state->done);
                        opt_dump(opt_state, ic);
                }
 #endif
@@ -3075,6 +3071,6 @@ opt_dump(opt_state_t *opt_state, struct icode *ic)
        else
                status = plain_dump(ic, errbuf);
        if (status == -1)
-               opt_error(opt_state, "opt_dump: icode_to_fcode failed: %s", errbuf);
+               opt_error(opt_state, "%s: icode_to_fcode failed: %s", __func__, errbuf);
 }
 #endif