]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Custom NFA_API_NO_IMPL variant for zombie_status
authorJustin Viiret <justin.viiret@intel.com>
Fri, 23 Oct 2015 00:39:31 +0000 (11:39 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Fri, 30 Oct 2015 00:28:37 +0000 (11:28 +1100)
Silences ICC warning #188: enumerated type mixed with another type.

src/nfa/castle.h
src/nfa/gough.h
src/nfa/lbr.h
src/nfa/mcclellan.h
src/nfa/mpv.h
src/nfa/nfa_internal.h

index 6a7fe70cd04db0b5f81c8cc27d985bbce80445ec..8fc3514b43c22902de26e7d8a90284c123e3d1cc 100644 (file)
@@ -54,7 +54,7 @@ char nfaExecCastle0_expandState(const struct NFA *nfa, void *dest,
 
 #define nfaExecCastle0_testEOD NFA_API_NO_IMPL
 #define nfaExecCastle0_B_Reverse NFA_API_NO_IMPL
-#define nfaExecCastle0_zombie_status NFA_API_NO_IMPL
+#define nfaExecCastle0_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 #ifdef __cplusplus
 }
index 7729c6536af8173191e795ddd7aa8183f44471cc..41d4cb5a34fa64b10262473afd547cab2d6870d7 100644 (file)
@@ -55,7 +55,7 @@ char nfaExecGough8_expandState(const struct NFA *nfa, void *dest,
                                const void *src, u64a offset, u8 key);
 
 #define nfaExecGough8_B_Reverse NFA_API_NO_IMPL
-#define nfaExecGough8_zombie_status NFA_API_NO_IMPL
+#define nfaExecGough8_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 // 16-bit Gough
 
@@ -77,6 +77,6 @@ char nfaExecGough16_expandState(const struct NFA *nfa, void *dest,
                                 const void *src, u64a offset, u8 key);
 
 #define nfaExecGough16_B_Reverse NFA_API_NO_IMPL
-#define nfaExecGough16_zombie_status NFA_API_NO_IMPL
+#define nfaExecGough16_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 #endif
index af7d983da875b28200e563d9305333200f3bcccb..b770477df1e351d99c6692da886bf9411e9aed83 100644 (file)
@@ -56,7 +56,7 @@ char nfaExecLbrDot_expandState(const struct NFA *nfa, void *dest,
 
 #define nfaExecLbrDot_testEOD NFA_API_NO_IMPL
 #define nfaExecLbrDot_B_Reverse NFA_API_NO_IMPL
-#define nfaExecLbrDot_zombie_status NFA_API_NO_IMPL
+#define nfaExecLbrDot_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 // LBR Verm
 
@@ -76,7 +76,7 @@ char nfaExecLbrVerm_expandState(const struct NFA *nfa, void *dest,
 
 #define nfaExecLbrVerm_testEOD NFA_API_NO_IMPL
 #define nfaExecLbrVerm_B_Reverse NFA_API_NO_IMPL
-#define nfaExecLbrVerm_zombie_status NFA_API_NO_IMPL
+#define nfaExecLbrVerm_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 // LBR Negated Verm
 
@@ -96,7 +96,7 @@ char nfaExecLbrNVerm_expandState(const struct NFA *nfa, void *dest,
 
 #define nfaExecLbrNVerm_testEOD NFA_API_NO_IMPL
 #define nfaExecLbrNVerm_B_Reverse NFA_API_NO_IMPL
-#define nfaExecLbrNVerm_zombie_status NFA_API_NO_IMPL
+#define nfaExecLbrNVerm_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 // LBR Shuf
 
@@ -116,7 +116,7 @@ char nfaExecLbrShuf_expandState(const struct NFA *nfa, void *dest,
 
 #define nfaExecLbrShuf_testEOD NFA_API_NO_IMPL
 #define nfaExecLbrShuf_B_Reverse NFA_API_NO_IMPL
-#define nfaExecLbrShuf_zombie_status NFA_API_NO_IMPL
+#define nfaExecLbrShuf_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 // LBR Truffle
 
@@ -136,7 +136,7 @@ char nfaExecLbrTruf_expandState(const struct NFA *nfa, void *dest,
 
 #define nfaExecLbrTruf_testEOD NFA_API_NO_IMPL
 #define nfaExecLbrTruf_B_Reverse NFA_API_NO_IMPL
-#define nfaExecLbrTruf_zombie_status NFA_API_NO_IMPL
+#define nfaExecLbrTruf_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 #ifdef __cplusplus
 }
index 856740b196fb2ecb597cb1db2824bb723a47830b..6b4ec2d55d7e43cc66078b088dd507fc0801144c 100644 (file)
@@ -56,7 +56,7 @@ char nfaExecMcClellan8_expandState(const struct NFA *nfa, void *dest,
                                    const void *src, u64a offset, u8 key);
 
 #define nfaExecMcClellan8_B_Reverse NFA_API_NO_IMPL
-#define nfaExecMcClellan8_zombie_status NFA_API_NO_IMPL
+#define nfaExecMcClellan8_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 // 16-bit McClellan
 
@@ -79,7 +79,7 @@ char nfaExecMcClellan16_expandState(const struct NFA *nfa, void *dest,
                                     const void *src, u64a offset, u8 key);
 
 #define nfaExecMcClellan16_B_Reverse NFA_API_NO_IMPL
-#define nfaExecMcClellan16_zombie_status NFA_API_NO_IMPL
+#define nfaExecMcClellan16_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 /**
  * Simple streaming mode calls:
index 18c52e994db2eaf9cb35694875a07822647eca86..dc5dad6f90522341d407b4e9f6966b243a5e1484 100644 (file)
@@ -50,7 +50,7 @@ char nfaExecMpv0_expandState(const struct NFA *nfa, void *dest, const void *src,
 #define nfaExecMpv0_QR NFA_API_NO_IMPL
 #define nfaExecMpv0_Q2 NFA_API_NO_IMPL /* for non-chained suffixes. */
 #define nfaExecMpv0_B_Reverse NFA_API_NO_IMPL
-#define nfaExecMpv0_zombie_status NFA_API_NO_IMPL
+#define nfaExecMpv0_zombie_status NFA_API_ZOMBIE_NO_IMPL
 
 /**
  * return 0 if the mpv dies, otherwise returns the location of the next possible
index 14678c2f18a1122c41e640fc62e9a241e587bc18..e13482b5f66dd302c66bce61c04f6c543581eec7 100644 (file)
@@ -237,16 +237,32 @@ static really_inline
 int isMultiTopType(u8 t) {
     return !isDfaType(t) && !isLbrType(t);
 }
-/** Macro used in place of unimplemented NFA API functions for a given
+
+/** Macros used in place of unimplemented NFA API functions for a given
  * engine. */
 #if !defined(_WIN32)
-#define NFA_API_NO_IMPL(...)                                                  \
+
+/* Use for functions that return an integer. */
+#define NFA_API_NO_IMPL(...)                                                   \
     ({                                                                         \
         assert("not implemented for this engine!");                            \
         0; /* return value, for places that need it */                         \
     })
+
+/* Use for _zombie_status functions. */
+#define NFA_API_ZOMBIE_NO_IMPL(...)                                            \
+    ({                                                                         \
+        assert("not implemented for this engine!");                            \
+        NFA_ZOMBIE_NO;                                                         \
+    })
+
 #else
-#define NFA_API_NO_IMPL(...) 0
+
+/* Simpler implementation for compilers that don't like the GCC extension used
+ * above. */
+#define NFA_API_NO_IMPL(...)        0
+#define NFA_API_ZOMBIE_NO_IMPL(...) NFA_ZOMBIE_NO
+
 #endif
 
 #ifdef __cplusplus