]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix missing prototypes in the code.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Dec 2020 13:34:39 +0000 (14:34 +0100)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 11 Dec 2020 13:34:39 +0000 (14:34 +0100)
dnstap/unbound-dnstap-socket.c
doc/Changelog
dynlibmod/dynlibmod.c
libunbound/libworker.c
pythonmod/pythonmod_utils.c
pythonmod/pythonmod_utils.h
services/listen_dnsport.c
services/listen_dnsport.h
smallapp/worker_cb.c
testcode/fake_event.c
testcode/testbound.c

index 8c37654e827d56c764c2fae59367705fbe5ca18a..8e28be4e89ecfbd78131f956dd4ab653e2948f4c 100644 (file)
@@ -727,7 +727,7 @@ static ssize_t tap_receive(struct tap_data* data, void* buf, size_t len)
 }
 
 /** delete the tap structure */
-void tap_data_free(struct tap_data* data)
+static void tap_data_free(struct tap_data* data)
 {
        ub_event_del(data->ev);
        ub_event_free(data->ev);
@@ -1355,6 +1355,10 @@ int main(int argc, char** argv)
 struct tube;
 struct query_info;
 #include "util/data/packed_rrset.h"
+#include "daemon/worker.h"
+#include "daemon/remote.h"
+#include "util/fptr_wlist.h"
+#include "libunbound/context.h"
 
 void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
        uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
index dc4dee115de2b6f4c838a5eb557224f52a1b3991..07a8e6ea4e95b79536bfa67919a49cdd4ad3e594 100644 (file)
@@ -6,6 +6,7 @@
          missing prototype warnings.
        - Merge PR #373 from fobser: Warning: arithmetic on a pointer to void
          is a GNU extension.
+       - Fix missing prototypes in the code.
 
 3 December 2020: Wouter
        - make depend.
index 3bf9d1acb0b858ea86e9607f8a477c87a74d4b28..3f148ebb64871c85ab5e97028d1a42ad4c88c993 100644 (file)
@@ -5,16 +5,16 @@
  * module actions.
  */
 #include "config.h"
+#include "dynlibmod/dynlibmod.h"
 #include "util/module.h"
 #include "util/config_file.h"
-#include "dynlibmod/dynlibmod.h"
 
 #if HAVE_WINDOWS_H
 #include <windows.h>
 #define __DYNMOD HMODULE
 #define __DYNSYM FARPROC
 #define __LOADSYM GetProcAddress
-void log_dlerror() {
+static void log_dlerror() {
     DWORD dwLastError = GetLastError();
     LPSTR MessageBuffer;
     DWORD dwBufferLength;
@@ -37,11 +37,11 @@ void log_dlerror() {
 
 }
 
-HMODULE open_library(const char* fname) {
+static HMODULE open_library(const char* fname) {
     return LoadLibrary(fname);
 }
 
-void close_library(const char* fname, __DYNMOD handle) {
+static void close_library(const char* fname, __DYNMOD handle) {
        (void)fname;
        (void)handle;
 }
@@ -50,15 +50,15 @@ void close_library(const char* fname, __DYNMOD handle) {
 #define __DYNMOD void*
 #define __DYNSYM void*
 #define __LOADSYM dlsym
-void log_dlerror() {
+static void log_dlerror() {
     log_err("dynlibmod: %s", dlerror());
 }
 
-void* open_library(const char* fname) {
+static void* open_library(const char* fname) {
     return dlopen(fname, RTLD_LAZY | RTLD_GLOBAL);
 }
 
-void close_library(const char* fname, __DYNMOD handle) {
+static void close_library(const char* fname, __DYNMOD handle) {
        if(!handle) return;
        if(dlclose(handle) != 0) {
                log_err("dlclose %s: %s", fname, strerror(errno));
index 06cbb8869f61c80a8bc94f89bb9cd60d44d47d40..03bbaf7686c548205a375658284773d1751eef02 100644 (file)
@@ -73,6 +73,9 @@
 #include "iterator/iter_hints.h"
 #include "sldns/sbuffer.h"
 #include "sldns/str2wire.h"
+#ifdef USE_DNSTAP
+#include "dnstap/dtstream.h"
+#endif
 
 #ifdef HAVE_TARGETCONDITIONALS_H
 #include <TargetConditionals.h>
index 5d70f2b4bc0437540f538776dd0d753f3ab0b203..9f7282540e77ce1bdca5649063eb5c1f921ed0fc 100644 (file)
@@ -39,6 +39,7 @@
  * conversions.
  */
 #include "config.h"
+#include "pythonmod/pythonmod_utils.h"
 #include "util/module.h"
 #include "util/netevent.h"
 #include "util/net_help.h"
index 768eb46de6ac9253d96d78e484668b6c29880af4..4ea86f9bee4c5ce3e5afb66fa87a4098675c76d4 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "util/module.h"
 struct delegpt_addr;
+struct sldns_buffer;
 
 /**
  *  Store the reply_info and query_info pair in message cache (qstate->msg_cache)
@@ -77,7 +78,7 @@ void invalidateQueryInCache(struct module_qstate* qstate, struct query_info* qin
  * @param pkt: a sldns_buffer which contains sldns_packet data
  * @return 0 on failure, out of memory or parse error.
  */
-int createResponse(struct module_qstate* qstate, sldns_buffer* pkt);
+int createResponse(struct module_qstate* qstate, struct sldns_buffer* pkt);
 
 /**
  *  Convert reply->addr to string
index 709c9e6ce698b27209d923be2fc8b4ee8ed839d7..629d4de722e4f76742a6a7553ab13360dcd0c2de 100644 (file)
@@ -2793,7 +2793,7 @@ void http2_req_stream_clear(struct http2_stream* h2_stream)
        }
 }
 
-nghttp2_session_callbacks* http2_req_callbacks_create()
+nghttp2_session_callbacks* http2_req_callbacks_create(void)
 {
        nghttp2_session_callbacks *callbacks;
        if(nghttp2_session_callbacks_new(&callbacks) == NGHTTP2_ERR_NOMEM) {
index 9d6ea2c33adfd1f60ecd8d8244c7ab07d3a00b27..f438ff4580f762265d1b9d9ae81b390fb11c916e 100644 (file)
@@ -404,7 +404,7 @@ size_t http2_get_response_buffer_size(void);
  * Create nghttp2 callbacks to handle HTTP2 requests.
  * @return malloc'ed struct, NULL on failure
  */
-nghttp2_session_callbacks* http2_req_callbacks_create();
+nghttp2_session_callbacks* http2_req_callbacks_create(void);
 
 /** Free http2 stream buffers and decrease buffer counters */
 void http2_req_stream_clear(struct http2_stream* h2_stream);
index 78d921a3c6e9755259c9a1e593a5b34926e95977..cdf855dc3659dfe17b9dceccb44962f2d29a1443 100644 (file)
@@ -46,6 +46,9 @@
 #include "util/fptr_wlist.h"
 #include "util/log.h"
 #include "services/mesh.h"
+#ifdef USE_DNSTAP
+#include "dnstap/dtstream.h"
+#endif
 
 void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
        uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),
index 591557c35f12828185bf157ba18ce7703c5fa94d..75a6b8db93185dd473e4f4e05311166a5b13eec3 100644 (file)
@@ -64,6 +64,7 @@
 #include "sldns/sbuffer.h"
 #include "sldns/wire2str.h"
 #include "sldns/str2wire.h"
+#include "daemon/remote.h"
 #include <signal.h>
 struct worker;
 struct daemon_remote;
index 3f3e106b039c2377210f0820fa28690caf10dc9d..5e10779fcdea991e638000c43063985977b807e2 100644 (file)
 #ifdef HAVE_TIME_H
 #  include <time.h>
 #endif
+#include <ctype.h>
 #include "testcode/testpkts.h"
 #include "testcode/replay.h"
 #include "testcode/fake_event.h"
 #include "daemon/remote.h"
+#include "libunbound/worker.h"
 #include "util/config_file.h"
 #include "sldns/keyraw.h"
-#include <ctype.h>
+#ifdef UB_ON_WINDOWS
+#include "winrc/win_svc.h"
+#endif
 
 /** signal that this is a testbound compile */
 #define unbound_testbound 1
+/** renamed main routine */
+int daemon_main(int argc, char* argv[]);
 /** 
  * include the main program from the unbound daemon.
  * rename main to daemon_main to call it
@@ -333,7 +339,7 @@ setup_playback(const char* filename, int* pass_argc, char* pass_argv[])
 }
 
 /** remove config file at exit */
-void remove_configfile(void)
+static void remove_configfile(void)
 {
        struct config_strlist* p;
        for(p=cfgfiles; p; p=p->next)
@@ -551,22 +557,28 @@ void remote_get_opt_ssl(char* ATTR_UNUSED(str), void* ATTR_UNUSED(arg))
         log_assert(0);
 }
 
+#ifdef UB_ON_WINDOWS
 void wsvc_command_option(const char* ATTR_UNUSED(wopt), 
        const char* ATTR_UNUSED(cfgfile), int ATTR_UNUSED(v), 
        int ATTR_UNUSED(c))
 {
        log_assert(0);
 }
+#endif
 
+#ifdef UB_ON_WINDOWS
 void wsvc_setup_worker(struct worker* ATTR_UNUSED(worker))
 {
        /* do nothing */
 }
+#endif
 
+#ifdef UB_ON_WINDOWS
 void wsvc_desetup_worker(struct worker* ATTR_UNUSED(worker))
 {
        /* do nothing */
 }
+#endif
 
 #ifdef UB_ON_WINDOWS
 void worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),