diff --git a/bandb/bantool.c b/bandb/bantool.c index 3496b423..2c385f02 100644 --- a/bandb/bantool.c +++ b/bandb/bantool.c @@ -743,7 +743,7 @@ check_schema(void) NULL }; - for(i = 0; i < LAST_BANDB_TYPE; i++) + for(i = 0; i < LAST_BANDB_TYPE; i += 2 /* skip over _PERM */) { if(!table_exists(bandb_table[i])) { @@ -770,8 +770,6 @@ check_schema(void) columns[j], type); } } - - i++; /* skip over .perm */ } } @@ -816,10 +814,9 @@ wipe_schema(void) { int i; rsdb_transaction(RSDB_TRANS_START); - for(i = 0; i < LAST_BANDB_TYPE; i++) + for(i = 0; i < LAST_BANDB_TYPE; i += 2 /* double increment to skip over _PERM */) { rsdb_exec(NULL, "DROP TABLE %s", bandb_table[i]); - i++; /* double increment to skip over .perm */ } rsdb_transaction(RSDB_TRANS_END); diff --git a/librb/src/balloc.c b/librb/src/balloc.c index 2cbe4350..6f761190 100644 --- a/librb/src/balloc.c +++ b/librb/src/balloc.c @@ -248,7 +248,7 @@ rb_bh_destroy(rb_bh *bh) } void -rb_bh_usage(rb_bh *bh, size_t *bused, size_t *bfree, size_t *bmemusage, const char **desc) +rb_bh_usage(rb_bh *bh __attribute__((unused)), size_t *bused, size_t *bfree, size_t *bmemusage, const char **desc) { if(bused != NULL) *bused = 0; diff --git a/librb/src/commio.c b/librb/src/commio.c index ffd1a44a..c3f4d122 100644 --- a/librb/src/commio.c +++ b/librb/src/commio.c @@ -312,7 +312,7 @@ rb_settimeout(rb_fde_t *F, time_t timeout, PF * callback, void *cbdata) * this will happen. */ void -rb_checktimeouts(void *notused) +rb_checktimeouts(void *notused __attribute__((unused))) { rb_dlink_node *ptr, *next; struct timeout_data *td; @@ -514,7 +514,7 @@ rb_inet_get_proto(rb_fde_t *F) return IPPROTO_TCP; } -static void rb_accept_tryaccept(rb_fde_t *F, void *data) { +static void rb_accept_tryaccept(rb_fde_t *F, void *data __attribute__((unused))) { struct rb_sockaddr_storage st; rb_fde_t *new_F; rb_socklen_t addrlen; @@ -772,14 +772,14 @@ rb_connect_callback(rb_fde_t *F, int status) * called .. */ static void -rb_connect_timeout(rb_fde_t *F, void *notused) +rb_connect_timeout(rb_fde_t *F, void *notused __attribute__((unused))) { /* error! */ rb_connect_callback(F, RB_ERR_TIMEOUT); } static void -rb_connect_outcome(rb_fde_t *F, void *notused) +rb_connect_outcome(rb_fde_t *F, void *notused __attribute__((unused))) { int retval; int err = 0; @@ -2448,7 +2448,7 @@ rb_recv_fd_buf(rb_fde_t *F, void *data, size_t datasize, rb_fde_t **xF, int nfds int -rb_send_fd_buf(rb_fde_t *xF, rb_fde_t **F, int count, void *data, size_t datasize, pid_t pid) +rb_send_fd_buf(rb_fde_t *xF, rb_fde_t **F, int count, void *data, size_t datasize, pid_t pid __attribute__((unused))) { struct msghdr msg; struct cmsghdr *cmsg; diff --git a/librb/src/devpoll.c b/librb/src/devpoll.c index 06d34ec0..d66209d5 100644 --- a/librb/src/devpoll.c +++ b/librb/src/devpoll.c @@ -277,21 +277,21 @@ rb_init_netio_devpoll(void) } void -rb_setselect_devpoll(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_devpoll(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_devpoll(long delay) +rb_select_devpoll(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_devpoll(rb_fde_t *F) +rb_setup_fd_devpoll(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1; diff --git a/librb/src/dictionary.c b/librb/src/dictionary.c index 8aa54fcd..f09aebe2 100644 --- a/librb/src/dictionary.c +++ b/librb/src/dictionary.c @@ -586,7 +586,7 @@ void rb_dictionary_foreach_start(rb_dictionary *dtree, * Side Effects: * - none */ -void *rb_dictionary_foreach_cur(rb_dictionary *dtree, +void *rb_dictionary_foreach_cur(rb_dictionary *dtree __attribute__((unused)), rb_dictionary_iter *state) { lrb_assert(dtree != NULL); diff --git a/librb/src/epoll.c b/librb/src/epoll.c index 9af4bc67..b8c902d3 100644 --- a/librb/src/epoll.c +++ b/librb/src/epoll.c @@ -84,7 +84,7 @@ rb_init_netio_epoll(void) } int -rb_setup_fd_epoll(rb_fde_t *F) +rb_setup_fd_epoll(rb_fde_t *F __attribute__((unused))) { return 0; } @@ -326,7 +326,7 @@ struct our_signalfd_siginfo #define SIGFDIOV_COUNT 16 static void -signalfd_handler(rb_fde_t *F, void *data) +signalfd_handler(rb_fde_t *F, void *data __attribute__((unused))) { static struct our_signalfd_siginfo fdsig[SIGFDIOV_COUNT]; static struct iovec iov[SIGFDIOV_COUNT]; @@ -533,21 +533,21 @@ rb_init_netio_epoll(void) } void -rb_setselect_epoll(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_epoll(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_epoll(long delay) +rb_select_epoll(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_epoll(rb_fde_t *F) +rb_setup_fd_epoll(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1; @@ -564,14 +564,14 @@ rb_epoll_init_event(void) } int -rb_epoll_sched_event(struct ev_entry *event, int when) +rb_epoll_sched_event(struct ev_entry *event __attribute__((unused)), int when __attribute__((unused))) { errno = ENOSYS; return -1; } void -rb_epoll_unsched_event(struct ev_entry *event) +rb_epoll_unsched_event(struct ev_entry *event __attribute__((unused))) { return; } diff --git a/librb/src/helper.c b/librb/src/helper.c index 3a39ca10..11d47358 100644 --- a/librb/src/helper.c +++ b/librb/src/helper.c @@ -242,7 +242,7 @@ rb_helper_write(rb_helper *helper, const char *format, ...) } static void -rb_helper_read_cb(rb_fde_t *F, void *data) +rb_helper_read_cb(rb_fde_t *F __attribute__((unused)), void *data) { rb_helper *helper = (rb_helper *)data; static char buf[32768]; diff --git a/librb/src/kqueue.c b/librb/src/kqueue.c index 74f1bf34..2768bc62 100644 --- a/librb/src/kqueue.c +++ b/librb/src/kqueue.c @@ -358,21 +358,21 @@ rb_init_netio_kqueue(void) } void -rb_setselect_kqueue(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_kqueue(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_kqueue(long delay) +rb_select_kqueue(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_kqueue(rb_fde_t *F) +rb_setup_fd_kqueue(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1; @@ -388,14 +388,14 @@ rb_kqueue_init_event(void) } int -rb_kqueue_sched_event(struct ev_entry *event, int when) +rb_kqueue_sched_event(struct ev_entry *event __attribute__((unused)), int when __attribute__((unused))) { errno = ENOSYS; return -1; } void -rb_kqueue_unsched_event(struct ev_entry *event) +rb_kqueue_unsched_event(struct ev_entry *event __attribute__((unused))) { return; } diff --git a/librb/src/nossl.c b/librb/src/nossl.c index 8d1ff67f..e3fe60eb 100644 --- a/librb/src/nossl.c +++ b/librb/src/nossl.c @@ -33,7 +33,7 @@ #include int -rb_setup_ssl_server(const char *cert, const char *keyfile, const char *dhfile, const char *cipher_list) +rb_setup_ssl_server(const char *cert __attribute__((unused)), const char *keyfile __attribute__((unused)), const char *dhfile __attribute__((unused)), const char *cipher_list __attribute__((unused))) { errno = ENOSYS; return 0; @@ -48,21 +48,21 @@ rb_init_ssl(void) } int -rb_ssl_listen(rb_fde_t *F, int backlog, int defer_accept) +rb_ssl_listen(rb_fde_t *F __attribute__((unused)), int backlog __attribute__((unused)), int defer_accept __attribute__((unused))) { errno = ENOSYS; return -1; } static void -rb_stir_arc4random(void *unused) +rb_stir_arc4random(void *unused __attribute__((unused))) { arc4random_stir(); } int -rb_init_prng(const char *path, prng_seed_t seed_type) +rb_init_prng(const char *path __attribute__((unused)), prng_seed_t seed_type __attribute__((unused))) { /* xxx this ignores the parameters above */ arc4random_stir(); @@ -86,39 +86,39 @@ rb_get_random(void *buf, size_t length) } const char * -rb_get_ssl_strerror(rb_fde_t *F) +rb_get_ssl_strerror(rb_fde_t *F __attribute__((unused))) { static const char *nosupport = "SSL/TLS not supported"; return nosupport; } int -rb_get_ssl_certfp(rb_fde_t *F, uint8_t certfp[RB_SSL_CERTFP_LEN], int method) +rb_get_ssl_certfp(rb_fde_t *F __attribute__((unused)), uint8_t certfp[RB_SSL_CERTFP_LEN] __attribute__((unused)), int method __attribute__((unused))) { return 0; } int -rb_get_ssl_certfp_file(const char *filename, uint8_t certfp[RB_SSL_CERTFP_LEN], int method) +rb_get_ssl_certfp_file(const char *filename __attribute__((unused)), uint8_t certfp[RB_SSL_CERTFP_LEN] __attribute__((unused)), int method __attribute__((unused))) { return 0; } void -rb_ssl_start_accepted(rb_fde_t *new_F, ACCB * cb, void *data, int timeout) +rb_ssl_start_accepted(rb_fde_t *new_F __attribute__((unused)), ACCB * cb __attribute__((unused)), void *data __attribute__((unused)), int timeout __attribute__((unused))) { return; } void -rb_ssl_start_connected(rb_fde_t *F, CNCB * callback, void *data, int timeout) +rb_ssl_start_connected(rb_fde_t *F __attribute__((unused)), CNCB * callback __attribute__((unused)), void *data __attribute__((unused)), int timeout __attribute__((unused))) { return; } void -rb_connect_tcp_ssl(rb_fde_t *F, struct sockaddr *dest, - struct sockaddr *clocal, CNCB * callback, void *data, int timeout) +rb_connect_tcp_ssl(rb_fde_t *F __attribute__((unused)), struct sockaddr *dest __attribute__((unused)), + struct sockaddr *clocal __attribute__((unused)), CNCB * callback __attribute__((unused)), void *data __attribute__((unused)), int timeout __attribute__((unused))) { return; } @@ -130,58 +130,58 @@ rb_supports_ssl(void) } void -rb_ssl_shutdown(rb_fde_t *F) +rb_ssl_shutdown(rb_fde_t *F __attribute__((unused))) { return; } void -rb_ssl_accept_setup(rb_fde_t *F, rb_fde_t *new_F, struct sockaddr *st, int addrlen) +rb_ssl_accept_setup(rb_fde_t *F __attribute__((unused)), rb_fde_t *new_F __attribute__((unused)), struct sockaddr *st __attribute__((unused)), int addrlen __attribute__((unused))) { return; } ssize_t -rb_ssl_read(rb_fde_t *F, void *buf, size_t count) +rb_ssl_read(rb_fde_t *F __attribute__((unused)), void *buf __attribute__((unused)), size_t count __attribute__((unused))) { errno = ENOSYS; return -1; } ssize_t -rb_ssl_write(rb_fde_t *F, const void *buf, size_t count) +rb_ssl_write(rb_fde_t *F __attribute__((unused)), const void *buf __attribute__((unused)), size_t count __attribute__((unused))) { errno = ENOSYS; return -1; } unsigned int -rb_ssl_handshake_count(rb_fde_t *F) +rb_ssl_handshake_count(rb_fde_t *F __attribute__((unused))) { return 0; } void -rb_ssl_clear_handshake_count(rb_fde_t *F) +rb_ssl_clear_handshake_count(rb_fde_t *F __attribute__((unused))) { return; } void -rb_get_ssl_info(char *buf, size_t len) +rb_get_ssl_info(char *buf __attribute__((unused)), size_t len __attribute__((unused))) { snprintf(buf, len, "Not compiled with SSL support"); } int -rb_ssl_get_certfp(rb_fde_t *F, uint8_t certfp[RB_SSL_CERTFP_LEN]) +rb_ssl_get_certfp(rb_fde_t *F __attribute__((unused)), uint8_t certfp[RB_SSL_CERTFP_LEN] __attribute__((unused))) { errno = ENOSYS; return -1; } const char * -rb_ssl_get_cipher(rb_fde_t *F) +rb_ssl_get_cipher(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return NULL; diff --git a/librb/src/openssl.c b/librb/src/openssl.c index b01aa5df..b2f179a1 100644 --- a/librb/src/openssl.c +++ b/librb/src/openssl.c @@ -100,7 +100,7 @@ rb_ssl_init_fd(rb_fde_t *const F, const rb_fd_tls_direction dir) } static void -rb_ssl_accept_common(rb_fde_t *const F, void *const data) +rb_ssl_accept_common(rb_fde_t *const F, void *const data __attribute__((unused))) { lrb_assert(F != NULL); lrb_assert(F->accept != NULL); @@ -191,7 +191,7 @@ rb_ssl_strerror(const unsigned long err) } static int -verify_accept_all_cb(const int preverify_ok, X509_STORE_CTX *const x509_ctx) +verify_accept_all_cb(const int preverify_ok __attribute__((unused)), X509_STORE_CTX *const x509_ctx __attribute__((unused))) { return 1; } @@ -635,7 +635,7 @@ rb_ssl_connect_realcb(rb_fde_t *const F, const int status, struct ssl_connect *c } static void -rb_ssl_timeout_cb(rb_fde_t *const F, void *const data) +rb_ssl_timeout_cb(rb_fde_t *const F, void *const data __attribute__((unused))) { lrb_assert(F->accept != NULL); lrb_assert(F->accept->callback != NULL); diff --git a/librb/src/poll.c b/librb/src/poll.c index 0356776c..39aab6ed 100644 --- a/librb/src/poll.c +++ b/librb/src/poll.c @@ -51,7 +51,7 @@ typedef struct _pollfd_list pollfd_list_t; static pollfd_list_t pollfd_list; int -rb_setup_fd_poll(rb_fde_t *F) +rb_setup_fd_poll(rb_fde_t *F __attribute__((unused))) { return 0; } @@ -238,21 +238,21 @@ rb_init_netio_poll(void) } void -rb_setselect_poll(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_poll(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_poll(long delay) +rb_select_poll(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_poll(rb_fde_t *F) +rb_setup_fd_poll(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1; diff --git a/librb/src/ports.c b/librb/src/ports.c index ba12e5a4..ae80665d 100644 --- a/librb/src/ports.c +++ b/librb/src/ports.c @@ -242,14 +242,14 @@ rb_ports_init_event(void) } int -rb_ports_sched_event(struct ev_entry *event, int when) +rb_ports_sched_event(struct ev_entry *event __attribute__((unused)), int when __attribute__((unused))) { errno = ENOSYS; return -1; } void -rb_ports_unsched_event(struct ev_entry *event) +rb_ports_unsched_event(struct ev_entry *event __attribute__((unused))) { return; } @@ -261,21 +261,21 @@ rb_init_netio_ports(void) } void -rb_setselect_ports(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_ports(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_ports(long delay) +rb_select_ports(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_ports(rb_fde_t *F) +rb_setup_fd_ports(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1; diff --git a/librb/src/select.c b/librb/src/select.c index 61d464a4..9fca6bc2 100644 --- a/librb/src/select.c +++ b/librb/src/select.c @@ -120,7 +120,7 @@ select_update_selectfds(rb_fde_t *F, short event, PF * handler) /* Public functions */ int -rb_setup_fd_select(rb_fde_t *F) +rb_setup_fd_select(rb_fde_t *F __attribute__((unused))) { return 0; } @@ -253,21 +253,21 @@ rb_init_netio_select(void) } void -rb_setselect_select(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_select(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_select(long delay) +rb_select_select(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_select(rb_fde_t *F) +rb_setup_fd_select(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1; diff --git a/librb/src/sigio.c b/librb/src/sigio.c index 0c484626..e6ccf73d 100644 --- a/librb/src/sigio.c +++ b/librb/src/sigio.c @@ -487,14 +487,14 @@ rb_sigio_init_event(void) } int -rb_sigio_sched_event(struct ev_entry *event, int when) +rb_sigio_sched_event(struct ev_entry *event __attribute__((unused)), int when __attribute__((unused))) { errno = ENOSYS; return -1; } void -rb_sigio_unsched_event(struct ev_entry *event) +rb_sigio_unsched_event(struct ev_entry *event __attribute__((unused))) { return; } diff --git a/librb/src/win32.c b/librb/src/win32.c index 3dc23a40..a321d58f 100644 --- a/librb/src/win32.c +++ b/librb/src/win32.c @@ -623,21 +623,21 @@ rb_init_netio_win32(void) } void -rb_setselect_win32(rb_fde_t *F, unsigned int type, PF * handler, void *client_data) +rb_setselect_win32(rb_fde_t *F __attribute__((unused)), unsigned int type __attribute__((unused)), PF * handler __attribute__((unused)), void *client_data __attribute__((unused))) { errno = ENOSYS; return; } int -rb_select_win32(long delay) +rb_select_win32(long delay __attribute__((unused))) { errno = ENOSYS; return -1; } int -rb_setup_fd_win32(rb_fde_t *F) +rb_setup_fd_win32(rb_fde_t *F __attribute__((unused))) { errno = ENOSYS; return -1;