]> 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, 17 Jan 2023 10:25:44 +0000 (11:25 +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.

34 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-dpdk.c
src/runmode-netmap.c
src/source-af-packet.c
src/source-dpdk.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 8b13b75ccaa101f83003e5c3fb8ed5560fcde742..bd9b79f6762398435a40a151ad1709c6b811c38b 100644 (file)
@@ -40,7 +40,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 8b5f307cdae8c35e97188fc0841c49d33941db2f..0e244caf2039a795a88e944c17d47a4a0bc3aa06 100644 (file)
@@ -1052,7 +1052,7 @@ void AppLayerRegisterGlobalCounters(void)
 }
 
 #define IPPROTOS_MAX 2
-void AppLayerSetupCounters()
+void AppLayerSetupCounters(void)
 {
     const uint8_t ipprotos[] = { IPPROTO_TCP, IPPROTO_UDP };
     AppProto alprotos[ALPROTO_MAX];
@@ -1173,7 +1173,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 56c0ab0e03d1c3d803a81193fc3fad3ab9e4b556..01ac449558c3a01df5fd332934dd5c8a27da10f6 100644 (file)
@@ -1265,7 +1265,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 0e29f1603573bbe14cd60a5973f5aa453c67ed14..dccff8871f951731b5e1ca7e8118e83ce589a84e 100644 (file)
@@ -38,7 +38,7 @@ DefragTrackerQueue *DefragTrackerQueueInit (DefragTrackerQueue *q)
     return q;
 }
 
-DefragTrackerQueue *DefragTrackerQueueNew()
+DefragTrackerQueue *DefragTrackerQueueNew(void)
 {
     DefragTrackerQueue *q = (DefragTrackerQueue *)SCMalloc(sizeof(DefragTrackerQueue));
     if (q == NULL) {
index ebf2d0c5e0ab32141d1220397c7960d91d5072cb..94539cb475a1c4778f211e682fea68e47fd4f5bc 100644 (file)
@@ -431,7 +431,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}"
     int en;
index 22fbf11f6f038b1c84fcebd6d8569d5b29bab1ca..1ec6944f4ac5a7409f635da1ecfc8967ddd8306a 100644 (file)
@@ -504,7 +504,7 @@ void DetectLoadersInit(void)
 /**
  * \brief Unpauses all threads present in tv_root
  */
-void TmThreadWakeupDetectLoaderThreads()
+void TmThreadWakeupDetectLoaderThreads(void)
 {
     ThreadVars *tv = NULL;
     int i = 0;
@@ -528,7 +528,7 @@ void TmThreadWakeupDetectLoaderThreads()
 /**
  * \brief Unpauses all threads present in tv_root
  */
-void TmThreadContinueDetectLoaderThreads()
+void TmThreadContinueDetectLoaderThreads(void)
 {
     ThreadVars *tv = NULL;
     int i = 0;
index 8f2a12f062be2ad96a389249c610a7fff8bb70f1..12b8e9916aa6f6281c177f31410a1db023990912 100644 (file)
@@ -78,7 +78,7 @@ void TagDestroyCtx(void)
 
 /** \brief Reset the tagging engine context
  */
-void TagRestartCtx()
+void TagRestartCtx(void)
 {
     TagDestroyCtx();
     TagInitCtx();
index d0db2ec64c8bc1a6dee2836dd9114dcf12ecbad5..f0d3b1bc7a49372ba8434a1366d19fee151df959 100644 (file)
@@ -4861,7 +4861,7 @@ static int DetectEngineTest09(void)
 
 #endif
 
-void DetectEngineRegisterTests()
+void DetectEngineRegisterTests(void)
 {
 #ifdef UNITTESTS
     UtRegisterTest("DetectEngineTest01", DetectEngineTest01);
index 98e62f519e25a83868f129d15d744185468366a0..8dbb5ab17d748a7cfeb0caa199a9f20437a17d54 100644 (file)
@@ -181,7 +181,7 @@ int BypassedFlowManagerRegisterUpdateFunc(BypassedUpdateFunc UpdateFunc,
 #endif
 
 /** \brief spawn the flow bypass manager thread */
-void BypassedFlowManagerThreadSpawn()
+void BypassedFlowManagerThreadSpawn(void)
 {
 #ifdef CAPTURE_OFFLOAD_MANAGER
 
index 4b0b5cf068f70a3586a4ea6ba1b0b4309a1d4ebe..273eeda721497572f8a04b029d004e0e53a47457 100644 (file)
@@ -951,7 +951,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);
@@ -1146,7 +1146,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 d6fc7c04dea827d9a46eee43be725464b3dde970..1d4653b3bf30c5d68db389de3ded4ef20f019718 100644 (file)
@@ -32,7 +32,7 @@
 #include "util-debug.h"
 #include "util-print.h"
 
-FlowQueue *FlowQueueNew()
+FlowQueue *FlowQueueNew(void)
 {
     FlowQueue *q = (FlowQueue *)SCMalloc(sizeof(FlowQueue));
     if (q == NULL) {
index 3d400315f5a0ef1b4e9fa640e897df2c3247fba7..f81cb54c771386f57fff1bbea850454873ae843f 100644 (file)
@@ -39,7 +39,7 @@ HostQueue *HostQueueInit (HostQueue *q)
     return q;
 }
 
-HostQueue *HostQueueNew()
+HostQueue *HostQueueNew(void)
 {
     HostQueue *q = (HostQueue *)SCMalloc(sizeof(HostQueue));
     if (q == NULL) {
index d410d30a875673ec1381d92669d6cdc696121073..dac6b7e9c93518fc40f07fd71de50fb7ca5095a3 100644 (file)
@@ -39,7 +39,7 @@ IPPairQueue *IPPairQueueInit (IPPairQueue *q)
     return q;
 }
 
-IPPairQueue *IPPairQueueNew()
+IPPairQueue *IPPairQueueNew(void)
 {
     IPPairQueue *q = (IPPairQueue *)SCMalloc(sizeof(IPPairQueue));
     if (q == NULL) {
index b5ba7120385e9174bff37696b84e4d3684f6fb0b..9b50544004a91718ccd7c9afab0104ee2518f830 100644 (file)
@@ -36,7 +36,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)) {
@@ -51,7 +51,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 92107c78f154e78aff2557c523f4733f6cb8d7d8..1d22e5e9fcd0bb6e159140572d79651042f82908 100644 (file)
@@ -676,7 +676,7 @@ static int AFPConfigGeThreadsCount(void *conf)
     return afp->threads;
 }
 
-int AFPRunModeIsIPS()
+int AFPRunModeIsIPS(void)
 {
     int nlive = LiveGetDeviceCount();
     int ldev;
index 479bb7febfa74df048cb6334fe2d74f311f9fe9b..4a317b316c29187777b7335e042bfa5cdb67d62d 100644 (file)
@@ -252,7 +252,7 @@ static void ArgumentsAddOptionAndArgument(struct Arguments *args, const char *op
     SCReturn;
 }
 
-static void InitEal()
+static void InitEal(void)
 {
     SCEnter();
     int retval;
index 30e726f55771a6eb111333d29fca1835a4de96fb..2a6ba13ac8f60491900dc407ec995bc5009c7bab 100644 (file)
@@ -320,7 +320,7 @@ static int NetmapConfigGeThreadsCount(void *conf)
     return aconf->in.threads;
 }
 
-int NetmapRunModeIsIPS()
+int NetmapRunModeIsIPS(void)
 {
     int nlive = LiveGetDeviceCount();
     int ldev;
index 39d5e03fd28a50ec6e2932cc46fada647093c835..f139f0cc117d3ddb94cc6493ae902ae0fe9f1a30 100644 (file)
@@ -446,7 +446,7 @@ AFPPeersList peerslist;
 /**
  * \brief Init the global list of ::AFPPeer
  */
-TmEcode AFPPeersListInit()
+TmEcode AFPPeersListInit(void)
 {
     SCEnter();
     TAILQ_INIT(&peerslist.peers);
@@ -463,7 +463,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
@@ -574,7 +574,7 @@ static int AFPPeersListStarted(void)
 /**
  * \brief Clean the global peers list.
  */
-void AFPPeersListClean()
+void AFPPeersListClean(void)
 {
     AFPPeer *pitem;
 
index e32611e99cfe51abe023ff5036f880cc9ac091e3..72aab475fb102a26096735a7a29145780a54f698 100644 (file)
@@ -184,7 +184,7 @@ static void DPDKSetTimevalReal(struct timeval *machine_start_tv, struct timeval
 }
 
 /* get number of seconds from the reset of TSC counter (typically from the machine start) */
-static uint64_t DPDKGetSeconds()
+static uint64_t DPDKGetSeconds(void)
 {
     return CyclesToSeconds(rte_get_tsc_cycles());
 }
index b77b357f71f011ea0a553973744f4237a4e1b556..7fabb0c54c45964a2b8eea54e15fb0c0ba0e3d6a 100644 (file)
@@ -1268,7 +1268,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 870f8f2d09798266d19a80a72001c225004ebbd7..86a3cc54aaee4e6c2cc79f71845964c2fb6f8657 100644 (file)
@@ -135,7 +135,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);
@@ -452,7 +452,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 c210c4373fd60c1ada5b0285c73073f28900f7ad..08a45a13bdb6323a9c5fb9bb8cc67c81fbed3de7 100644 (file)
@@ -993,7 +993,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 f4f9955f40e6bb332820893f31ab0787ac56a853..742657cfc58c93bb173c5cc815bdba0c59a34015 100644 (file)
@@ -195,7 +195,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 1ad132865fed38a75fc8bd865fc1227621ab823c..508d6ab719249e8963ab71410c68df4b6b909703 100644 (file)
@@ -1885,7 +1885,7 @@ again:
 /**
  * \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++) {
@@ -2251,7 +2251,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 4d26c7e54dd6ca31f6f72c4910c16a342cc284ef..1b24bc5b0792f203a0ef8440bca5f4e1b1d8768e 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 704ed49b9680d96d5d88a9d3c84e04e38a1c1990..c84de75f0011f0406e4610145bba9ab73aceacac 100644 (file)
@@ -162,7 +162,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 47ee431c8c2a873f125320424ac0e1979b9ca8c4..0f01c7ead7b1c513810dc62c0cbde7177aa7deab 100644 (file)
@@ -34,7 +34,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;
 
@@ -81,7 +81,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 e539f5ea00d0e64de840723475d61734da2f5da3..b8e0432f94f0b520ada9bb5d1abbda3b93c635da 100644 (file)
@@ -408,7 +408,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 bfac1748523560b8b8ca19dd1cf80340dd8f9af2..60f67bac45ea86c0efc015c5e8f904d82c2b5bd8 100644 (file)
@@ -1818,7 +1818,7 @@ static int SCLogTestInit05(void)
 
 #endif /* UNITTESTS */
 
-void SCLogRegisterTests()
+void SCLogRegisterTests(void)
 {
 
 #ifdef UNITTESTS
index e49ec8917ed832b52c1412fbf95844bef31f663e..313ce76d4478d0f3749392ae396ed3f69acacf48 100644 (file)
@@ -346,12 +346,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 0cfb2974ee18a74431a0d37cdf8e551cc56828df..440df7ec6e37fd014b1b9c1fdbae523bd064f026 100644 (file)
@@ -47,7 +47,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 c54e834cc4158d2a3560321fcfb104d1bd5bd458..00f9ef652a3086f8ab63d9a13110b84aff67b83b 100644 (file)
@@ -95,7 +95,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);
@@ -219,7 +219,7 @@ static void SCProfilingListLocks(void)
     fclose(fp);
 }
 
-void LockRecordFreeHash()
+void LockRecordFreeHash(void)
 {
     if (profiling_locks_enabled == 0)
         return;
index 37807f92e89e25d2d07e60ef77807f1e4cbea7ea..4e9145e118b7c8cc796d8fee3aa1cf27a77c923e 100644 (file)
@@ -314,7 +314,7 @@ release:
 /**
  * \brief get the maximum transmissible unit for all devices on the system
  */
-int GetGlobalMTUWin32()
+int GetGlobalMTUWin32(void)
 {
     uint32_t mtu = 0;
 
@@ -1653,7 +1653,7 @@ static int Win32TestStripPcapPrefix(void)
 }
 #endif /* UNITTESTS */
 
-void Win32SyscallRegisterTests()
+void Win32SyscallRegisterTests(void)
 {
 #ifdef UNITTESTS
     UtRegisterTest("Win32TestStripPcapPrefix", Win32TestStripPcapPrefix);