]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed some xcode analyzer issues
authorRuss Combs <rucombs@cisco.com>
Tue, 7 Oct 2014 16:04:49 +0000 (12:04 -0400)
committerRuss Combs <rucombs@cisco.com>
Tue, 7 Oct 2014 16:04:49 +0000 (12:04 -0400)
ChangeLog
src/detection/detect.cc
src/time/profiler.h

index bf8eef6ac67e16bf2376517d97ba62139fe2aaa0..05f7d8c0ca2986d0e30c4374afdc525110c85ddb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -21,6 +21,7 @@
 -- commented out mpse start up foo - needs reformatting
 -- added snort.detach() and fixed -j parsing
 -- various parsing changes for improved error handling
+-- fixed some Xcode analyzer issues
 
 122
 -- pulled thread pinning from Josh
index d4a38595ff2b35d92cfcf60446a250cfc4176e5d..9f548740fd6574b1761e990a3d09db6bbca392db 100644 (file)
@@ -90,12 +90,11 @@ void snort_ignore(Packet*) { }
 
 void snort_inspect(Packet* p)
 {
-#ifdef PPM_MGR
-    uint64_t pktcnt=0;
-#endif
     PROFILE_VARS;
 
 #ifdef PPM_MGR
+    uint64_t pktcnt=0;
+
     /* Begin Packet Performance Monitoring  */
     if( PPM_PKTS_ENABLED() )
     {
index cd63017d3a9937481193364b09ed8c9caaa59a15..55ea3aa9c9a5cff5143a43c4393b0c2fd1524eb9 100644 (file)
@@ -55,6 +55,11 @@ struct ProfileStats
 #define PROFILE_VARS_NAMED(name) uint64_t name##_ticks_start, name##_ticks_end
 #define PROFILE_VARS PROFILE_VARS_NAMED(snort)
 
+// we could use PROFILE_START_NAMED(node) instead
+// but that confuses static analysis
+#define PROFILE_START_NODE \
+    get_clockticks(node_ticks_start)
+
 #define PROFILE_START_NAMED(name) \
     get_clockticks(name##_ticks_start)
 
@@ -75,7 +80,7 @@ struct ProfileStats
     if (PROFILING_RULES) { \
         unsigned id = get_instance_id(); \
         node->state[id].checks++; \
-        PROFILE_START_NAMED(node); \
+        PROFILE_START_NODE; \
     }
 
 #define NODE_PROFILE_END_MATCH(node) \
@@ -96,7 +101,7 @@ struct ProfileStats
 
 #define NODE_PROFILE_TMPSTART(node) \
     if (PROFILING_RULES) { \
-        PROFILE_START_NAMED(node); \
+        PROFILE_START_NODE; \
     }
 
 #define NODE_PROFILE_TMPEND(node) \