Mercurial > dropbear
diff listener.c @ 1461:fb90a5ba84e0
Merge pull request #49 from fperrad/20170812_lint
Some linting, const parameters
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Thu, 25 Jan 2018 21:55:25 +0800 |
parents | 58a74cb829b8 |
children | ce3ce75a6e04 |
line wrap: on
line diff
--- a/listener.c Tue Jan 23 22:44:18 2018 +0800 +++ b/listener.c Thu Jan 25 21:55:25 2018 +0800 @@ -53,7 +53,7 @@ } -void handle_listeners(fd_set * readfds) { +void handle_listeners(const fd_set * readfds) { unsigned int i, j; struct Listener *listener; @@ -76,10 +76,10 @@ /* acceptor(int fd, void* typedata) is a function to accept connections, * cleanup(void* typedata) happens when cleaning up */ -struct Listener* new_listener(int socks[], unsigned int nsocks, +struct Listener* new_listener(const int socks[], unsigned int nsocks, int type, void* typedata, - void (*acceptor)(struct Listener* listener, int sock), - void (*cleanup)(struct Listener*)) { + void (*acceptor)(const struct Listener* listener, int sock), + void (*cleanup)(const struct Listener*)) { unsigned int i, j; struct Listener *newlisten = NULL; @@ -132,8 +132,8 @@ /* Return the first listener which matches the type-specific comparison * function. Particularly needed for global requests, like tcp */ -struct Listener * get_listener(int type, void* typedata, - int (*match)(void*, void*)) { +struct Listener * get_listener(int type, const void* typedata, + int (*match)(const void*, const void*)) { unsigned int i; struct Listener* listener;