From: Victor Julien Date: Sun, 9 Apr 2017 19:04:14 +0000 (+0200) Subject: cleanup: get rid of %llu format specifiers X-Git-Tag: suricata-4.0.0-beta1~213 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=618f351210495a38d5d406e4a966f811942ee46c;p=thirdparty%2Fsuricata.git cleanup: get rid of %llu format specifiers Use more explicit types instead. --- diff --git a/src/defrag-hash.c b/src/defrag-hash.c index a5355ebda0..54206b2c73 100644 --- a/src/defrag-hash.c +++ b/src/defrag-hash.c @@ -205,7 +205,7 @@ void DefragInitConfig(char quiet) (void) SC_ATOMIC_ADD(defrag_memuse, (defrag_config.hash_size * sizeof(DefragTrackerHashRow))); if (quiet == FALSE) { - SCLogConfig("allocated %llu bytes of memory for the defrag hash... " + SCLogConfig("allocated %"PRIu64" bytes of memory for the defrag hash... " "%" PRIu32 " buckets of size %" PRIuMAX "", SC_ATOMIC_GET(defrag_memuse), defrag_config.hash_size, (uintmax_t)sizeof(DefragTrackerHashRow)); @@ -239,7 +239,7 @@ void DefragInitConfig(char quiet) } if (quiet == FALSE) { - SCLogConfig("defrag memory usage: %llu bytes, maximum: %"PRIu64, + SCLogConfig("defrag memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(defrag_memuse), defrag_config.memcap); } diff --git a/src/defrag-hash.h b/src/defrag-hash.h index 2d48393a77..5697fdb958 100644 --- a/src/defrag-hash.h +++ b/src/defrag-hash.h @@ -85,7 +85,7 @@ typedef struct DefragConfig_ { ((((uint64_t)SC_ATOMIC_GET(defrag_memuse) + (uint64_t)(size)) <= defrag_config.memcap)) DefragConfig defrag_config; -SC_ATOMIC_DECLARE(unsigned long long int,defrag_memuse); +SC_ATOMIC_DECLARE(uint64_t,defrag_memuse); SC_ATOMIC_DECLARE(unsigned int,defragtracker_counter); SC_ATOMIC_DECLARE(unsigned int,defragtracker_prune_idx); diff --git a/src/flow-private.h b/src/flow-private.h index 543170892f..9cfcf22863 100644 --- a/src/flow-private.h +++ b/src/flow-private.h @@ -97,7 +97,7 @@ FlowBucket *flow_hash; FlowConfig flow_config; /** flow memuse counter (atomic), for enforcing memcap limit */ -SC_ATOMIC_DECLARE(long long unsigned int, flow_memuse); +SC_ATOMIC_DECLARE(uint64_t, flow_memuse); #endif /* __FLOW_PRIVATE_H__ */ diff --git a/src/flow.c b/src/flow.c index df4a79a7af..728145552b 100644 --- a/src/flow.c +++ b/src/flow.c @@ -431,7 +431,7 @@ void FlowInitConfig(char quiet) (void) SC_ATOMIC_ADD(flow_memuse, (flow_config.hash_size * sizeof(FlowBucket))); if (quiet == FALSE) { - SCLogConfig("allocated %llu bytes of memory for the flow hash... " + SCLogConfig("allocated %"PRIu64" bytes of memory for the flow hash... " "%" PRIu32 " buckets of size %" PRIuMAX "", SC_ATOMIC_GET(flow_memuse), flow_config.hash_size, (uintmax_t)sizeof(FlowBucket)); @@ -459,7 +459,7 @@ void FlowInitConfig(char quiet) if (quiet == FALSE) { SCLogConfig("preallocated %" PRIu32 " flows of size %" PRIuMAX "", flow_spare_q.len, (uintmax_t)(sizeof(Flow) + + FlowStorageSize())); - SCLogConfig("flow memory usage: %llu bytes, maximum: %"PRIu64, + SCLogConfig("flow memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(flow_memuse), flow_config.memcap); } diff --git a/src/host.c b/src/host.c index 8df0cde874..276d1b42ee 100644 --- a/src/host.c +++ b/src/host.c @@ -210,7 +210,7 @@ void HostInitConfig(char quiet) (void) SC_ATOMIC_ADD(host_memuse, (host_config.hash_size * sizeof(HostHashRow))); if (quiet == FALSE) { - SCLogConfig("allocated %llu bytes of memory for the host hash... " + SCLogConfig("allocated %"PRIu64" bytes of memory for the host hash... " "%" PRIu32 " buckets of size %" PRIuMAX "", SC_ATOMIC_GET(host_memuse), host_config.hash_size, (uintmax_t)sizeof(HostHashRow)); @@ -237,7 +237,7 @@ void HostInitConfig(char quiet) if (quiet == FALSE) { SCLogConfig("preallocated %" PRIu32 " hosts of size %" PRIu16 "", host_spare_q.len, g_host_size); - SCLogConfig("host memory usage: %llu bytes, maximum: %"PRIu64, + SCLogConfig("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(host_memuse), host_config.memcap); } @@ -252,7 +252,7 @@ void HostPrintStats (void) SCLogPerf("hostbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "", hostbits_added, hostbits_removed, hostbits_memuse_max); #endif /* HOSTBITS_STATS */ - SCLogPerf("host memory usage: %llu bytes, maximum: %"PRIu64, + SCLogPerf("host memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(host_memuse), host_config.memcap); return; } diff --git a/src/host.h b/src/host.h index e3dd167a2e..d22f6f32f0 100644 --- a/src/host.h +++ b/src/host.h @@ -129,9 +129,9 @@ typedef struct HostConfig_ { } while (0) HostConfig host_config; -SC_ATOMIC_DECLARE(unsigned long long int,host_memuse); -SC_ATOMIC_DECLARE(unsigned int,host_counter); -SC_ATOMIC_DECLARE(unsigned int,host_prune_idx); +SC_ATOMIC_DECLARE(uint64_t,host_memuse); +SC_ATOMIC_DECLARE(uint32_t,host_counter); +SC_ATOMIC_DECLARE(uint32_t,host_prune_idx); void HostInitConfig(char quiet); void HostShutdown(void); diff --git a/src/ippair.c b/src/ippair.c index d7d3440c66..29335996d0 100644 --- a/src/ippair.c +++ b/src/ippair.c @@ -206,7 +206,7 @@ void IPPairInitConfig(char quiet) (void) SC_ATOMIC_ADD(ippair_memuse, (ippair_config.hash_size * sizeof(IPPairHashRow))); if (quiet == FALSE) { - SCLogConfig("allocated %llu bytes of memory for the ippair hash... " + SCLogConfig("allocated %"PRIu64" bytes of memory for the ippair hash... " "%" PRIu32 " buckets of size %" PRIuMAX "", SC_ATOMIC_GET(ippair_memuse), ippair_config.hash_size, (uintmax_t)sizeof(IPPairHashRow)); @@ -233,7 +233,7 @@ void IPPairInitConfig(char quiet) if (quiet == FALSE) { SCLogConfig("preallocated %" PRIu32 " ippairs of size %" PRIu16 "", ippair_spare_q.len, g_ippair_size); - SCLogConfig("ippair memory usage: %llu bytes, maximum: %"PRIu64, + SCLogConfig("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(ippair_memuse), ippair_config.memcap); } @@ -248,7 +248,7 @@ void IPPairPrintStats (void) SCLogPerf("ippairbits added: %" PRIu32 ", removed: %" PRIu32 ", max memory usage: %" PRIu32 "", ippairbits_added, ippairbits_removed, ippairbits_memuse_max); #endif /* IPPAIRBITS_STATS */ - SCLogPerf("ippair memory usage: %llu bytes, maximum: %"PRIu64, + SCLogPerf("ippair memory usage: %"PRIu64" bytes, maximum: %"PRIu64, SC_ATOMIC_GET(ippair_memuse), ippair_config.memcap); return; } diff --git a/src/ippair.h b/src/ippair.h index 79affc6245..812319e6f8 100644 --- a/src/ippair.h +++ b/src/ippair.h @@ -126,9 +126,9 @@ typedef struct IPPairConfig_ { } while (0) IPPairConfig ippair_config; -SC_ATOMIC_DECLARE(unsigned long long int,ippair_memuse); -SC_ATOMIC_DECLARE(unsigned int,ippair_counter); -SC_ATOMIC_DECLARE(unsigned int,ippair_prune_idx); +SC_ATOMIC_DECLARE(uint64_t,ippair_memuse); +SC_ATOMIC_DECLARE(uint32_t,ippair_counter); +SC_ATOMIC_DECLARE(uint32_t,ippair_prune_idx); void IPPairInitConfig(char quiet); void IPPairShutdown(void); diff --git a/src/util-coredump-config.c b/src/util-coredump-config.c index 9555e0fd71..639abc1959 100644 --- a/src/util-coredump-config.c +++ b/src/util-coredump-config.c @@ -71,7 +71,7 @@ int32_t CoredumpLoadConfig (void) SCLogInfo ("Illegal core dump size: %s.", dump_size_config); return 0; } - SCLogInfo ("Max dump is %llu", (unsigned long long) max_dump); + SCLogInfo ("Max dump is %"PRIu64, (uint64_t) max_dump); } #if defined OS_WIN32 @@ -165,7 +165,7 @@ int32_t CoredumpLoadConfig (void) new_lim.rlim_max = lim.rlim_max; } if (setrlimit (RLIMIT_CORE, &new_lim) == 0) { - SCLogInfo ("Core dump setting attempted is %llu", (unsigned long long) new_lim.rlim_cur); + SCLogInfo ("Core dump setting attempted is %"PRIu64, (uint64_t) new_lim.rlim_cur); struct rlimit actual_lim; if (getrlimit (RLIMIT_CORE, &actual_lim) == 0) { if (actual_lim.rlim_cur == RLIM_INFINITY) { @@ -177,7 +177,7 @@ int32_t CoredumpLoadConfig (void) } #endif else { - SCLogInfo ("Core dump size set to %llu", (unsigned long long) actual_lim.rlim_cur); + SCLogInfo ("Core dump size set to %"PRIu64, (uint64_t) actual_lim.rlim_cur); } } return 1;