- Fix missing prototypes in the code.

This commit is contained in:
W.C.A. Wijngaards 2020-12-11 14:34:39 +01:00
parent e1c678864d
commit 811cf6db0c
11 changed files with 39 additions and 13 deletions

View file

@ -727,7 +727,7 @@ static ssize_t tap_receive(struct tap_data* data, void* buf, size_t len)
} }
/** delete the tap structure */ /** 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_del(data->ev);
ub_event_free(data->ev); ub_event_free(data->ev);
@ -1355,6 +1355,10 @@ int main(int argc, char** argv)
struct tube; struct tube;
struct query_info; struct query_info;
#include "util/data/packed_rrset.h" #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), void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len), uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),

View file

@ -6,6 +6,7 @@
missing prototype warnings. missing prototype warnings.
- Merge PR #373 from fobser: Warning: arithmetic on a pointer to void - Merge PR #373 from fobser: Warning: arithmetic on a pointer to void
is a GNU extension. is a GNU extension.
- Fix missing prototypes in the code.
3 December 2020: Wouter 3 December 2020: Wouter
- make depend. - make depend.

View file

@ -5,16 +5,16 @@
* module actions. * module actions.
*/ */
#include "config.h" #include "config.h"
#include "dynlibmod/dynlibmod.h"
#include "util/module.h" #include "util/module.h"
#include "util/config_file.h" #include "util/config_file.h"
#include "dynlibmod/dynlibmod.h"
#if HAVE_WINDOWS_H #if HAVE_WINDOWS_H
#include <windows.h> #include <windows.h>
#define __DYNMOD HMODULE #define __DYNMOD HMODULE
#define __DYNSYM FARPROC #define __DYNSYM FARPROC
#define __LOADSYM GetProcAddress #define __LOADSYM GetProcAddress
void log_dlerror() { static void log_dlerror() {
DWORD dwLastError = GetLastError(); DWORD dwLastError = GetLastError();
LPSTR MessageBuffer; LPSTR MessageBuffer;
DWORD dwBufferLength; 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); return LoadLibrary(fname);
} }
void close_library(const char* fname, __DYNMOD handle) { static void close_library(const char* fname, __DYNMOD handle) {
(void)fname; (void)fname;
(void)handle; (void)handle;
} }
@ -50,15 +50,15 @@ void close_library(const char* fname, __DYNMOD handle) {
#define __DYNMOD void* #define __DYNMOD void*
#define __DYNSYM void* #define __DYNSYM void*
#define __LOADSYM dlsym #define __LOADSYM dlsym
void log_dlerror() { static void log_dlerror() {
log_err("dynlibmod: %s", 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); 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(!handle) return;
if(dlclose(handle) != 0) { if(dlclose(handle) != 0) {
log_err("dlclose %s: %s", fname, strerror(errno)); log_err("dlclose %s: %s", fname, strerror(errno));

View file

@ -73,6 +73,9 @@
#include "iterator/iter_hints.h" #include "iterator/iter_hints.h"
#include "sldns/sbuffer.h" #include "sldns/sbuffer.h"
#include "sldns/str2wire.h" #include "sldns/str2wire.h"
#ifdef USE_DNSTAP
#include "dnstap/dtstream.h"
#endif
#ifdef HAVE_TARGETCONDITIONALS_H #ifdef HAVE_TARGETCONDITIONALS_H
#include <TargetConditionals.h> #include <TargetConditionals.h>

View file

@ -39,6 +39,7 @@
* conversions. * conversions.
*/ */
#include "config.h" #include "config.h"
#include "pythonmod/pythonmod_utils.h"
#include "util/module.h" #include "util/module.h"
#include "util/netevent.h" #include "util/netevent.h"
#include "util/net_help.h" #include "util/net_help.h"

View file

@ -43,6 +43,7 @@
#include "util/module.h" #include "util/module.h"
struct delegpt_addr; struct delegpt_addr;
struct sldns_buffer;
/** /**
* Store the reply_info and query_info pair in message cache (qstate->msg_cache) * 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 * @param pkt: a sldns_buffer which contains sldns_packet data
* @return 0 on failure, out of memory or parse error. * @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 * Convert reply->addr to string

View 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; nghttp2_session_callbacks *callbacks;
if(nghttp2_session_callbacks_new(&callbacks) == NGHTTP2_ERR_NOMEM) { if(nghttp2_session_callbacks_new(&callbacks) == NGHTTP2_ERR_NOMEM) {

View file

@ -404,7 +404,7 @@ size_t http2_get_response_buffer_size(void);
* Create nghttp2 callbacks to handle HTTP2 requests. * Create nghttp2 callbacks to handle HTTP2 requests.
* @return malloc'ed struct, NULL on failure * @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 */ /** Free http2 stream buffers and decrease buffer counters */
void http2_req_stream_clear(struct http2_stream* h2_stream); void http2_req_stream_clear(struct http2_stream* h2_stream);

View file

@ -46,6 +46,9 @@
#include "util/fptr_wlist.h" #include "util/fptr_wlist.h"
#include "util/log.h" #include "util/log.h"
#include "services/mesh.h" #include "services/mesh.h"
#ifdef USE_DNSTAP
#include "dnstap/dtstream.h"
#endif
void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube), void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube),
uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len), uint8_t* ATTR_UNUSED(buffer), size_t ATTR_UNUSED(len),

View file

@ -64,6 +64,7 @@
#include "sldns/sbuffer.h" #include "sldns/sbuffer.h"
#include "sldns/wire2str.h" #include "sldns/wire2str.h"
#include "sldns/str2wire.h" #include "sldns/str2wire.h"
#include "daemon/remote.h"
#include <signal.h> #include <signal.h>
struct worker; struct worker;
struct daemon_remote; struct daemon_remote;

View file

@ -42,16 +42,22 @@
#ifdef HAVE_TIME_H #ifdef HAVE_TIME_H
# include <time.h> # include <time.h>
#endif #endif
#include <ctype.h>
#include "testcode/testpkts.h" #include "testcode/testpkts.h"
#include "testcode/replay.h" #include "testcode/replay.h"
#include "testcode/fake_event.h" #include "testcode/fake_event.h"
#include "daemon/remote.h" #include "daemon/remote.h"
#include "libunbound/worker.h"
#include "util/config_file.h" #include "util/config_file.h"
#include "sldns/keyraw.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 */ /** signal that this is a testbound compile */
#define unbound_testbound 1 #define unbound_testbound 1
/** renamed main routine */
int daemon_main(int argc, char* argv[]);
/** /**
* include the main program from the unbound daemon. * include the main program from the unbound daemon.
* rename main to daemon_main to call it * 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 */ /** remove config file at exit */
void remove_configfile(void) static void remove_configfile(void)
{ {
struct config_strlist* p; struct config_strlist* p;
for(p=cfgfiles; p; p=p->next) 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); log_assert(0);
} }
#ifdef UB_ON_WINDOWS
void wsvc_command_option(const char* ATTR_UNUSED(wopt), void wsvc_command_option(const char* ATTR_UNUSED(wopt),
const char* ATTR_UNUSED(cfgfile), int ATTR_UNUSED(v), const char* ATTR_UNUSED(cfgfile), int ATTR_UNUSED(v),
int ATTR_UNUSED(c)) int ATTR_UNUSED(c))
{ {
log_assert(0); log_assert(0);
} }
#endif
#ifdef UB_ON_WINDOWS
void wsvc_setup_worker(struct worker* ATTR_UNUSED(worker)) void wsvc_setup_worker(struct worker* ATTR_UNUSED(worker))
{ {
/* do nothing */ /* do nothing */
} }
#endif
#ifdef UB_ON_WINDOWS
void wsvc_desetup_worker(struct worker* ATTR_UNUSED(worker)) void wsvc_desetup_worker(struct worker* ATTR_UNUSED(worker))
{ {
/* do nothing */ /* do nothing */
} }
#endif
#ifdef UB_ON_WINDOWS #ifdef UB_ON_WINDOWS
void worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev), void worker_win_stop_cb(int ATTR_UNUSED(fd), short ATTR_UNUSED(ev),