]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
threads: remove u_long usage
authorVictor Julien <victor@inliniac.net>
Tue, 14 Apr 2020 11:19:01 +0000 (13:19 +0200)
committerVictor Julien <victor@inliniac.net>
Thu, 16 Apr 2020 12:37:34 +0000 (14:37 +0200)
src/threads.h
src/tm-threads.c
src/util-lua-common.c

index 17513cc5b40ffb422f781665ead6e05223631ea2..bca76d7365c221802c66198bac8f10afe91647ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2013 Open Information Security Foundation
+/* Copyright (C) 2007-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
@@ -222,38 +222,38 @@ enum {
 #define SCGetThreadIdLong(...) ({ \
     long tmpthid; \
     thr_self(&tmpthid); \
-    u_long _scgetthread_tid = (u_long)tmpthid; \
+    unsigned long _scgetthread_tid = (unsigned long)tmpthid; \
     _scgetthread_tid; \
 })
 #elif __OpenBSD__
 #define SCGetThreadIdLong(...) ({ \
     pid_t tpid; \
     tpid = getpid(); \
-    u_long _scgetthread_tid = (u_long)tpid; \
+    unsigned long _scgetthread_tid = (unsigned long)tpid; \
     _scgetthread_tid; \
 })
 #elif __CYGWIN__
 #define SCGetThreadIdLong(...) ({ \
-    u_long _scgetthread_tid = (u_long)GetCurrentThreadId(); \
+    unsigned long _scgetthread_tid = (unsigned long)GetCurrentThreadId(); \
        _scgetthread_tid; \
 })
 #elif OS_WIN32
 #define SCGetThreadIdLong(...) ({ \
-    u_long _scgetthread_tid = (u_long)GetCurrentThreadId(); \
+    unsigned long _scgetthread_tid = (unsigned long)GetCurrentThreadId(); \
        _scgetthread_tid; \
 })
 #elif OS_DARWIN
 #define SCGetThreadIdLong(...) ({ \
     thread_port_t tpid; \
     tpid = mach_thread_self(); \
-    u_long _scgetthread_tid = (u_long)tpid; \
+    unsigned long _scgetthread_tid = (unsigned long)tpid; \
     _scgetthread_tid; \
 })
 #elif defined(sun)
 #include <thread.h>
 #define SCGetThreadIdLong(...) ({ \
     thread_t tmpthid = thr_self(); \
-    u_long _scgetthread_tid = (u_long)tmpthid; \
+    unsigned long _scgetthread_tid = (unsigned long)tmpthid; \
     _scgetthread_tid; \
 })
 
@@ -261,7 +261,7 @@ enum {
 #define SCGetThreadIdLong(...) ({ \
    pid_t tmpthid; \
    tmpthid = syscall(SYS_gettid); \
-   u_long _scgetthread_tid = (u_long)tmpthid; \
+   unsigned long _scgetthread_tid = (unsigned long)tmpthid; \
    _scgetthread_tid; \
 })
 #endif /* OS FREEBSD */
index dd68b2feaf70b7d8ef180eee7c69835a17e73983..562c41e12461baa139c816c9d7075f4358664c2a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007-2017 Open Information Security Foundation
+/* Copyright (C) 2007-2020 Open Information Security Foundation
  *
  * You can copy, redistribute or modify this Program under the terms of
  * the GNU General Public License version 2 as published by the Free
index c45c9b1355cbbab8b50d6f1cf72c4610fce29d0e..4d6aa26e75783fa26304ec5c72d3010d70144cd2 100644 (file)
@@ -841,7 +841,7 @@ static int LuaCallbackFileState(lua_State *luastate)
  */
 static int LuaCallbackThreadInfoPushToStackFromThreadVars(lua_State *luastate, const ThreadVars *tv)
 {
-    u_long tid = SCGetThreadIdLong();
+    unsigned long tid = SCGetThreadIdLong();
     lua_pushinteger (luastate, (lua_Integer)tid);
     lua_pushstring (luastate, tv->name);
     lua_pushstring (luastate, tv->thread_group_name);