]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
cleanup: get rid of %llu format specifiers
authorVictor Julien <victor@inliniac.net>
Sun, 9 Apr 2017 19:04:14 +0000 (21:04 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 13 Apr 2017 08:49:37 +0000 (10:49 +0200)
Use more explicit types instead.

src/defrag-hash.c
src/defrag-hash.h
src/flow-private.h
src/flow.c
src/host.c
src/host.h
src/ippair.c
src/ippair.h
src/util-coredump-config.c

index a5355ebda06bb45cb7140f3a25e13142e5fdc187..54206b2c73cc197877bb4d18813d4b068173d974 100644 (file)
@@ -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);
     }
 
index 2d48393a77c479c970466ff36239a8ee99edf840..5697fdb9582c4d39818f3d09e23f7e9dbe6a020e 100644 (file)
@@ -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);
 
index 543170892f5a950c70ddee33a06d077f8b3dc1fb..9cfcf228637bc75d4cb27c863a5cfbcaf0cbb89e 100644 (file)
@@ -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__ */
 
index df4a79a7af6eb5a551773a799f96d27f86b696b1..728145552b85855dc2632830fc89e05a52a40088 100644 (file)
@@ -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);
     }
 
index 8df0cde874e1a5bb70828efa7f3776706ab305db..276d1b42ee176348ddfff84147263b3981956ffe 100644 (file)
@@ -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;
 }
index e3dd167a2e310f53ce9bd32dfb13f6e58a050921..d22f6f32f017abe094e190e880085db2ac7ce8fc 100644 (file)
@@ -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);
index d7d3440c668a0df9a7f9a568b797d36d63659783..29335996d044a58cebc6d2658e93e338c107db7b 100644 (file)
@@ -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;
 }
index 79affc62453518d88ff08192e9289df7950a3588..812319e6f8bda26a45cdb20782f0b2d4fc95d50f 100644 (file)
@@ -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);
index 9555e0fd710329a4638c7792f54e3b27f7832eb8..639abc19597e09dbc9db25cb42491574a9b98612 100644 (file)
@@ -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;