]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #249 in SNORT/snort3 from crc/cleanup2 to master
authorRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 9 Feb 2016 16:51:06 +0000 (11:51 -0500)
committerRuss Combs (rucombs) <rucombs@cisco.com>
Tue, 9 Feb 2016 16:51:06 +0000 (11:51 -0500)
Squashed commit of the following:

commit 3472c6f4a9cf0b2b18b26d2fe11ddd6a16955686
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Feb 9 11:29:42 2016 -0500

    fix value tests num_chars

commit ddb222549897e8b0b2dcbb5b6c11cd1b55534a9f
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Feb 9 09:40:37 2016 -0500

    fix issues reported by Bill Parker

commit f283063f2e4662097600d425d243db51d0683d00
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Feb 9 09:38:18 2016 -0500

    warning cleanup

commit f0c507b03bc0a6a1938eb3e1c7173a40677c59d2
Author: Russ Combs <rucombs@cisco.com>
Date:   Tue Feb 9 06:49:27 2016 -0500

    remove static from static inline

commit 648a4fed7973841e9031a59e03213d8a998f4606
Author: Russ Combs <rucombs@cisco.com>
Date:   Mon Feb 8 23:45:54 2016 -0500

    fix dead assignments

53 files changed:
src/actions/actions.h
src/codecs/ip/checksum.h
src/decompress/file_decomp.h
src/detection/detect.h
src/detection/detection_util.h
src/detection/treenodes.h
src/file_api/file_api.h
src/filters/sfrf.h
src/framework/value.cc
src/hash/hashes.h
src/hash/sfxhash.h
src/log/text_log.h
src/lua/lua_iface.h
src/lua/lua_stack.h
src/lua/lua_table.h
src/lua/lua_test_common.h
src/lua/lua_util.h
src/mime/file_mime_paf.h
src/network_inspectors/normalize/norm.h
src/network_inspectors/perf_monitor/perf_monitor.h
src/packet_io/active.h
src/parser/parser.h
src/piglet/piglet_api.h
src/piglet_plugins/pp_raw_buffer_iface.h
src/protocols/ipv4.h
src/protocols/ipv6.h
src/protocols/packet.h
src/protocols/packet_manager.h
src/protocols/protocol_ids.h
src/protocols/token_ring.h
src/service_inspectors/dce_rpc/dce_co.h
src/service_inspectors/dce_rpc/dce_list.h
src/service_inspectors/dce_rpc/dce_smb.h
src/service_inspectors/dce_rpc/dce_smb_paf.cc
src/service_inspectors/dce_rpc/dce_tcp.h
src/service_inspectors/dce_rpc/dce_tcp_paf.cc
src/service_inspectors/dce_rpc/dce_utils.h
src/service_inspectors/ftp_telnet/ftp_parse.cc
src/service_inspectors/http_inspect/hi_main.h
src/service_inspectors/http_inspect/hi_util.h
src/sfip/sf_ip.h
src/sfrt/sfrt.h
src/stream/libtcp/tcp_state_handler.cc
src/stream/paf.h
src/stream/tcp/tcp_debug_trace.h
src/stream/tcp/tcp_module.h
src/stream/tcp/tcp_state_closed.cc
src/target_based/snort_protocols.h
src/time/cpuclock.h
src/utils/snort_bounds.h
src/utils/util.h
tools/snort2lua/init_state.h
tools/u2spewfoo/u2spewfoo.cc

index 88cd35ffc123bca6d4f9ee90bf4638057e3806f3..ad1575e3620e4ae556f034636bbb205ace188dc4 100644 (file)
@@ -55,7 +55,7 @@ void action_execute(RuleType, struct Packet*, const struct OptTreeNode*,
 
 void action_apply(RuleType, struct Packet*);
 
-static inline bool pass_action(RuleType a)
+inline bool pass_action(RuleType a)
 { return ( a == RULE_TYPE__PASS ); }
 
 #endif
index 18afe1a972e26756b9df3f8f9c7d4cb61dc2e520..1a9d9ad862b652eedfee9fbcd6f1d52a1503bcf7 100644 (file)
@@ -87,7 +87,7 @@ struct Psuedoheader6Union
     };
 };
 
-static inline uint16_t cksum_add(const uint16_t* buf, std::size_t len, uint32_t cksum)
+inline uint16_t cksum_add(const uint16_t* buf, std::size_t len, uint32_t cksum)
 {
     const uint16_t* sp = buf;
     std::size_t n, sn;
@@ -167,7 +167,7 @@ static inline uint16_t cksum_add(const uint16_t* buf, std::size_t len, uint32_t
     return (uint16_t)(~cksum);
 }
 
-static inline void add_ipv4_pseudoheader(const Pseudoheader* const ph4,
+inline void add_ipv4_pseudoheader(const Pseudoheader* const ph4,
     uint32_t& cksum)
 {
     /*
@@ -187,7 +187,7 @@ static inline void add_ipv4_pseudoheader(const Pseudoheader* const ph4,
     cksum += h[5];
 }
 
-static inline void add_ipv6_pseudoheader(const Pseudoheader6* const ph6,
+inline void add_ipv6_pseudoheader(const Pseudoheader6* const ph6,
     uint32_t& cksum)
 {
     /*
@@ -219,7 +219,7 @@ static inline void add_ipv6_pseudoheader(const Pseudoheader6* const ph6,
     cksum += h[17];
 }
 
-static inline void add_tcp_header(const uint16_t*& d,
+inline void add_tcp_header(const uint16_t*& d,
     std::size_t& len,
     uint32_t& cksum)
 {
@@ -238,7 +238,7 @@ static inline void add_tcp_header(const uint16_t*& d,
     len -= 20;
 }
 
-static inline void add_udp_header(const uint16_t*& d,
+inline void add_udp_header(const uint16_t*& d,
     size_t& len,
     uint32_t& cksum)
 {
@@ -251,7 +251,7 @@ static inline void add_udp_header(const uint16_t*& d,
     d += 4;
 }
 
-static inline void add_ip_header(const uint16_t*& d,
+inline void add_ip_header(const uint16_t*& d,
     std::size_t& len,
     uint32_t& cksum)
 {
@@ -338,7 +338,7 @@ inline uint16_t ip_cksum(const uint16_t* buf, std::size_t len)
     return detail::cksum_add(buf, len, cksum);
 }
 
-static inline uint16_t cksum_add(const uint16_t* buf, std::size_t len)
+inline uint16_t cksum_add(const uint16_t* buf, std::size_t len)
 { return detail::cksum_add(buf, len, 0); }
 } // namespace checksum
 
index 7bfab221cfa31674542c43ed62c1c9d3786f8a27..6c400a261b126c0c23fda5e00add128e20c1ceb2 100644 (file)
@@ -173,7 +173,7 @@ struct fd_session_s
 /* Inline Functions */
 
 /* If available, look at the next available byte in the input queue */
-static inline bool Peek_1(fd_session_p_t SessionPtr, uint8_t* c)
+inline bool Peek_1(fd_session_p_t SessionPtr, uint8_t* c)
 {
     if ( (SessionPtr->Next_In != NULL) && (SessionPtr->Avail_In > 0) )
     {
@@ -185,7 +185,7 @@ static inline bool Peek_1(fd_session_p_t SessionPtr, uint8_t* c)
 }
 
 /* If available, get a byte from the input queue */
-static inline bool Get_1(fd_session_p_t SessionPtr, uint8_t* c)
+inline bool Get_1(fd_session_p_t SessionPtr, uint8_t* c)
 {
     if ( (SessionPtr->Next_In != NULL) && (SessionPtr->Avail_In > 0) )
     {
@@ -200,7 +200,7 @@ static inline bool Get_1(fd_session_p_t SessionPtr, uint8_t* c)
 
 /* If available, get N bytes from the input queue.  All N must be
    availble for this call to succeed. */
-static inline bool Get_N(fd_session_p_t SessionPtr, uint8_t** c, uint16_t N)
+inline bool Get_N(fd_session_p_t SessionPtr, uint8_t** c, uint16_t N)
 {
     if ( (SessionPtr->Next_In != NULL) && (SessionPtr->Avail_In >= N) )
     {
@@ -215,7 +215,7 @@ static inline bool Get_N(fd_session_p_t SessionPtr, uint8_t** c, uint16_t N)
 }
 
 /* If there's room in the output queue, put one byte. */
-static inline bool Put_1(fd_session_p_t SessionPtr, uint8_t c)
+inline bool Put_1(fd_session_p_t SessionPtr, uint8_t c)
 {
     if ( (SessionPtr->Next_Out != NULL) && (SessionPtr->Avail_Out > 0) )
     {
@@ -230,7 +230,7 @@ static inline bool Put_1(fd_session_p_t SessionPtr, uint8_t c)
 
 /* If the output queue has room available, place N bytes onto the queue.
    The output queue must have space for N bytes for this call to succeed. */
-static inline bool Put_N(fd_session_p_t SessionPtr, uint8_t* c, uint16_t N)
+inline bool Put_N(fd_session_p_t SessionPtr, uint8_t* c, uint16_t N)
 {
     if ( (SessionPtr->Next_Out != NULL) && (SessionPtr->Avail_Out >= N) )
     {
@@ -246,7 +246,7 @@ static inline bool Put_N(fd_session_p_t SessionPtr, uint8_t* c, uint16_t N)
 
 /* If the input queue has at least one byte available AND there's at
    space for at least one byte in the output queue, then move one byte. */
-static inline bool Move_1(fd_session_p_t SessionPtr)
+inline bool Move_1(fd_session_p_t SessionPtr)
 {
     if ( (SessionPtr->Next_Out != NULL) && (SessionPtr->Avail_Out > 0) &&
         (SessionPtr->Next_In != NULL) && (SessionPtr->Avail_In > 0) )
@@ -266,7 +266,7 @@ static inline bool Move_1(fd_session_p_t SessionPtr)
 
 /* If the input queue has at least N bytes available AND there's at
    space for at least N bytes in the output queue, then move all N bytes. */
-static inline bool Move_N(fd_session_p_t SessionPtr, uint16_t N)
+inline bool Move_N(fd_session_p_t SessionPtr, uint16_t N)
 {
     if ( (SessionPtr->Next_Out != NULL) && (SessionPtr->Avail_Out >= N) &&
         (SessionPtr->Next_In != NULL) && (SessionPtr->Avail_In >= N) )
index 944e0d8cfc70f1ea8992c419c603911081b534f9..7db2c0b23f82cfe63c1836fa81ab24898d6b3602 100644 (file)
@@ -71,14 +71,14 @@ void CallAlertFuncs(Packet*, const OptTreeNode*, ListHead*);
 
 // don't eval content rules
 // non-content rules are still evaluated
-static inline void DisableDetect(Packet*)
+inline void DisableDetect(Packet*)
 {
     do_detect_content = 0;
 }
 
 // don't want to do any detection with rules
 // (no content and no non-content)
-static inline void DisableInspection(Packet*)
+inline void DisableInspection(Packet*)
 {
     do_detect = do_detect_content = 0;
 }
index ca4e657ea5085379b7e9b812565148659dc412aa..b324fa0878db3d5b17a24b558675c2600816584e 100644 (file)
@@ -56,7 +56,7 @@ extern SO_PUBLIC THREAD_LOCAL DataPointer g_file_data;
 
 #define IsLimitedDetect(pktPtr) (pktPtr->packet_flags & PKT_HTTP_DECODE)
 
-static inline void set_file_data(uint8_t* p, unsigned n)
+inline void set_file_data(uint8_t* p, unsigned n)
 {
     g_file_data.data = p;
     g_file_data.len = n;
@@ -68,12 +68,12 @@ void EventTrace_Term(void);
 
 void EventTrace_Log(const Packet*, const OptTreeNode*, int action);
 
-static inline int EventTrace_IsEnabled(void)
+inline int EventTrace_IsEnabled(void)
 {
     return ( snort_conf->event_trace_max > 0 );
 }
 
-static inline void DetectReset()
+inline void DetectReset()
 {
     g_file_data.len = 0;
 }
index fa6ce385a4c8ca67268e64adbc415bff168645b6..4b4fa8d1ea77b831aa1ed0af9c0c81a002751bd3 100644 (file)
@@ -178,10 +178,10 @@ void* get_rule_type_data(OptTreeNode*, option_type_t);
 
 SO_PUBLIC bool otn_has_plugin(OptTreeNode* otn, const char* name);
 
-static inline bool otn_has_plugin(OptTreeNode* otn, int id)
+inline bool otn_has_plugin(OptTreeNode* otn, int id)
 { return (otn->plugins & (0x1 << id)) != 0; }
 
-static inline void otn_set_plugin(OptTreeNode* otn, int id)
+inline void otn_set_plugin(OptTreeNode* otn, int id)
 { otn->plugins |= (0x1 << id); }
 
 bool otn_set_agent(OptTreeNode*, IpsOption*);
index 5c7c9b9af3ed23343940e1ec3c1eb7555400bf3a..79e905464ef3ddc9ee5f555556d266ff5358f254 100644 (file)
@@ -103,14 +103,14 @@ struct FileCaptureInfo;
 
 #define DEFAULT_FILE_ID   0
 
-static inline void initFilePosition(FilePosition* position, uint64_t processed_size)
+inline void initFilePosition(FilePosition* position, uint64_t processed_size)
 {
     *position = SNORT_FILE_START;
     if (processed_size)
         *position = SNORT_FILE_MIDDLE;
 }
 
-static inline void updateFilePosition(FilePosition* position, uint64_t processed_size)
+inline void updateFilePosition(FilePosition* position, uint64_t processed_size)
 {
     if ((*position == SNORT_FILE_END) || (*position == SNORT_FILE_FULL))
         *position = SNORT_FILE_START;
@@ -118,7 +118,7 @@ static inline void updateFilePosition(FilePosition* position, uint64_t processed
         *position = SNORT_FILE_MIDDLE;
 }
 
-static inline void finalFilePosition(FilePosition* position)
+inline void finalFilePosition(FilePosition* position)
 {
     if (*position == SNORT_FILE_START)
         *position = SNORT_FILE_FULL;
@@ -126,12 +126,12 @@ static inline void finalFilePosition(FilePosition* position)
         *position = SNORT_FILE_END;
 }
 
-static inline bool isFileStart(FilePosition position)
+inline bool isFileStart(FilePosition position)
 {
     return ((position == SNORT_FILE_START) || (position == SNORT_FILE_FULL));
 }
 
-static inline bool isFileEnd(FilePosition position)
+inline bool isFileEnd(FilePosition position)
 {
     return ((position == SNORT_FILE_END) || (position == SNORT_FILE_FULL));
 }
index 4696c4de8e8f489779db2b0b0b7577089024f3ab..ea3da19c9eff6e0b9500cc1f2ec7208bcc181985 100644 (file)
@@ -162,7 +162,7 @@ int SFRF_TestThreshold(
 
 void SFRF_ShowObjects(RateFilterConfig*);
 
-static inline void EnableInternalEvent(RateFilterConfig* config, uint32_t sid)
+inline void EnableInternalEvent(RateFilterConfig* config, uint32_t sid)
 {
     if (config == NULL)
         return;
@@ -170,7 +170,7 @@ static inline void EnableInternalEvent(RateFilterConfig* config, uint32_t sid)
     config->internal_event_mask |= (1 << sid);
 }
 
-static inline bool InternalEventIsEnabled(RateFilterConfig* config, uint32_t sid)
+inline bool InternalEventIsEnabled(RateFilterConfig* config, uint32_t sid)
 {
     if (config == NULL)
         return 0;
index 1f962ef445762923a83f421ef147d674be34fbf6..0884a5fb3c4b43d571ab1549015ec3d0f02b70a4 100644 (file)
@@ -282,7 +282,7 @@ TEST_CASE("get addr test", "[Value]")
     SECTION("invalid value")
     {
         Value test_val("12345678901234567890");
-        test_str = (uint8_t*)test_val.get_buffer(num_chars);
+        test_val.get_buffer(num_chars);
         REQUIRE(num_chars == 20);
 
         test_val.get_addr(addr);
@@ -312,7 +312,7 @@ TEST_CASE("get addr IPv4 test", "[Value]")
     SECTION("invalid value")
     {
         Value test_val("123456");
-        test_str = (uint8_t *)test_val.get_buffer(num_chars);
+        test_val.get_buffer(num_chars);
         REQUIRE(num_chars == 6);
 
         test_val.get_addr_ip4(addr);
@@ -341,7 +341,7 @@ TEST_CASE("get addr IPv6 test", "[Value]")
     SECTION("invalid value")
     {
         Value test_val("123456");
-        test_str = (uint8_t *)test_val.get_buffer(num_chars);
+        test_val.get_buffer(num_chars);
         REQUIRE(num_chars == 6);
 
         test_val.get_addr_ip6(addr);
index 4213141588a06b673eb980379fe7466e11301a50..c5c4f0e16f29c0bc5fb48c651dd9a2ad4c0b5186 100644 (file)
@@ -42,13 +42,13 @@ extern "C"
 
 typedef MD5Context MD5_CTX;
 
-static inline int MD5_Init(MD5_CTX* c)
+inline int MD5_Init(MD5_CTX* c)
 { MD5Init(c); return 0; }
 
-static inline int MD5_Update(MD5_CTX* c, const unsigned char* data, unsigned long len)
+inline int MD5_Update(MD5_CTX* c, const unsigned char* data, unsigned long len)
 { MD5Update(c, data, len); return 0; }
 
-static inline int MD5_Final(unsigned char* md, MD5_CTX* c)
+inline int MD5_Final(unsigned char* md, MD5_CTX* c)
 { MD5Final(md, c); return 0; }
 #endif
 
index b31eb73daa813b54507749f81018182e4f697e0f..64d98639a5577da732eeafd0a81091fc27299275 100644 (file)
@@ -110,31 +110,31 @@ SO_PUBLIC SFXHASH_NODE* sfxhash_get_node(SFXHASH* t, const void* key);
 SO_PUBLIC int sfxhash_remove(SFXHASH* h, void* key);
 
 //  Get the # of Nodes in HASH the table
-static inline unsigned sfxhash_count(SFXHASH* t)
+inline unsigned sfxhash_count(SFXHASH* t)
 { return t->count; }
 
 //  Get the # auto recovery
-static inline unsigned sfxhash_anr_count(SFXHASH* t)
+inline unsigned sfxhash_anr_count(SFXHASH* t)
 { return t->anr_count; }
 
 //  Get the # finds
-static inline unsigned sfxhash_find_total(SFXHASH* t)
+inline unsigned sfxhash_find_total(SFXHASH* t)
 { return t->find_success + t->find_fail; }
 
 //  Get the # unsucessful finds
-static inline unsigned sfxhash_find_fail(SFXHASH* t)
+inline unsigned sfxhash_find_fail(SFXHASH* t)
 { return t->find_fail; }
 
 //  Get the # sucessful finds
-static inline unsigned sfxhash_find_success(SFXHASH* t)
+inline unsigned sfxhash_find_success(SFXHASH* t)
 { return t->find_success; }
 
 //  Get the # of overhead bytes
-static inline unsigned sfxhash_overhead_bytes(SFXHASH* t)
+inline unsigned sfxhash_overhead_bytes(SFXHASH* t)
 { return t->overhead_bytes; }
 
 // Get the # of overhead blocks
-static inline unsigned sfxhash_overhead_blocks(SFXHASH* t)
+inline unsigned sfxhash_overhead_blocks(SFXHASH* t)
 { return t->overhead_blocks; }
 
 SO_PUBLIC void* sfxhash_mru(SFXHASH* t);
index d9bd4f5292a2412c7c5c356847731b9aaf283e9c..bd8c15963c20e95b01b51ed1ad6a26365b523f1f 100644 (file)
@@ -66,12 +66,12 @@ SO_PUBLIC void TextLog_Reset(TextLog* const);
   * helper functions
   *-------------------------------------------------------------------
   */
-static inline bool TextLog_NewLine(TextLog* const txt)
+inline bool TextLog_NewLine(TextLog* const txt)
 {
     return TextLog_Putc(txt, '\n');
 }
 
-static inline bool TextLog_Puts(TextLog* const txt, const char* str)
+inline bool TextLog_Puts(TextLog* const txt, const char* str)
 {
     return TextLog_Write(txt, str, strlen(str));
 }
index 7416586f1d8db54d90098aea8711f16d3b1fc183..886b1f7e1d7b70fa3f3e153f42f110d6d562fd03 100644 (file)
@@ -36,14 +36,14 @@ template<typename T>
 inline T** regurgitate(lua_State* L, const char* name, int arg)
 { return static_cast<T**>(const_cast<void*>(luaL_checkudata(L, arg, name))); }
 
-static inline int register_methods(
+inline int register_methods(
     lua_State* L, const luaL_Reg* methods, const char* name = nullptr)
 {
     luaL_register(L, name, methods);
     return lua_gettop(L);
 }
 
-static inline int register_metamethods(
+inline int register_metamethods(
     lua_State* L, const luaL_Reg* methods, const char* name)
 {
     luaL_newmetatable(L, name);
@@ -51,7 +51,7 @@ static inline int register_metamethods(
     return lua_gettop(L);
 }
 
-static inline void register_with_closure(
+inline void register_with_closure(
     lua_State* L, const luaL_Reg* methods, int table, int cl)
 {
     ManageStack ms(L, 2);
@@ -65,7 +65,7 @@ static inline void register_with_closure(
     }
 }
 
-static inline int new_lib(lua_State* L, const char* name)
+inline int new_lib(lua_State* L, const char* name)
 {
     const luaL_Reg empty[] = { { nullptr, nullptr } };
     return register_methods(L, empty, name);
index 98d854e2d77f0392b2df7d30d184c990555efbf4..f165c303de5e86df6c91dba2393641c00a3d44c0 100644 (file)
@@ -27,7 +27,7 @@
 namespace Lua
 {
 template<typename T>
-static inline constexpr bool IsInteger()
+inline constexpr bool IsInteger()
 { return std::is_integral<T>::value && !std::is_same<T, bool>::value; }
 
 template<typename T, typename Integral = void, typename Unsigned = void>
@@ -38,16 +38,16 @@ template<typename T>
 struct Stack<T, typename std::enable_if<IsInteger<T>()>::type,
     typename std::enable_if<std::is_unsigned<T>::value>::type>
 {
-    static inline void push(lua_State* L, const T& v)
+    static void push(lua_State* L, const T& v)
     { lua_pushinteger(L, v); }
 
-    static inline T get(lua_State* L, int n)
+    static T get(lua_State* L, int n)
     { return lua_tointeger(L, n); }
 
-    static inline constexpr int type()
+    static constexpr int type()
     { return LUA_TNUMBER; }
 
-    static inline bool validate(lua_State* L, int n, T& v)
+    static bool validate(lua_State* L, int n, T& v)
     {
         if ( lua_type(L, n) != type() )
             return false;
@@ -60,7 +60,7 @@ struct Stack<T, typename std::enable_if<IsInteger<T>()>::type,
         return true;
     }
 
-    static inline bool validate(lua_State* L, int n)
+    static bool validate(lua_State* L, int n)
     {
         T v;
         return validate(L, n, v);
@@ -72,16 +72,16 @@ template<typename T>
 struct Stack<T, typename std::enable_if<IsInteger<T>()>::type,
     typename std::enable_if<!std::is_unsigned<T>::value>::type>
 {
-    static inline void push(lua_State* L, const T& v)
+    static void push(lua_State* L, const T& v)
     { lua_pushinteger(L, v); }
 
-    static inline T get(lua_State* L, int n)
+    static T get(lua_State* L, int n)
     { return lua_tointeger(L, n); }
 
-    static inline constexpr int type()
+    static constexpr int type()
     { return LUA_TNUMBER; }
 
-    static inline bool validate(lua_State* L, int n, T& v)
+    static bool validate(lua_State* L, int n, T& v)
     {
         if ( lua_type(L, n) != type() )
             return false;
@@ -90,7 +90,7 @@ struct Stack<T, typename std::enable_if<IsInteger<T>()>::type,
         return true;
     }
 
-    static inline bool validate(lua_State* L, int n)
+    static bool validate(lua_State* L, int n)
     {
         T v;
         return validate(L, n, v);
@@ -101,15 +101,15 @@ struct Stack<T, typename std::enable_if<IsInteger<T>()>::type,
 template<typename T>
 struct Stack<T, typename std::enable_if<!IsInteger<T>()>::type>
 {
-    static inline void push(lua_State*, T);
-    static inline void push(lua_State*, T, size_t);
+    static void push(lua_State*, T);
+    static void push(lua_State*, T, size_t);
 
-    static inline T get(lua_State*, int);
-    static inline T get(lua_State*, int, size_t&);
+    static T get(lua_State*, int);
+    static T get(lua_State*, int, size_t&);
 
-    static inline constexpr int type();
+    static constexpr int type();
 
-    static inline bool validate(lua_State* L, int n, T& v)
+    static bool validate(lua_State* L, int n, T& v)
     {
         if ( lua_type(L, n) != type() )
             return false;
@@ -118,13 +118,13 @@ struct Stack<T, typename std::enable_if<!IsInteger<T>()>::type>
         return true;
     }
 
-    static inline bool validate(lua_State* L, int n)
+    static bool validate(lua_State* L, int n)
     {
         T v;
         return validate(L, n, v);
     }
 
-    static inline bool validate(lua_State*, int, T&, size_t&);
+    static bool validate(lua_State*, int, T&, size_t&);
 };
 
 // const char*
index e2282e57f05746f6e98083f6fa80e02efade5dae..f5c49c82f68d4625500cbbb4dc24d46d42f5bf18 100644 (file)
@@ -135,7 +135,7 @@ struct Table
 };
 
 template<typename T>
-static inline void fill_table_from_vector(lua_State* L, int tindex, std::vector<T>& vec)
+inline void fill_table_from_vector(lua_State* L, int tindex, std::vector<T>& vec)
 {
     Table table(L, tindex);
     int i = 0;
index ad881fae1e72b84f88967ee79c25308a703cef53..b2317f99910bc65379853e27119a70d5f3b219af 100644 (file)
@@ -25,7 +25,7 @@
 #include <string.h>
 #include <luajit-2.0/lua.hpp>
 
-static inline void l_end_lua_state(lua_State*& L_ptr)
+inline void l_end_lua_state(lua_State*& L_ptr)
 {
     if ( L_ptr )
     {
@@ -34,7 +34,7 @@ static inline void l_end_lua_state(lua_State*& L_ptr)
     }
 }
 
-static inline void l_reset_lua_state(lua_State*& L_ptr)
+inline void l_reset_lua_state(lua_State*& L_ptr)
 {
     l_end_lua_state(L_ptr);
     L_ptr = luaL_newstate();
@@ -42,7 +42,7 @@ static inline void l_reset_lua_state(lua_State*& L_ptr)
 }
 
 template<typename T, size_t N>
-static inline constexpr size_t sizeofArray(T (&)[N])
+inline constexpr size_t sizeofArray(T (&)[N])
 { return N; }
 
 #endif
index a270e11bca8a99294c1785aa92392de7641623c6..eebea1b9ece1cc4c97c9ebe0808a820a43c83432 100644 (file)
@@ -34,7 +34,7 @@ namespace Lua
 const char* fmt_expected_message(const char* type);
 const char* fmt_range_message(unsigned min, unsigned max);
 
-static inline void set_script_dir(
+inline void set_script_dir(
     lua_State* L, const std::string varname, const std::string path)
 {
     std::string dir = path.substr(0, path.rfind(LUA_DIR_SEP));
index c058452c0e23c46e0f1802247513d127744ff83d..3878daa91399a878689492714b008ef243ce0289 100644 (file)
@@ -69,8 +69,7 @@ struct MimeDataPafInfo
     MimeBoundaryState boundary_state;
 };
 
-static inline bool scanning_boundary(MimeDataPafInfo* mime_info, uint32_t boundary_start,
-    uint32_t* fp)
+inline bool scanning_boundary(MimeDataPafInfo* mime_info, uint32_t boundary_start, uint32_t* fp)
 {
     if (boundary_start &&
         mime_info->data_state == MIME_PAF_FOUND_BOUNDARY_STATE &&
index e4913e6478b5f1daafb160a95693e9397b4fd5bc..fde82d45eeb53e2cd1c6049fb2e09c176f50311f 100644 (file)
@@ -48,17 +48,17 @@ struct NormalizerConfig
 int Norm_SetConfig(NormalizerConfig*);
 int Norm_Packet(NormalizerConfig*, Packet*);
 
-static inline void Norm_Enable(NormalizerConfig* nc, NormFlags nf)
+inline void Norm_Enable(NormalizerConfig* nc, NormFlags nf)
 {
     nc->normalizer_flags |= nf;
 }
 
-static inline void Norm_Disable(NormalizerConfig* nc, NormFlags nf)
+inline void Norm_Disable(NormalizerConfig* nc, NormFlags nf)
 {
     nc->normalizer_flags &= ~nf;
 }
 
-static inline void Norm_Set(NormalizerConfig* nc, NormFlags nf, bool enable)
+inline void Norm_Set(NormalizerConfig* nc, NormFlags nf, bool enable)
 {
     if ( enable )
         Norm_Enable(nc, nf);
@@ -66,24 +66,24 @@ static inline void Norm_Set(NormalizerConfig* nc, NormFlags nf, bool enable)
         Norm_Disable(nc, nf);
 }
 
-static inline int Norm_IsEnabled(const NormalizerConfig* nc, NormFlags nf)
+inline int Norm_IsEnabled(const NormalizerConfig* nc, NormFlags nf)
 {
     return ( (nc->normalizer_flags & nf) != 0 );
 }
 
-static inline void Norm_TcpPassOption(NormalizerConfig* nc, uint8_t opt)
+inline void Norm_TcpPassOption(NormalizerConfig* nc, uint8_t opt)
 {
     uint8_t byte = (opt >> 3), bit = (1 << (opt & 0x07));
     nc->normalizer_options[byte] |= bit;
 }
 
-static inline void Norm_TcpDropOption(NormalizerConfig* nc, uint8_t opt)
+inline void Norm_TcpDropOption(NormalizerConfig* nc, uint8_t opt)
 {
     uint8_t byte = (opt >> 3), bit = (1 << (opt & 0x07));
     nc->normalizer_options[byte] &= ~bit;
 }
 
-static inline int Norm_TcpIsOptional(const NormalizerConfig* nc, uint8_t opt)
+inline int Norm_TcpIsOptional(const NormalizerConfig* nc, uint8_t opt)
 {
     uint8_t byte = (opt >> 3), bit = (1 << (opt & 0x07));
     return ( (nc->normalizer_options[byte] & bit) != 0 );
index 573f86f66fc38a92cbb778dccaf997180eee1c64..cf9c090bf86ae2d6d83854cbe85b58bb4aba786a 100644 (file)
@@ -71,17 +71,17 @@ extern SFPERF* perfmon_config;
 extern int perfmon_rotate_perf_file;
 
 /* functions to set & get the RotatePerfFileFlag */
-static inline void SetRotatePerfFileFlag(void)
+inline void SetRotatePerfFileFlag(void)
 {
     perfmon_rotate_perf_file = 1;
 }
 
-static inline int IsSetRotatePerfFileFlag(void)
+inline int IsSetRotatePerfFileFlag(void)
 {
     return perfmon_rotate_perf_file;
 }
 
-static inline void ClearRotatePerfFileFlag(void)
+inline void ClearRotatePerfFileFlag(void)
 {
     perfmon_rotate_perf_file = 0;
 }
index a9690e12d778d1b8a33779d795d09268109f2c02..f33903ab0ed040c1d351f632a2dd970557e6bddf 100644 (file)
@@ -48,7 +48,7 @@ public:
     static bool init(SnortConfig*);
     static void term();
 
-    static inline void reset()
+    static void reset()
     {
         active_status = AST_ALLOW;
         active_action = ACT_PASS;
index 3d53d90cbd9eae2b3f0163231b5a843a10c37a74..96d9cac861e30d83c92247c291b13fdf4125ee24 100644 (file)
@@ -67,7 +67,7 @@ int addRtnToOtn(struct OptTreeNode*, RuleTreeNode*, PolicyId);
 RuleTreeNode* deleteRtnFromOtn(struct OptTreeNode*);
 RuleTreeNode* deleteRtnFromOtn(struct OptTreeNode*, PolicyId);
 
-static inline RuleTreeNode* getRtnFromOtn(
+inline RuleTreeNode* getRtnFromOtn(
     const struct OptTreeNode* otn, PolicyId policyId)
 {
     if (otn && otn->proto_nodes && (otn->proto_node_num > (unsigned)policyId))
@@ -78,13 +78,13 @@ static inline RuleTreeNode* getRtnFromOtn(
     return NULL;
 }
 
-static inline RuleTreeNode* getRtnFromOtn(
+inline RuleTreeNode* getRtnFromOtn(
     const struct OptTreeNode* otn)
 {
     return getRtnFromOtn(otn, get_ips_policy()->policy_id);
 }
 
-static inline RuleTreeNode* getRuntimeRtnFromOtn(
+inline RuleTreeNode* getRuntimeRtnFromOtn(
     const struct OptTreeNode* otn)
 {
     return getRtnFromOtn(otn);
index 8b03f504a9aeaa60cd65f71a3719967390f81f38..0f431a1f6b927841f75de1cf53ff348901b9bdc3 100644 (file)
@@ -104,7 +104,7 @@ struct Api
 };
 
 template<typename... Args>
-static inline void error(std::string fmt, Args&&... args)
+inline void error(std::string fmt, Args&&... args)
 {
     fmt.insert(0, "piglet: ");
     fmt.append("\n");
index 166e3828685720fdbe8aff9df82b0804124c76ba..7e728a0cbd4300fe82d46b8ba2a4290bfbb37d05 100644 (file)
 
 using RawBuffer = std::string;
 
-static inline const uint8_t* get_data(RawBuffer& rb)
+inline const uint8_t* get_data(RawBuffer& rb)
 { return reinterpret_cast<const uint8_t*>(rb.data()); }
 
-static inline uint8_t* get_mutable_data(RawBuffer& rb)
+inline uint8_t* get_mutable_data(RawBuffer& rb)
 { return const_cast<uint8_t*>(get_data(rb)); }
 
 extern const struct Lua::TypeInterface<RawBuffer> RawBufferIface;
index 4e293221ebfaf0b2f5db3e795401beaf51b04952..7dd017178fafa9ae04dc9c3a234a432683aad940 100644 (file)
@@ -144,7 +144,7 @@ struct IP4Hdr
     { ip_len = htons(new_len); }
 };
 
-static inline bool isPrivateIP(uint32_t addr)
+inline bool isPrivateIP(uint32_t addr)
 {
     addr = ntohl(addr);
     switch (addr & 0xFF000000)
index 6522399c3dd3141bf6d057b6ae99a0094f3c4067..97b386965eb14c74c5585e02aa1e58a4075fdb23 100644 (file)
@@ -235,7 +235,7 @@ struct IP6Frag
 
 // Reflects the recomended IPv6 order in RFC 2460 4.1
 constexpr int IPV6_ORDER_MAX = 7;
-static inline int IPV6ExtensionOrder(uint8_t type)
+inline int IPV6ExtensionOrder(uint8_t type)
 {
     switch (type)
     {
index 2ac036840639f0e687a2a40e63d5fbcb654b276c..c58785c2e1d2365a34985b04d2ba3266ff325dac 100644 (file)
@@ -283,17 +283,17 @@ struct SO_PUBLIC Packet
 
 #define BIT(i) (0x1 << (i-1))
 
-static inline void SetExtraData(Packet* p, const uint32_t xid)
+inline void SetExtraData(Packet* p, const uint32_t xid)
 { p->xtradata_mask |= BIT(xid); }
 
-static inline uint16_t extract_16bits(const uint8_t* const p)
+inline uint16_t extract_16bits(const uint8_t* const p)
 { return ntohs(*(uint16_t*)(p)); }
 
 #ifdef WORDS_MUSTALIGN
 
 #ifdef __GNUC__
 /* force word-aligned ntohl parameter */
-static inline uint32_t extract_32bits(const uint8_t* p)
+inline uint32_t extract_32bits(const uint8_t* p)
 {
     uint32_t tmp;
     memmove(&tmp, p, sizeof(uint32_t));
@@ -304,7 +304,7 @@ static inline uint32_t extract_32bits(const uint8_t* p)
 #else
 
 /* allows unaligned ntohl parameter - dies w/SIGBUS on SPARCs */
-static inline uint32_t extract_32bits(const uint8_t* p)
+inline uint32_t extract_32bits(const uint8_t* p)
 { return ntohl(*(uint32_t*)p); }
 
 #endif
index b4edb2730c7aad7327c32fdc170fb93acf4aa561..078c8b48a3aa6d3639aca4fea58e0866f8ac1fb0 100644 (file)
@@ -117,7 +117,7 @@ public:
     static uint16_t encode_get_max_payload(const Packet*);
 
     // reset the current 'clone' packet
-    static inline void encode_reset(void)
+    static void encode_reset(void)
     { encode_set_pkt(NULL); }
 
     // print codec information.  MUST be called after thread_term.
index 202a865f5fb374aa3db9b97ad469e8de261efd85..c5e4f3624e43eee0cdfc0f88a43aa2adb012d374 100644 (file)
@@ -92,7 +92,7 @@ constexpr uint16_t ETHERTYPE_PPP = 0x880B;
 constexpr uint16_t ETHERTYPE_EAPOL = 0x888e;
 constexpr uint16_t ETHERTYPE_FPATH = 0x8903;
 
-static inline bool is_ip6_extension(const uint8_t proto)
+inline bool is_ip6_extension(const uint8_t proto)
 {
     switch (proto)
     {
index ddd86b811e2db835ad6409bfbe55a8aee867e9f8..859c71238758e0c42ef3eb367e5e5b2244130d0c 100644 (file)
@@ -79,7 +79,7 @@ struct Trh_hdr
 };
 /* End Token Ring Data Structures */
 
-static inline const Trh_mr* get_trhmr(const Trh_llc* llc)
+inline const Trh_mr* get_trhmr(const Trh_llc* llc)
 {
     if (llc->dsap != IPARP_SAP && llc->ssap != IPARP_SAP)
         return reinterpret_cast<const Trh_mr*>(llc);
index 3bcab948953d79ce42af173d085d8ddcbbbede9e..d6fa8ee899d3a8e4d217f417f6c7834d0a00658d 100644 (file)
@@ -89,27 +89,27 @@ struct DceRpcCoHdr
 
 #pragma pack()
 
-static inline uint8_t DceRpcCoVersMaj(const DceRpcCoHdr* co)
+inline uint8_t DceRpcCoVersMaj(const DceRpcCoHdr* co)
 {
     return co->pversion.major;
 }
 
-static inline uint8_t DceRpcCoVersMin(const DceRpcCoHdr* co)
+inline uint8_t DceRpcCoVersMin(const DceRpcCoHdr* co)
 {
     return co->pversion.minor;
 }
 
-static inline DceRpcPduType DceRpcCoPduType(const DceRpcCoHdr* co)
+inline DceRpcPduType DceRpcCoPduType(const DceRpcCoHdr* co)
 {
     return (DceRpcPduType)co->ptype;
 }
 
-static inline DceRpcBoFlag DceRpcCoByteOrder(const DceRpcCoHdr* co)
+inline DceRpcBoFlag DceRpcCoByteOrder(const DceRpcCoHdr* co)
 {
     return DceRpcByteOrder(co->packed_drep[0]);
 }
 
-static inline uint16_t DceRpcCoFragLen(const DceRpcCoHdr* co)
+inline uint16_t DceRpcCoFragLen(const DceRpcCoHdr* co)
 {
     return DceRpcNtohs(&co->frag_length, DceRpcCoByteOrder(co));
 }
index e0be02d3081ccbbea6bba9d41b4c87dd28f8d5b5..67fe9f7fb74e0a2579d5189468534a34b69a820f 100644 (file)
@@ -90,7 +90,7 @@ DCE2_List* DCE2_ListNew(DCE2_ListType, DCE2_ListKeyCompare, DCE2_ListDataFree,
 DCE2_Ret DCE2_ListInsert(DCE2_List*, void*, void*);
 void* DCE2_ListFirst(DCE2_List*);
 void* DCE2_ListNext(DCE2_List*);
-static inline bool DCE2_ListIsEmpty(DCE2_List*);
+inline bool DCE2_ListIsEmpty(DCE2_List*);
 void DCE2_ListEmpty(DCE2_List*);
 void DCE2_ListDestroy(DCE2_List*);
 
@@ -111,7 +111,7 @@ void DCE2_ListDestroy(DCE2_List*);
  *      false if the list has one or more nodes in it.
  *
  ********************************************************************/
-static inline bool DCE2_ListIsEmpty(DCE2_List* list)
+inline bool DCE2_ListIsEmpty(DCE2_List* list)
 {
     if (list == nullptr)
         return true;
index 1e42653f903a810ba60486f3d4e781ef604320f8..e6fa7bd1dc78d61a3e820e3e19ffbc156e61c50d 100644 (file)
@@ -256,18 +256,18 @@ struct DCE2_SmbSsnData
     // FIXIT-M add all the remaining fields
 };
 
-static inline uint32_t NbssLen(const NbssHdr* nb)
+inline uint32_t NbssLen(const NbssHdr* nb)
 {
     /* Treat first bit of flags as the upper byte to length */
     return ((nb->flags & 0x01) << 16) | ntohs(nb->length);
 }
 
-static inline uint8_t NbssType(const NbssHdr* nb)
+inline uint8_t NbssType(const NbssHdr* nb)
 {
     return nb->type;
 }
 
-static inline uint32_t SmbId(const SmbNtHdr* hdr)
+inline uint32_t SmbId(const SmbNtHdr* hdr)
 {
 #ifdef WORDS_MUSTALIGN
     uint8_t* idf = (uint8_t*)hdr->smb_idf;
@@ -277,7 +277,7 @@ static inline uint32_t SmbId(const SmbNtHdr* hdr)
 #endif  /* WORDS_MUSTALIGN */
 }
 
-static inline bool DCE2_SmbAutodetect(Packet* p)
+inline bool DCE2_SmbAutodetect(Packet* p)
 {
     if (p->dsize > (sizeof(NbssHdr) + sizeof(SmbNtHdr)))
     {
index 2159aedd0cf202a7240358c0d73753b0e7382178..5246302db4cdf1b0c47d78875c1f7f9abc833d74 100644 (file)
@@ -90,10 +90,14 @@ StreamSplitter::Status dce2_smb_paf(DCE2_PafSmbData* ss, Flow* flow, const uint8
     DebugFormat(DEBUG_DCE_SMB, "%s\n", DCE2_DEBUG__PAF_START_MSG_SMB);
     DebugFormat(DEBUG_DCE_SMB, "SMB: %u bytes of data\n", len);
 
+#ifdef DEBUG_MSGS
     if (flags & PKT_FROM_CLIENT)
         DebugMessage(DEBUG_DCE_SMB, "Packet from Client\n");
     else
         DebugMessage(DEBUG_DCE_SMB, "Packet from Server\n");
+#else
+    UNUSED(flags);
+#endif
 
     if (dce2_paf_abort(flow))
     {
index a24d13aee232556e3e80281c397282c7383bb232..09e08c83e5e3108e05ab0b6e670a8e65fefc5ded 100644 (file)
@@ -86,7 +86,7 @@ extern THREAD_LOCAL ProfileStats dce2_tcp_pstat_co_frag;
 extern THREAD_LOCAL ProfileStats dce2_tcp_pstat_co_reass;
 extern THREAD_LOCAL ProfileStats dce2_tcp_pstat_co_ctx;
 
-static inline bool DCE2_TcpAutodetect(Packet* p)
+inline bool DCE2_TcpAutodetect(Packet* p)
 {
     if (p->dsize >= sizeof(DceRpcCoHdr))
     {
index 6d348d702c9be21c57a7182b3664ca2153823efc..e30cbac2368876d7451fda7ec398dd4ae3ba9f16 100644 (file)
@@ -49,10 +49,12 @@ static StreamSplitter::Status dce2_tcp_paf(DCE2_PafTcpData* ds, Flow* flow, cons
     DebugFormat(DEBUG_DCE_TCP, "%s\n", DCE2_DEBUG__PAF_START_MSG_TCP);
     DebugFormat(DEBUG_DCE_TCP, "TCP: %u bytes of data\n", len);
 
+#ifdef DEBUG_MSGS
     if (flags & PKT_FROM_CLIENT)
         DebugMessage(DEBUG_DCE_TCP, "Packet from Client\n");
     else
         DebugMessage(DEBUG_DCE_TCP, "Packet from Server\n");
+#endif
 
     if (dce2_paf_abort(flow))
     {
index deffe804ba7f31503d1177ff617a5482a741c7c8..afef4a02038c3e2c54e1ce3cc3f97ff719825202 100644 (file)
@@ -80,13 +80,13 @@ struct Uuid
  * Inline function prototypes
  ********************************************************************/
 
-static inline bool DCE2_IsSpaceChar(const char);
-static inline bool DCE2_IsConfigEndChar(const char);
+inline bool DCE2_IsSpaceChar(const char);
+inline bool DCE2_IsConfigEndChar(const char);
 
-static inline char* DCE2_PruneWhiteSpace(char*);
-static inline bool DCE2_IsEmptyStr(char*);
+inline char* DCE2_PruneWhiteSpace(char*);
+inline bool DCE2_IsEmptyStr(char*);
 
-static inline int DCE2_UuidCompare(const void*, const void*);
+inline int DCE2_UuidCompare(const void*, const void*);
 
 /********************************************************************
  * Public function prototypes
@@ -109,7 +109,7 @@ DCE2_Ret DCE2_GetValue(char*, char*, void*, int, DCE2_IntType, uint8_t);
  *      false if not a valid space character.
  *
  ********************************************************************/
-static inline bool DCE2_IsSpaceChar(const char c)
+inline bool DCE2_IsSpaceChar(const char c)
 {
     if (isspace((int)c))
         return true;
@@ -133,7 +133,7 @@ static inline bool DCE2_IsSpaceChar(const char c)
  *      false if not a valid end of configuration character.
  *
  ********************************************************************/
-static inline bool DCE2_IsConfigEndChar(const char c)
+inline bool DCE2_IsConfigEndChar(const char c)
 {
     if (c == DCE2_CFG_TOK__END)
         return true;
@@ -160,7 +160,7 @@ static inline bool DCE2_IsConfigEndChar(const char c)
  *               argument are replaced by NULL bytes.
  *
  ********************************************************************/
-static inline char* DCE2_PruneWhiteSpace(char* str)
+inline char* DCE2_PruneWhiteSpace(char* str)
 {
     char* end;
 
@@ -196,7 +196,7 @@ static inline char* DCE2_PruneWhiteSpace(char* str)
  *  false  otherwise
  *
  ********************************************************************/
-static inline bool DCE2_IsEmptyStr(char* str)
+inline bool DCE2_IsEmptyStr(char* str)
 {
     char* end;
 
@@ -214,7 +214,7 @@ static inline bool DCE2_IsEmptyStr(char* str)
     return false;
 }
 
-static inline int DCE2_UuidCompare(const void* data1, const void* data2)
+inline int DCE2_UuidCompare(const void* data1, const void* data2)
 {
     const Uuid* uuid1 = (Uuid*)data1;
     const Uuid* uuid2 = (Uuid*)data2;
index 3f7fbe8f31b8d0f773fc98846d8a3875d404a43c..be8f2ef549353d6499f8d34750b921f619aeccd3 100644 (file)
@@ -673,6 +673,8 @@ int ProcessFTPCmdValidity(
     FTP_CMD_CONF* FTPCmd = NULL;
     FTP_PARAM_FMT* HeadFmt = NULL;
 
+    assert(fmt);
+
     char buf[1024];
     strncpy(buf, fmt, sizeof(buf));
     buf[sizeof(buf)-1] = '\0';
index c1d58c1aa9346f006431d2a75ce08ecbe5238915..1c41e52ca8bb4334f9e891c9fe7127185fa17fb6 100644 (file)
@@ -219,17 +219,17 @@ int HI_SearchStrFound(void*, void*, int, void*, void*);
 int IsJSNormData(Flow* flow);
 int IsGzipData(Flow* flow);
 
-static inline void ClearHttpBuffers(void)
+inline void ClearHttpBuffers(void)
 {
     http_mask = 0;
 }
 
-static inline uint32_t GetHttpBufferMask(void)
+inline uint32_t GetHttpBufferMask(void)
 {
     return http_mask;
 }
 
-static inline const HttpBuffer* GetHttpBuffer(HTTP_BUFFER b)
+inline const HttpBuffer* GetHttpBuffer(HTTP_BUFFER b)
 {
     if ( !((1 << b) & http_mask) )
         return NULL;
@@ -237,7 +237,7 @@ static inline const HttpBuffer* GetHttpBuffer(HTTP_BUFFER b)
     return http_buffer + b;
 }
 
-static inline void SetHttpBuffer(
+inline void SetHttpBuffer(
     HTTP_BUFFER b, const uint8_t* buf, unsigned len, uint32_t enc = 0)
 {
     HttpBuffer* hb = http_buffer + b;
@@ -249,7 +249,7 @@ static inline void SetHttpBuffer(
     http_mask |= (1 << b);
 }
 
-static inline void ResetGzipState(DECOMPRESS_STATE* ds)
+inline void ResetGzipState(DECOMPRESS_STATE* ds)
 {
     if (ds == NULL)
         return;
@@ -263,7 +263,7 @@ static inline void ResetGzipState(DECOMPRESS_STATE* ds)
     ds->decompress_data = 0;
 }
 
-static inline void ResetRespState(HTTP_RESP_STATE* ds)
+inline void ResetRespState(HTTP_RESP_STATE* ds)
 {
     if (ds == NULL)
         return;
@@ -277,7 +277,7 @@ static inline void ResetRespState(HTTP_RESP_STATE* ds)
     ds->max_seq = 0;
 }
 
-static inline int SetLogBuffers(HttpSessionData* hsd)
+inline int SetLogBuffers(HttpSessionData* hsd)
 {
     int iRet = 0;
 
@@ -291,7 +291,7 @@ static inline int SetLogBuffers(HttpSessionData* hsd)
     return iRet;
 }
 
-static inline void SetHttpDecode(uint16_t altLen)
+inline void SetHttpDecode(uint16_t altLen)
 {
     HttpDecodeBuf.len = altLen;
 }
index 841ed2ea31d81bd5263b29826defc70468dfeaf7..7a32172ec7a5bb1c984bd2c837bae9ef69c59be0 100644 (file)
@@ -49,7 +49,7 @@
 **  @retval 1 within bounds
 **  @retval 0 not within bounds
 */
-static inline int hi_util_in_bounds(const u_char* start, const u_char* end, const u_char* p)
+inline int hi_util_in_bounds(const u_char* start, const u_char* end, const u_char* p)
 {
     if (p >= start && p < end)
     {
@@ -59,14 +59,14 @@ static inline int hi_util_in_bounds(const u_char* start, const u_char* end, cons
     return 0;
 }
 
-static inline void SkipWhiteSpace(const u_char* start, const u_char* end,
+inline void SkipWhiteSpace(const u_char* start, const u_char* end,
     const u_char** ptr)
 {
     while (hi_util_in_bounds(start, end, *ptr) && isspace((int)**ptr) && (**ptr != '\n'))
         (*ptr)++;
 }
 
-static inline int SkipBlankSpace(const u_char* start, const u_char* end,
+inline int SkipBlankSpace(const u_char* start, const u_char* end,
     const u_char** ptr)
 {
     int count = 0;
@@ -78,7 +78,7 @@ static inline int SkipBlankSpace(const u_char* start, const u_char* end,
     return count;
 }
 
-static inline void SkipDigits(const u_char* start, const u_char* end,
+inline void SkipDigits(const u_char* start, const u_char* end,
     const u_char** ptr)
 {
     while ((hi_util_in_bounds(start, end, *ptr)) && (isdigit((int)**ptr)) )
@@ -87,7 +87,7 @@ static inline void SkipDigits(const u_char* start, const u_char* end,
     }
 }
 
-static inline void SkipBlankAndNewLine(const u_char* start, const u_char* end,
+inline void SkipBlankAndNewLine(const u_char* start, const u_char* end,
     const u_char** ptr)
 {
     while ( (hi_util_in_bounds(start, end, *ptr)) &&
@@ -97,7 +97,7 @@ static inline void SkipBlankAndNewLine(const u_char* start, const u_char* end,
     }
 }
 
-static inline void SkipCRLF(const u_char* start, const u_char* end,
+inline void SkipCRLF(const u_char* start, const u_char* end,
     const u_char** ptr)
 {
     while ( (hi_util_in_bounds(start, end, *ptr)) &&
@@ -107,7 +107,7 @@ static inline void SkipCRLF(const u_char* start, const u_char* end,
     }
 }
 
-static inline int IsHeaderFieldName(const u_char* p, const u_char* end,
+inline int IsHeaderFieldName(const u_char* p, const u_char* end,
     const char* header_name, size_t header_len)
 {
     if ((p+header_len) <= end)
index 65b3634e8617d1bb50f5a7b739a0205979269e85..275ce04e242d91979034e3709f89e68005f11cb1 100644 (file)
@@ -98,7 +98,7 @@ void sfip_obfuscate(sfip_t* ob, sfip_t* ip);
 
 /* return required size (eg for hashing)
  * requires that address bytes be the last field in sfip_t */
-static inline unsigned int sfip_size(const sfip_t* ipt)
+inline unsigned int sfip_size(const sfip_t* ipt)
 {
     if ( ipt->family == AF_INET6 )
         return sizeof(*ipt);
@@ -114,13 +114,13 @@ static inline unsigned int sfip_size(const sfip_t* ipt)
 #define sfip_family(ip) ip->family
 
 /* Returns the number of bits used for masking "ip" */
-static inline unsigned char sfip_bits(const sfip_t* ip)
+inline unsigned char sfip_bits(const sfip_t* ip)
 {
     ARG_CHECK1(ip, 0);
     return (unsigned char)ip->bits;
 }
 
-static inline void sfip_set_bits(sfip_t* p, int bits)
+inline void sfip_set_bits(sfip_t* p, int bits)
 {
     if (!p)
         return;
@@ -137,15 +137,15 @@ static inline void sfip_set_bits(sfip_t* p, int bits)
 /* IP Comparisons ******************************************************/
 
 // Functions which will be defined below.
-static inline int sfip_is_set(const sfip_t& ip);
-static inline int sfip_is_set(const sfip_t* const ip);
-static inline bool sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs);
-static inline bool sfip_unset_equals(const sfip_t* const lhs, const sfip_t* const rhs);
-static inline bool sfip_not_equals(const sfip_t* const lhs, const sfip_t* const rhs);
-static inline bool sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs);
-static inline bool sfip_greater(const sfip_t* const lhs, const sfip_t* const rhs);
-static inline void sfip_clear(sfip_t& x);
-static inline void sfip_copy(sfip_t& lhs, const sfip_t* const rhs);
+inline int sfip_is_set(const sfip_t& ip);
+inline int sfip_is_set(const sfip_t* const ip);
+inline bool sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs);
+inline bool sfip_unset_equals(const sfip_t* const lhs, const sfip_t* const rhs);
+inline bool sfip_not_equals(const sfip_t* const lhs, const sfip_t* const rhs);
+inline bool sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs);
+inline bool sfip_greater(const sfip_t* const lhs, const sfip_t* const rhs);
+inline void sfip_clear(sfip_t& x);
+inline void sfip_copy(sfip_t& lhs, const sfip_t* const rhs);
 
 /* Check if ip is contained within the network specified by net
    Returns SFIP_EQUAL if so */
@@ -155,7 +155,7 @@ SO_PUBLIC SFIP_RET sfip_contains(const sfip_t* net, const sfip_t* ip);
 /* Returns 1 if the IP is non-zero. 0 otherwise */
 /* XXX This is a performance critical function, \
  *  need to determine if it's safe to not check these pointers */
-static inline int sfip_is_set(const sfip_t* ip)
+inline int sfip_is_set(const sfip_t* ip)
 {
 //    ARG_CHECK1(ip, -1);
     return ip->ip32[0] ||
@@ -209,7 +209,7 @@ inline int sfip_is_loopback(const sfip_t* ip)
 int sfip_ismapped(const sfip_t* ip);
 
 /* Support function for sfip_compare */
-static inline SFIP_RET _ip4_cmp(u_int32_t ip1, u_int32_t ip2)
+inline SFIP_RET _ip4_cmp(u_int32_t ip1, u_int32_t ip2)
 {
     u_int32_t hip1 = htonl(ip1);
     u_int32_t hip2 = htonl(ip2);
@@ -221,7 +221,7 @@ static inline SFIP_RET _ip4_cmp(u_int32_t ip1, u_int32_t ip2)
 }
 
 /* Support function for sfip_compare */
-static inline SFIP_RET _ip6_cmp(const sfip_t* ip1, const sfip_t* ip2)
+inline SFIP_RET _ip6_cmp(const sfip_t* ip1, const sfip_t* ip2)
 {
     SFIP_RET ret;
     const u_int32_t* p1, * p2;
@@ -252,7 +252,7 @@ static inline SFIP_RET _ip6_cmp(const sfip_t* ip1, const sfip_t* ip2)
  * or greater than ip2 In the case of mismatched families, the IPv4 address
  * is converted to an IPv6 representation. */
 /* XXX-IPv6 Should add version of sfip_compare that just tests equality */
-static inline SFIP_RET sfip_compare(const sfip_t* const ip1, const sfip_t* const ip2)
+inline SFIP_RET sfip_compare(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     int f1,f2;
 
@@ -301,7 +301,7 @@ static inline SFIP_RET sfip_compare(const sfip_t* const ip1, const sfip_t* const
  * or greater than ip2 In the case of mismatched families, the IPv4 address
  * is converted to an IPv6 representation. */
 /* XXX-IPv6 Should add version of sfip_compare that just tests equality */
-static inline SFIP_RET sfip_compare_unset(const sfip_t* const ip1, const sfip_t* const ip2)
+inline SFIP_RET sfip_compare_unset(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     int f1,f2;
 
@@ -346,22 +346,22 @@ static inline SFIP_RET sfip_compare_unset(const sfip_t* const ip1, const sfip_t*
     return SFIP_FAILURE;
 }
 
-static inline int sfip_fast_lt4(const sfip_t* const ip1, const sfip_t* const ip2)
+inline int sfip_fast_lt4(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     return *ip1->ip32 < *ip2->ip32;
 }
 
-static inline int sfip_fast_gt4(const sfip_t* const ip1, const sfip_t* const ip2)
+inline int sfip_fast_gt4(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     return *ip1->ip32 > *ip2->ip32;
 }
 
-static inline int sfip_fast_eq4(const sfip_t* const ip1, const sfip_t* const ip2)
+inline int sfip_fast_eq4(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     return *ip1->ip32 == *ip2->ip32;
 }
 
-static inline int sfip_fast_lt6(const sfip_t* const ip1, const sfip_t* const ip2)
+inline int sfip_fast_lt6(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     const u_int32_t* p1, * p2;
 
@@ -391,7 +391,7 @@ static inline int sfip_fast_lt6(const sfip_t* const ip1, const sfip_t* const ip2
     return 0;
 }
 
-static inline int sfip_fast_gt6(const sfip_t* const ip1, const sfip_t* const ip2)
+inline int sfip_fast_gt6(const sfip_t* const ip1, const sfip_t* const ip2)
 {
     const u_int32_t* p1, * p2;
 
@@ -421,7 +421,7 @@ static inline int sfip_fast_gt6(const sfip_t* const ip1, const sfip_t* const ip2
     return 0;
 }
 
-static inline int sfip_fast_eq6(const sfip_t* ip1, const sfip_t* ip2)
+inline int sfip_fast_eq6(const sfip_t* ip1, const sfip_t* ip2)
 {
     const u_int32_t* p1, * p2;
 
@@ -441,7 +441,7 @@ static inline int sfip_fast_eq6(const sfip_t* ip1, const sfip_t* ip2)
 }
 
 /* Checks if ip2 is equal to ip1 or contained within the CIDR ip1 */
-static inline bool sfip_fast_cont4(const sfip_t* ip1, const sfip_t* ip2)
+inline bool sfip_fast_cont4(const sfip_t* ip1, const sfip_t* ip2)
 {
     u_int32_t shift = 32 - sfip_bits(ip1);
     u_int32_t ip = ntohl(*ip2->ip32);
@@ -453,7 +453,7 @@ static inline bool sfip_fast_cont4(const sfip_t* ip1, const sfip_t* ip2)
 }
 
 /* Checks if ip2 is equal to ip1 or contained within the CIDR ip1 */
-static inline int sfip_fast_cont6(const sfip_t* ip1, const sfip_t* ip2)
+inline int sfip_fast_cont6(const sfip_t* ip1, const sfip_t* ip2)
 {
     u_int32_t ip;
     int i, bits = sfip_bits(ip1);
@@ -480,7 +480,7 @@ static inline int sfip_fast_cont6(const sfip_t* ip1, const sfip_t* ip2)
 /* Compares two IPs
  * Returns 1 for equal and 0 for not equal
  */
-static inline int sfip_fast_equals_raw(const sfip_t* ip1, const sfip_t* ip2)
+inline int sfip_fast_equals_raw(const sfip_t* ip1, const sfip_t* ip2)
 {
     int f1,f2;
 
@@ -519,7 +519,7 @@ static inline int sfip_fast_equals_raw(const sfip_t* ip1, const sfip_t* ip2)
  *  0  otherwise
  *
  ********************************************************************/
-static inline int sfip_is_private(const sfip_t* ip)
+inline int sfip_is_private(const sfip_t* ip)
 {
     const unsigned int* p;
 
@@ -571,7 +571,7 @@ static inline int sfip_is_private(const sfip_t* ip)
  *
  * SNORT RELIC
  */
-static inline int sfip_is_set(const sfip_t* const ip)
+inline int sfip_is_set(const sfip_t* const ip)
 {
 //    ARG_CHECK1(ip, -1);
     return ip->ip32[0] ||
@@ -581,7 +581,7 @@ static inline int sfip_is_set(const sfip_t* const ip)
            ip->ip32[3] || ip->bits != 128)) || ((ip->family == AF_INET) && ip->bits != 32);
 }
 
-static inline int sfip_is_set(const sfip_t& ip)
+inline int sfip_is_set(const sfip_t& ip)
 {
 //    ARG_CHECK1(ip, -1);
     return ip.ip32[0] ||
@@ -591,7 +591,7 @@ static inline int sfip_is_set(const sfip_t& ip)
            ip.ip32[3] || ip.bits != 128)) || ((ip.family == AF_INET) && ip.bits != 32);
 }
 
-static inline bool _is_sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool _is_sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs)
 {
     if (lhs->is_ip4())
     {
@@ -612,7 +612,7 @@ static inline bool _is_sfip_equals(const sfip_t* const lhs, const sfip_t* const
     }
 }
 
-static inline bool _is_sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool _is_sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs)
 {
     if (lhs->is_ip4())
     {
@@ -633,7 +633,7 @@ static inline bool _is_sfip_lesser(const sfip_t* const lhs, const sfip_t* const
     }
 }
 
-static inline bool sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs)
 {
     if (!sfip_is_set(lhs) || !sfip_is_set(rhs))
         return true;
@@ -641,10 +641,10 @@ static inline bool sfip_equals(const sfip_t* const lhs, const sfip_t* const rhs)
     return _is_sfip_equals(lhs, rhs);
 }
 
-static inline bool sfip_not_equals(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool sfip_not_equals(const sfip_t* const lhs, const sfip_t* const rhs)
 { return !sfip_equals(lhs,rhs); }
 
-static inline bool sfip_unset_equals(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool sfip_unset_equals(const sfip_t* const lhs, const sfip_t* const rhs)
 {
     if (!sfip_is_set(lhs) || !sfip_is_set(rhs))
         return false;
@@ -652,7 +652,7 @@ static inline bool sfip_unset_equals(const sfip_t* const lhs, const sfip_t* cons
     return _is_sfip_equals(lhs, rhs);
 }
 
-static inline bool sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs)
 {
     // I'm copying and pasting.  Don't ask me why this is different then sfip_equals
     if (!sfip_is_set(lhs) || !sfip_is_set(rhs))
@@ -661,7 +661,7 @@ static inline bool sfip_lesser(const sfip_t* const lhs, const sfip_t* const rhs)
     return _is_sfip_lesser(lhs, rhs);
 }
 
-static inline bool sfip_greater(const sfip_t* const lhs, const sfip_t* const rhs)
+inline bool sfip_greater(const sfip_t* const lhs, const sfip_t* const rhs)
 {
     // I'm copying and pasting.  Don't ask me why this is different then sfip_equals
     if (!sfip_is_set(lhs) || !sfip_is_set(rhs))
@@ -670,7 +670,7 @@ static inline bool sfip_greater(const sfip_t* const lhs, const sfip_t* const rhs
     return _is_sfip_lesser(rhs, lhs);
 }
 
-static inline void sfip_clear(sfip_t& x)
+inline void sfip_clear(sfip_t& x)
 {
     x.family = 0;
     x.bits = 0;
@@ -685,7 +685,7 @@ static inline void sfip_clear(sfip_t& x)
  * specific operator since the default equals operator will
  * correctly assign values
  */
-static inline void sfip_copy(sfip_t& lhs, const sfip_t* const rhs)
+inline void sfip_copy(sfip_t& lhs, const sfip_t* const rhs)
 { lhs = *rhs; }
 
 #if 0
index 9ca87167d45922b8bba8c76f5f6b0e11ea299814..a2b09c7303a62218ce232dcf1aff8b9183f3e95f 100644 (file)
@@ -149,7 +149,7 @@ uint32_t sfrt_num_entries(table_t* table);
 /* Perform a lookup on value contained in "ip"
  * For performance reason, we use this simplified version instead of sfrt_lookup
  * Note: this only applied to table setting: DIR_8x16 (DIR_16_8_4x2 for IPV4), DIR_8x4*/
-static inline GENERIC sfrt_dir8x_lookup(void* adr, table_t* table)
+inline GENERIC sfrt_dir8x_lookup(void* adr, table_t* table)
 {
     dir_sub_table_t* subtable;
     int i;
index b5848e751dae9dd7f90980fc8c7512ef6f0e0a1a..edf6bb011b5f96290d82980a82a7ba6ca39033c4 100644 (file)
@@ -131,7 +131,7 @@ bool TcpStateHandler::default_state_action(TcpSegmentDescriptor& tsd, TcpStreamT
         &tsd, &tracker, tracker.get_tcp_state(), tracker.get_tcp_event() );
 #else
     UNUSED(tsd);
-    UNUSED(tracker)
+    UNUSED(tracker);
 #endif
 
     return true;
index d9e30b42f7099790afeb4b0ba6c6359576b357b1..4192f544e4162d18836284808c101bc4b5be77cd 100644 (file)
@@ -51,22 +51,22 @@ void paf_setup(PAF_State*);  // called at session start
 void paf_reset(PAF_State*);  // called for do overs
 void paf_clear(PAF_State*);  // called at session end
 
-static inline uint32_t paf_position (PAF_State* ps)
+inline uint32_t paf_position (PAF_State* ps)
 {
     return ps->seq;
 }
 
-static inline uint32_t paf_initialized (PAF_State* ps)
+inline uint32_t paf_initialized (PAF_State* ps)
 {
     return ( ps->paf != StreamSplitter::START );
 }
 
-static inline uint32_t paf_active (PAF_State* ps)
+inline uint32_t paf_active (PAF_State* ps)
 {
     return ( ps->paf != StreamSplitter::ABORT );
 }
 
-static inline void paf_jump(PAF_State* ps, uint32_t n)
+inline void paf_jump(PAF_State* ps, uint32_t n)
 {
     ps->pos += n;
     ps->seq = ps->pos;
index 80b9550fa1e2f002877287c36e5426ae24361d10..afd0159e505570b0e63642691df3a1abeb4499c6 100644 (file)
@@ -42,7 +42,7 @@ static const char* const flushxt[] = { "IGN", "FPR", "PRE", "PRO", "PAF" };
 // FIXIT-L this should not be thread specific
 static THREAD_LOCAL int s5_trace_enabled = -1;
 
-static inline void TraceEvent(const Packet* p, TcpSegmentDescriptor*, uint32_t txd, uint32_t rxd)
+inline void TraceEvent(const Packet* p, TcpSegmentDescriptor*, uint32_t txd, uint32_t rxd)
 {
     int i;
     char flags[7] = "UAPRSF";
@@ -72,13 +72,13 @@ static inline void TraceEvent(const Packet* p, TcpSegmentDescriptor*, uint32_t t
         pc.total_from_daq, flags, h->th_flags, rseq, rack, h->win(), p->dsize, order);
 }
 
-static inline void TraceSession(const Flow* lws)
+inline void TraceSession(const Flow* lws)
 {
     fprintf(stdout, "    LWS: ST=0x%x SF=0x%x CP=%u SP=%u\n", (unsigned)lws->session_state,
         lws->ssn_state.session_flags, lws->client_port, lws->server_port);
 }
 
-static inline void TraceState(const TcpTracker* a, const TcpTracker* b, const char* s)
+inline void TraceState(const TcpTracker* a, const TcpTracker* b, const char* s)
 {
     uint32_t ua = a->get_snd_una() ? LCL(a, get_snd_una) : 0;
     uint32_t ns = a->get_snd_nxt() ? LCL(a, get_snd_nxt) : 0;
@@ -107,7 +107,7 @@ static inline void TraceState(const TcpTracker* a, const TcpTracker* b, const ch
     fprintf(stdout, "\n");
 }
 
-static inline void TraceTCP(const Packet* p, const Flow* lws, TcpSegmentDescriptor* tsd, int event)
+inline void TraceTCP(const Packet* p, const Flow* lws, TcpSegmentDescriptor* tsd, int event)
 {
     const TcpSession* ssn = (TcpSession*)lws->session;
     const TcpTracker* srv = ssn ? ssn->server : NULL;
@@ -144,8 +144,7 @@ static inline void TraceTCP(const Packet* p, const Flow* lws, TcpSegmentDescript
     }
 }
 
-static inline void S5TraceTCP(const Packet* p, const Flow* lws, TcpSegmentDescriptor* tsd, int
-    event)
+inline void S5TraceTCP(const Packet* p, const Flow* lws, TcpSegmentDescriptor* tsd, int event)
 {
     if (!s5_trace_enabled)
         return;
index 1908077a84ce4c911a9d70389aad27c9f4aec6a2..c80f22b5e7c37cd345aad4bea7bd52ba47440bd1 100644 (file)
@@ -100,7 +100,7 @@ struct TcpStats
 
 extern THREAD_LOCAL struct TcpStats tcpStats;
 
-static inline void inc_tcp_discards()
+inline void inc_tcp_discards()
 {
     tcpStats.discards++;
 }
index 5cc2696ede16a6a1a13b442afbbadc182ebbe3e2..755a9faafd84d1798ea16d488bddd36872e30cd4 100644 (file)
@@ -44,7 +44,6 @@ TcpStateClosed::~TcpStateClosed()
 bool TcpStateClosed::syn_sent(TcpSegmentDescriptor& tsd, TcpStreamTracker& tracker)
 {
     auto& trk = static_cast< TcpTracker& >( tracker );
-    Flow* flow = tsd.get_flow();
 
     trk.s_mgr.sub_state |= SUB_SYN_SENT;
 
index 5068a8fa3125eee2b1d4f8241108d1cb4f688e28..326310fc850ff02b2e89f3de3a9cac5283c99dd6 100644 (file)
@@ -41,13 +41,13 @@ enum SnortProtocols
     SNORT_PROTO_MAX
 };
 
-static inline bool is_network_protocol(int16_t proto)
+inline bool is_network_protocol(int16_t proto)
 { return (proto >= SNORT_PROTO_IP and proto <= SNORT_PROTO_UDP); }
 
-static inline bool is_builtin_protocol(int16_t proto)
+inline bool is_builtin_protocol(int16_t proto)
 { return proto < SNORT_PROTO_MAX; }
 
-static inline bool is_service_protocol(int16_t proto)
+inline bool is_service_protocol(int16_t proto)
 { return !is_network_protocol(proto); }
 
 void InitializeProtocolReferenceTable(void);
index cc20f9ab408173cd9e9d1142f2af1c415cd0d373..35103c3731ffaebcc6be1a3125a4735b77592231 100644 (file)
@@ -88,7 +88,7 @@
 #endif // __ia64 && __GNUC__
 #endif // __i386 || __amd64 || __x86_64__
 
-static inline double get_ticks_per_usec(void)
+inline double get_ticks_per_usec(void)
 {
     uint64_t start = 0, end = 0;
     get_clockticks(start);
index 80307590cdd6392bd56d97cfafbaf7956a0ad8ab..24f09756a7180779b03b8a7d2fcf757d3eed6ede 100644 (file)
@@ -53,7 +53,7 @@
 // Check to make sure that p is less than or equal to the ptr range
 // returns 1 if in bounds, 0 otherwise
 // FIXIT-L: Change return type to bool
-static inline int inBounds(const void* start, const void* end, const void* p)
+inline int inBounds(const void* start, const void* end, const void* p)
 {
     const uint8_t* pstart = (uint8_t*)start;
     const uint8_t* pend = (uint8_t*)end;
@@ -65,7 +65,7 @@ static inline int inBounds(const void* start, const void* end, const void* p)
 }
 
 // FIXIT-L: Change return type to bool
-static inline int SafeMemCheck(const void* dst, size_t n,
+inline int SafeMemCheck(const void* dst, size_t n,
     const void* start, const void* end)
 {
     const uint8_t* pstart = (uint8_t*)start;
@@ -90,7 +90,7 @@ static inline int SafeMemCheck(const void* dst, size_t n,
 
 // returns SAFEMEM_ERROR on failure, SAFEMEM_SUCCESS on success
 // FIXIT-L: Change return type to bool
-static inline int SafeMemcpy(
+inline int SafeMemcpy(
     void* dst, const void* src, size_t n, const void* start, const void* end)
 {
     if ( !n )
@@ -106,7 +106,7 @@ static inline int SafeMemcpy(
 // dst and src can be in the same buffer
 // returns SAFEMEM_ERROR on failure, SAFEMEM_SUCCESS on success
 // FIXIT-L: Change return type to bool
-static inline int SafeMemmove(
+inline int SafeMemmove(
     void* dst, const void* src, size_t n, const void* start, const void* end)
 {
     if (SafeMemCheck(dst, n, start, end) != SAFEMEM_SUCCESS)
@@ -120,7 +120,7 @@ static inline int SafeMemmove(
 // dst and src can be in the same buffer
 // returns SAFEMEM_ERROR on failure, SAFEMEM_SUCCESS on success
 // FIXIT-L: Change return type to bool
-static inline int SafeBoundsMemmove(
+inline int SafeBoundsMemmove(
     void* dst, const void* src, size_t n, const void* start, const void* end)
 {
     size_t overlap = 0;
@@ -154,7 +154,7 @@ static inline int SafeBoundsMemmove(
 
 // returns SAFEMEM_ERROR on failure, SAFEMEM_SUCCESS on success
 // FIXIT-L: Change return type to bool
-static inline int SafeMemset(
+inline int SafeMemset(
     void* dst, uint8_t c, size_t n, const void* start, const void* end)
 {
     if (SafeMemCheck(dst, n, start, end) != SAFEMEM_SUCCESS)
@@ -165,7 +165,7 @@ static inline int SafeMemset(
 
 // returns 0 on failure, 1 on success
 // FIXIT-L: Change return type to bool
-static inline int SafeWrite(uint8_t* start, uint8_t* end, uint8_t* dst, uint8_t* src)
+inline int SafeWrite(uint8_t* start, uint8_t* end, uint8_t* dst, uint8_t* src)
 {
     if (!inBounds(start, end, dst))
     {
@@ -178,7 +178,7 @@ static inline int SafeWrite(uint8_t* start, uint8_t* end, uint8_t* dst, uint8_t*
 
 // returns 0 on failure, 1 on success
 // FIXIT-L: Change return type to bool
-static inline int SafeRead(uint8_t* start, uint8_t* end, uint8_t* src, uint8_t* read)
+inline int SafeRead(uint8_t* start, uint8_t* end, uint8_t* src, uint8_t* read)
 {
     if (!inBounds(start,end, src))
     {
@@ -191,7 +191,7 @@ static inline int SafeRead(uint8_t* start, uint8_t* end, uint8_t* src, uint8_t*
 
 // An wrapper around snprintf to make it safe.
 // returns the number of bytes written to the buffer
-static inline size_t SafeSnprintf(char* str, size_t size, const char* format, ...)
+inline size_t SafeSnprintf(char* str, size_t size, const char* format, ...)
 {
     va_list ap;
     int ret;
index 439eee9258d7487fc87e2314c4fc01a9465bac33..7d7a80d66716209db14e14bd6e36a7404babdff0 100644 (file)
@@ -110,7 +110,7 @@ char* StripPrefixDir(char* prefix, char* dir);
 void SetNoCores(void);
 #endif
 
-static inline void* SnortAlloc(unsigned long size)
+inline void* SnortAlloc(unsigned long size)
 {
     void* pv = calloc(size, sizeof(char));
 
@@ -123,7 +123,7 @@ static inline void* SnortAlloc(unsigned long size)
     return NULL;
 }
 
-static inline long SnortStrtol(const char* nptr, char** endptr, int base)
+inline long SnortStrtol(const char* nptr, char** endptr, int base)
 {
     long iRet;
     errno = 0;
@@ -132,7 +132,7 @@ static inline long SnortStrtol(const char* nptr, char** endptr, int base)
     return iRet;
 }
 
-static inline unsigned long SnortStrtoul(const char* nptr, char** endptr, int base)
+inline unsigned long SnortStrtoul(const char* nptr, char** endptr, int base)
 {
     unsigned long iRet;
     errno = 0;
@@ -159,7 +159,7 @@ static inline unsigned long SnortStrtoul(const char* nptr, char** endptr, int ba
 // Also will set errno to ERANGE on a value returned from strtoul that is
 // greater than UINT32_MAX, but still return success.
 //
-static inline int SnortStrToU32(const char* buffer, char** endptr,
+inline int SnortStrToU32(const char* buffer, char** endptr,
     uint32_t* value, int base)
 {
     unsigned long int tmp;
@@ -199,7 +199,7 @@ static inline int SnortStrToU32(const char* buffer, char** endptr,
     return 0;
 }
 
-static inline pid_t gettid(void)
+inline pid_t gettid(void)
 {
 #if defined(LINUX) && defined(SYS_gettid)
     return syscall(SYS_gettid);
index 0e21ed617526e2da593dd048f8cecf3ce62dd2a2..58234300928c841bac5a49b0cd6d84fb0377fff6 100644 (file)
@@ -33,7 +33,7 @@ public:
     virtual bool convert(std::istringstream& data);
 };
 
-static inline ConversionState* init_state_ctor(Converter& c)
+inline ConversionState* init_state_ctor(Converter& c)
 {
     return new InitState(c);
 }
index 342b92b306c85e7d1196be7aaed9d1fef61905ee..44362edee3538592ee6b91b1f21d32dcc6ebeb78 100644 (file)
@@ -105,8 +105,7 @@ static bool get_record(u2iterator* it, u2record* record)
 
     if ( s_off )
     {
-        fseek(it->file, s_pos+s_off, SEEK_SET);
-        if (fseek(it->file, s_pos+s_off, SEEK_SET))
+        if ( fseek(it->file, s_pos+s_off, SEEK_SET) )
         {
             puts("Unable to SEEK on current file .. and this is not being handled yet.");
             return false;