]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
src: fix strict-prototype warnings
authorVictor Julien <vjulien@oisf.net>
Mon, 16 Jan 2023 18:14:28 +0000 (19:14 +0100)
committerVictor Julien <vjulien@oisf.net>
Tue, 24 Jan 2023 08:34:12 +0000 (09:34 +0100)
Tested on Fedora 37 with clang 15.

app-layer.c:1055:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void AppLayerSetupCounters()
                          ^
                           void
app-layer.c:1176:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
void AppLayerDeSetupCounters()
                            ^
                             void
2 errors generated.

(cherry picked from commit ebd87282196e4757db44e9d40823477b34484238)

32 files changed:
src/app-layer-htp-mem.c
src/app-layer.c
src/counters.c
src/defrag-queue.c
src/detect-engine-analyzer.c
src/detect-engine-loader.c
src/detect-engine-tag.c
src/detect-engine.c
src/flow-bypass.c
src/flow-manager.c
src/flow-queue.c
src/host-queue.c
src/ippair-queue.c
src/log-cf-common.c
src/runmode-af-packet.c
src/runmode-netmap.c
src/source-af-packet.c
src/source-nfq.c
src/source-pcap-file.c
src/source-windivert.c
src/stream-tcp-reassemble.c
src/tm-threads.c
src/util-action.c
src/util-affinity.c
src/util-conf.c
src/util-debug-filters.c
src/util-debug.c
src/util-device.c
src/util-hash-lookup3.c
src/util-log-redis.c
src/util-profiling-locks.c
src/win32-syscall.c

index e1893f1e900807f7dfcce1eb0ccf1deadd985084..edbfa9709340d6357701b9343643bdb188361f9c 100644 (file)
@@ -42,7 +42,7 @@ SC_ATOMIC_DECLARE(uint64_t, htp_config_memcap);
 SC_ATOMIC_DECLARE(uint64_t, htp_memuse);
 SC_ATOMIC_DECLARE(uint64_t, htp_memcap);
 
-void HTPParseMemcap()
+void HTPParseMemcap(void)
 {
     const char *conf_val;
 
index e0301b96891326ade316708e444b609dbad2f70f..3e75037ab1fadbccce9b99f2e226a3312a4b0b9d 100644 (file)
@@ -949,7 +949,7 @@ void AppLayerRegisterGlobalCounters(void)
 }
 
 #define IPPROTOS_MAX 2
-void AppLayerSetupCounters()
+void AppLayerSetupCounters(void)
 {
     uint8_t ipprotos[] = { IPPROTO_TCP, IPPROTO_UDP };
     uint8_t ipproto;
@@ -1022,7 +1022,7 @@ void AppLayerRegisterThreadCounters(ThreadVars *tv)
     }
 }
 
-void AppLayerDeSetupCounters()
+void AppLayerDeSetupCounters(void)
 {
     memset(applayer_counter_names, 0, sizeof(applayer_counter_names));
     memset(applayer_counters, 0, sizeof(applayer_counters));
index 2d9fabeca937ee0bb808f45a5e10fa75dc33e2bc..b96062c88fca1c947485206ef4959ddcb46c13d5 100644 (file)
@@ -1252,7 +1252,7 @@ uint64_t StatsGetLocalCounterValue(ThreadVars *tv, uint16_t id)
 /**
  * \brief Releases the resources alloted by the Stats API
  */
-void StatsReleaseResources()
+void StatsReleaseResources(void)
 {
     StatsLogSummary();
     StatsReleaseCtx();
index 71dcb9329e2e24ab7682f1c879e6c7e7075b9928..771693d5909ff6994ca1be105c7592b908a1a6ec 100644 (file)
@@ -40,7 +40,7 @@ DefragTrackerQueue *DefragTrackerQueueInit (DefragTrackerQueue *q)
     return q;
 }
 
-DefragTrackerQueue *DefragTrackerQueueNew()
+DefragTrackerQueue *DefragTrackerQueueNew(void)
 {
     DefragTrackerQueue *q = (DefragTrackerQueue *)SCMalloc(sizeof(DefragTrackerQueue));
     if (q == NULL) {
index 9ae652d772730e76035d426140ac0cbcfa10d9b9..e4a15a38ced6c4765fef2b27a00b45204f947f2e 100644 (file)
@@ -425,7 +425,7 @@ void CleanupRuleAnalyzer(void)
  * \retval 1 if successful
  * \retval 0 if on error
  */
-int PerCentEncodingSetup ()
+int PerCentEncodingSetup(void)
 {
 #define DETECT_PERCENT_ENCODING_REGEX "%[0-9|a-f|A-F]{2}"
     const char *eb = NULL;
index 271c31e9500731752ea316f300c611b0c5e28035..c7fb8657b96562efbe87e7033e7c1484759b36d2 100644 (file)
@@ -493,7 +493,7 @@ void DetectLoadersInit(void)
 /**
  * \brief Unpauses all threads present in tv_root
  */
-void TmThreadWakeupDetectLoaderThreads()
+void TmThreadWakeupDetectLoaderThreads(void)
 {
     ThreadVars *tv = NULL;
     int i = 0;
@@ -517,7 +517,7 @@ void TmThreadWakeupDetectLoaderThreads()
 /**
  * \brief Unpauses all threads present in tv_root
  */
-void TmThreadContinueDetectLoaderThreads()
+void TmThreadContinueDetectLoaderThreads(void)
 {
     ThreadVars *tv = NULL;
     int i = 0;
index 505ff443fd236587453444b5869e729d9e86a30a..1c446b8a1fde8ea370774d7a0c3f8aeae0112b20 100644 (file)
@@ -77,7 +77,7 @@ void TagDestroyCtx(void)
 
 /** \brief Reset the tagging engine context
  */
-void TagRestartCtx()
+void TagRestartCtx(void)
 {
     TagDestroyCtx();
     TagInitCtx();
index 4bb2cde8479ea140b0acda2c646c4673f97c07ed..c89586cbf74c583d7f8c2bfcece26c5423d5ca1b 100644 (file)
@@ -4582,7 +4582,7 @@ static int DetectEngineTest09(void)
 
 #endif
 
-void DetectEngineRegisterTests()
+void DetectEngineRegisterTests(void)
 {
 #ifdef UNITTESTS
     UtRegisterTest("DetectEngineTest01", DetectEngineTest01);
index 9b4e75e702fee4bc22f5fc7e1c30577f80574fb1..14cceaeaa6b74449671138afc79255be938a11b2 100644 (file)
@@ -180,7 +180,7 @@ int BypassedFlowManagerRegisterUpdateFunc(BypassedUpdateFunc UpdateFunc,
 #endif
 
 /** \brief spawn the flow bypass manager thread */
-void BypassedFlowManagerThreadSpawn()
+void BypassedFlowManagerThreadSpawn(void)
 {
 #ifdef CAPTURE_OFFLOAD_MANAGER
 
index 71e15828dbfb9c13059258fcbcaeb02faa408381..cdb611c07e5aa57d32e76e5b2238f8339403961f 100644 (file)
@@ -1028,7 +1028,7 @@ static TmEcode FlowManager(ThreadVars *th_v, void *thread_data)
 }
 
 /** \brief spawn the flow manager thread */
-void FlowManagerThreadSpawn()
+void FlowManagerThreadSpawn(void)
 {
     intmax_t setting = 1;
     (void)ConfGetInt("flow.managers", &setting);
@@ -1243,7 +1243,7 @@ static bool FlowRecyclerReadyToShutdown(void)
 }
 
 /** \brief spawn the flow recycler thread */
-void FlowRecyclerThreadSpawn()
+void FlowRecyclerThreadSpawn(void)
 {
     intmax_t setting = 1;
     (void)ConfGetInt("flow.recyclers", &setting);
index 530cab3db78138ce9bb94299a566689cd4a879f7..6ec98a394daf1f08505f12f873959d448e71115b 100644 (file)
@@ -33,7 +33,7 @@
 #include "util-debug.h"
 #include "util-print.h"
 
-FlowQueue *FlowQueueNew()
+FlowQueue *FlowQueueNew(void)
 {
     FlowQueue *q = (FlowQueue *)SCMalloc(sizeof(FlowQueue));
     if (q == NULL) {
index 2ef1628d33b679e95e1966fb6851e645d6cf9fc8..6c3144afccb4dbb545955bb87f361afb9c7eaf9c 100644 (file)
@@ -40,7 +40,7 @@ HostQueue *HostQueueInit (HostQueue *q)
     return q;
 }
 
-HostQueue *HostQueueNew()
+HostQueue *HostQueueNew(void)
 {
     HostQueue *q = (HostQueue *)SCMalloc(sizeof(HostQueue));
     if (q == NULL) {
index 0f68200dd94769bcce3b499ae0df3640e9512bd4..992ed9d86999f2bda84d4cac19f9237b043cad79 100644 (file)
@@ -40,7 +40,7 @@ IPPairQueue *IPPairQueueInit (IPPairQueue *q)
     return q;
 }
 
-IPPairQueue *IPPairQueueNew()
+IPPairQueue *IPPairQueueNew(void)
 {
     IPPairQueue *q = (IPPairQueue *)SCMalloc(sizeof(IPPairQueue));
     if (q == NULL) {
index 35a3168eafcc4f86a2c427d55aa30603576e8f63..1e6ea246817b208173938fa000ccd35230342ef1 100644 (file)
@@ -34,7 +34,7 @@
  *  \retval LogCustomFormatNode * ptr if created
  *  \retval NULL if failed to allocate
  */
-LogCustomFormatNode * LogCustomFormatNodeAlloc()
+LogCustomFormatNode *LogCustomFormatNodeAlloc(void)
 {
     LogCustomFormatNode * node = SCCalloc(1, sizeof(LogCustomFormatNode));
     if (unlikely(node == NULL)) {
@@ -49,7 +49,7 @@ LogCustomFormatNode * LogCustomFormatNodeAlloc()
  *  \retval LogCustomFormat * ptr if created
  *  \retval NULL if failed to allocate
  */
-LogCustomFormat * LogCustomFormatAlloc()
+LogCustomFormat *LogCustomFormatAlloc(void)
 {
     LogCustomFormat * cf = SCCalloc(1, sizeof(LogCustomFormat));
     if (unlikely(cf == NULL)) {
index 12bfbfb659110b453cdfb5186aafe03dd47f9008..2f239df66de77d522140c81f1d93b30752935ccc 100644 (file)
@@ -717,7 +717,7 @@ static int AFPConfigGeThreadsCount(void *conf)
     return afp->threads;
 }
 
-int AFPRunModeIsIPS()
+int AFPRunModeIsIPS(void)
 {
     int nlive = LiveGetDeviceCount();
     int ldev;
index 9e31b08b20ef614cc26aa1e7fc45d272f9cb7ac1..5d104c071793f64eb69d7cfa7df9832bee4e138d 100644 (file)
@@ -373,7 +373,7 @@ static int NetmapConfigGeThreadsCount(void *conf)
     return aconf->in.threads;
 }
 
-int NetmapRunModeIsIPS()
+int NetmapRunModeIsIPS(void)
 {
     int nlive = LiveGetDeviceCount();
     int ldev;
index db8d79307d5c2759d974a838c02ce7c5f1f9b7c3..0ba20bb471bb9dc0f9891d23b8c5f478eab8eb43 100644 (file)
@@ -437,7 +437,7 @@ AFPPeersList peerslist;
 /**
  * \brief Init the global list of ::AFPPeer
  */
-TmEcode AFPPeersListInit()
+TmEcode AFPPeersListInit(void)
 {
     SCEnter();
     TAILQ_INIT(&peerslist.peers);
@@ -454,7 +454,7 @@ TmEcode AFPPeersListInit()
  *
  * \retval TM_ECODE_FAILED if some threads are not peered or TM_ECODE_OK else.
  */
-TmEcode AFPPeersListCheck()
+TmEcode AFPPeersListCheck(void)
 {
 #define AFP_PEERS_MAX_TRY 4
 #define AFP_PEERS_WAIT 20000
@@ -569,7 +569,7 @@ static int AFPPeersListStarted(void)
 /**
  * \brief Clean the global peers list.
  */
-void AFPPeersListClean()
+void AFPPeersListClean(void)
 {
     AFPPeer *pitem;
 
index 3f708eb1888cddde2d2a04d96e9d91bf48c5b3d1..a6d2e5e5ea585c1fed5f4aba9ab042691a45cf70 100644 (file)
@@ -1271,7 +1271,7 @@ TmEcode DecodeNFQThreadDeinit(ThreadVars *tv, void *data)
 /**
  * \brief Clean global contexts. Must be called on exit.
  */
-void NFQContextsClean()
+void NFQContextsClean(void)
 {
     if (g_nfq_q != NULL) {
         SCFree(g_nfq_q);
index 4b2c28550d423c94ddb8596baf5d10eb3baaa77e..0605c44c28a4472cde91e8139fae47658d8651df 100644 (file)
@@ -133,7 +133,7 @@ void TmModuleDecodePcapFileRegister (void)
     tmm_modules[TMM_DECODEPCAPFILE].flags = TM_FLAG_DECODE_TM;
 }
 
-void PcapFileGlobalInit()
+void PcapFileGlobalInit(void)
 {
     memset(&pcap_g, 0x00, sizeof(pcap_g));
     SC_ATOMIC_INIT(pcap_g.invalid_checksums);
@@ -461,7 +461,7 @@ TmEcode DecodePcapFileThreadDeinit(ThreadVars *tv, void *data)
     SCReturnInt(TM_ECODE_OK);
 }
 
-void PcapIncreaseInvalidChecksum()
+void PcapIncreaseInvalidChecksum(void)
 {
     (void) SC_ATOMIC_ADD(pcap_g.invalid_checksums, 1);
 }
index 3701310d720ad0ed7dd9ed4f90229ae95e2c86df..95d99845acccffe64ad730ba00479127f2fcb49c 100644 (file)
@@ -1000,7 +1000,7 @@ static int SourceWinDivertTestIfaceMatchFilter(void)
 /**
  * \brief this function registers unit tests for the WinDivert Source
  */
-void SourceWinDivertRegisterTests()
+void SourceWinDivertRegisterTests(void)
 {
 #ifdef UNITTESTS
     UtRegisterTest("SourceWinDivertTestIfaceMatchFilter",
index 670182111c259c37aac92ca2c063e7006cd01a50..aab148eaf102aec5aa30f5563cdd0253ef5ca336 100644 (file)
@@ -184,7 +184,7 @@ int StreamTcpReassembleSetMemcap(uint64_t size)
  *
  *  \return memcap memcap value
  */
-uint64_t StreamTcpReassembleGetMemcap()
+uint64_t StreamTcpReassembleGetMemcap(void)
 {
     uint64_t memcapcopy = SC_ATOMIC_GET(stream_config.reassembly_memcap);
     return memcapcopy;
index 2b81856bbc834f3d426ed82257ef1dddb50ed5b1..367c85ab9506452d56c4081910ae08d24f776f60 100644 (file)
@@ -1864,7 +1864,7 @@ void TmThreadContinue(ThreadVars *tv)
 /**
  * \brief Unpauses all threads present in tv_root
  */
-void TmThreadContinueThreads()
+void TmThreadContinueThreads(void)
 {
     SCMutexLock(&tv_root_lock);
     for (int i = 0; i < TVT_MAX; i++) {
@@ -1892,7 +1892,7 @@ void TmThreadPause(ThreadVars *tv)
 /**
  * \brief Pauses all threads present in tv_root
  */
-void TmThreadPauseThreads()
+void TmThreadPauseThreads(void)
 {
     TmThreadsListThreads();
 
@@ -2291,7 +2291,7 @@ void TmThreadsGetMinimalTimestamp(struct timeval *ts)
     SCLogDebug("ts->tv_sec %"PRIuMAX, (uintmax_t)ts->tv_sec);
 }
 
-uint16_t TmThreadsGetWorkerThreadMax()
+uint16_t TmThreadsGetWorkerThreadMax(void)
 {
     uint16_t ncpus = UtilCpuGetNumProcessorsOnline();
     int thread_max = TmThreadGetNbThreads(WORKER_CPU_SET);
index a4afdd5d30bb620338abf26bc393d49c10103486..5950eb962948987b91abc76a9fa1dd50339a18db 100644 (file)
@@ -95,7 +95,7 @@ static uint8_t ActionAsciiToFlag(const char *action)
  *
  * \retval 0 on success; -1 on fatal error;
  */
-int ActionInitConfig()
+int ActionInitConfig(void)
 {
     uint8_t actions_used = 0;
     uint8_t action_flag = 0;
index 3a9c8f08a1fea2b493bb77507f86f936016f5afc..1cf4af8a3b45327caba5aa80aca68f93d3facc00 100644 (file)
@@ -177,7 +177,7 @@ static void BuildCpuset(const char *name, ConfNode *node, cpu_set_t *cpu)
  * \brief Extract cpu affinity configuration from current config file
  */
 
-void AffinitySetupLoadFromConfig()
+void AffinitySetupLoadFromConfig(void)
 {
 #if !defined __CYGWIN__ && !defined OS_WIN32 && !defined __OpenBSD__ && !defined sun
     ConfNode *root = ConfGetNode("threading.cpu-affinity");
index a135b4b3884ae44a728585d5124658741e054fa0..da337c6b4bfb273021f085ec833dc8ec02add5a6 100644 (file)
@@ -32,7 +32,7 @@ TmEcode ConfigSetLogDirectory(const char *name)
     return ConfSetFinal("default-log-dir", name) ? TM_ECODE_OK : TM_ECODE_FAILED;
 }
 
-const char *ConfigGetLogDirectory()
+const char *ConfigGetLogDirectory(void)
 {
     const char *log_dir = NULL;
 
@@ -79,7 +79,7 @@ TmEcode ConfigSetDataDirectory(char *name)
     return ConfSetFinal("default-data-dir", tmp) ? TM_ECODE_OK : TM_ECODE_FAILED;
 }
 
-const char *ConfigGetDataDirectory()
+const char *ConfigGetDataDirectory(void)
 {
     const char *data_dir = NULL;
 
index a94db699a5d21b017f52a3bf97c27cff356d510b..16d5ac470bb808380d5bd454995ad41f0fe8a97f 100644 (file)
@@ -405,7 +405,7 @@ void SCLogReleaseFGFilters(void)
  *
  * \retval count The no of FG filters
  */
-int SCLogPrintFGFilters()
+int SCLogPrintFGFilters(void)
 {
     SCLogFGFilterFile *fgf_file = NULL;
     SCLogFGFilterFunc *fgf_func = NULL;
index 4303f828cb195011c6af05c7274cf489fb870d61..9889219f7764b647f8126a47ae9528b6730fe3fb 100644 (file)
@@ -1725,7 +1725,7 @@ static int SCLogTestInit05(void)
 
 #endif /* UNITTESTS */
 
-void SCLogRegisterTests()
+void SCLogRegisterTests(void)
 {
 
 #ifdef UNITTESTS
index 0faf9b939140d1aeb50e7c7e2d9cdb19ddbabc06..6c89ca6363934e4aaa13c40224eaf4bebf564d46 100644 (file)
@@ -339,12 +339,12 @@ int LiveBuildDeviceListCustom(const char *runmode, const char *itemname)
  *
  * This can be useful in the case, this is not a real interface.
  */
-void LiveDeviceHasNoStats()
+void LiveDeviceHasNoStats(void)
 {
     live_devices_stats = 0;
 }
 
-int LiveDeviceListClean()
+int LiveDeviceListClean(void)
 {
     SCEnter();
     LiveDevice *pd, *tpd;
index bd47eacc07a98e3805546a670248ebd4e4cd8529..d341be3665cfecc7efb7f82fb3d845d17b08000b 100644 (file)
@@ -940,7 +940,7 @@ uint32_t hashbig( const void *key, size_t length, uint32_t initval)
 #ifdef SELF_TEST
 
 /* used for timings */
-void driver1()
+void driver1(void)
 {
   uint8_t buf[256];
   uint32_t i;
@@ -962,7 +962,7 @@ void driver1()
 #define HASHLEN   1
 #define MAXPAIR 60
 #define MAXLEN  70
-void driver2()
+void driver2(void)
 {
   uint8_t qa[MAXLEN+1], qb[MAXLEN+2], *a = &qa[0], *b = &qb[1];
   uint32_t c[HASHSTATE], d[HASHSTATE], i=0, j=0, k, l, m=0, z;
@@ -1032,7 +1032,7 @@ void driver2()
 }
 
 /* Check for reading beyond the end of the buffer and alignment problems */
-void driver3()
+void driver3(void)
 {
   uint8_t buf[MAXLEN+20], *b;
   uint32_t len;
@@ -1123,7 +1123,7 @@ void driver3()
 }
 
 /* check for problems with nulls */
- void driver4()
+void driver4(void)
 {
   uint8_t buf[1];
   uint32_t h,i,state[HASHSTATE];
@@ -1139,7 +1139,7 @@ void driver3()
   }
 }
 
-void driver5()
+void driver5(void)
 {
   uint32_t b,c;
   b=0, c=0, hashlittle2("", 0, &c, &b);
@@ -1160,8 +1160,7 @@ void driver5()
   printf("hash is %.8lx\n", c);   /* cd628161 */
 }
 
-
-int main()
+int main(void)
 {
   driver1();   /* test that the key is hashed: used for timings */
   driver2();   /* test that whole key is hashed thoroughly */
index 4f437f02ba6458dc9cf469416a537f53d003c7e0..ff5b8605bca5d4011043d9451ec6d8d09630df58 100644 (file)
@@ -46,7 +46,7 @@ static void SCLogFileCloseRedis(LogFileCtx *log_ctx);
 /**
  * \brief SCLogRedisInit() - Initializes global stuff before threads
  */
-void SCLogRedisInit()
+void SCLogRedisInit(void)
 {
 #ifdef HAVE_LIBEVENT_PTHREADS
     evthread_use_pthreads();
index 0840750596047d2531c5176c848abd489d854005..0ec26ed58b0ba0860ed5983fd629ba3a6de10c10 100644 (file)
@@ -93,7 +93,7 @@ static void LockRecordFree(void *data)
     SCFree(fn);
 }
 
-int LockRecordInitHash()
+int LockRecordInitHash(void)
 {
     pthread_mutex_init(&lock_records_mutex, NULL);
     pthread_mutex_lock(&lock_records_mutex);
@@ -218,7 +218,7 @@ static void SCProfilingListLocks(void)
     fclose(fp);
 }
 
-void LockRecordFreeHash()
+void LockRecordFreeHash(void)
 {
     if (profiling_locks_enabled == 0)
         return;
index 0c2789264d9708100f3de567aff302e9ae713bcf..3acba2c9bf820804e514ca27b7a9fe387175a6f2 100644 (file)
@@ -315,7 +315,7 @@ release:
 /**
  * \brief get the maximum transmissible unit for all devices on the system
  */
-int GetGlobalMTUWin32()
+int GetGlobalMTUWin32(void)
 {
     uint32_t mtu = 0;
 
@@ -1682,7 +1682,7 @@ static int Win32TestStripPcapPrefix(void)
 }
 #endif /* UNITTESTS */
 
-void Win32SyscallRegisterTests()
+void Win32SyscallRegisterTests(void)
 {
 #ifdef UNITTESTS
     UtRegisterTest("Win32TestStripPcapPrefix", Win32TestStripPcapPrefix);