cleanup: get rid of %llu format specifiers

Use more explicit types instead.
pull/2661/head
Victor Julien 8 years ago
parent 1223de4208
commit 618f351210

@ -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);
}

@ -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);

@ -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__ */

@ -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);
}

@ -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;
}

@ -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);

@ -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;
}

@ -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);

@ -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;

Loading…
Cancel
Save