diff --git a/src/bstack.c b/src/bstack.c index c1aa4f3..d49ee86 100644 --- a/src/bstack.c +++ b/src/bstack.c @@ -94,10 +94,9 @@ bstack_drop(bstack_t *q) { if (!q->cc) return; - q->n--; - size_t idx = q->n % q->c; - void *pb = q->b + (idx * q->z); q->cc--; + size_t idx = --q->n % q->c; + void *pb = q->b + (idx * q->z); if (q->rf) q->rf(pb); } @@ -112,7 +111,8 @@ bstack_top(bstack_t *q) return pb; } -size_t bstack_count(bstack_t *q) +size_t +bstack_count(bstack_t *q) { return q->cc; } diff --git a/src/pool.c b/src/pool.c index 1065024..a30426f 100644 --- a/src/pool.c +++ b/src/pool.c @@ -1771,7 +1771,7 @@ rpc_on_block_template(const char* data, rpc_callback_t *callback) } static int -startup_scan_round_shares() +startup_scan_round_shares(void) { int rc = 0; char *err = NULL; @@ -2269,7 +2269,7 @@ fetch_last_block_header(void) } static int -store_last_height_time() +store_last_height_time(void) { int rc = 0; char *err = NULL; @@ -2341,7 +2341,7 @@ trusted_send_balance(client_t *client, const char *address) } static void -upstream_send_ping() +upstream_send_ping(void) { struct evbuffer *output = bufferevent_get_output(upstream_event); char data[9]; @@ -2367,7 +2367,7 @@ upstream_send_account_connect(uint32_t count) } static void -upstream_send_account_disconnect() +upstream_send_account_disconnect(void) { struct evbuffer *output = bufferevent_get_output(upstream_event); char data[9]; @@ -2435,7 +2435,7 @@ upstream_send_client_block(block_t *block) } static void -upstream_send_backlog() +upstream_send_backlog(void) { /* Send any unsent shares and blocks upstream. @@ -2716,7 +2716,7 @@ upstream_on_event(struct bufferevent *bev, short error, void *ctx) } static void -upstream_connect() +upstream_connect(void) { struct addrinfo *info = NULL; int rc = 0; @@ -4030,7 +4030,8 @@ read_config(const char *config_file) } } -static void print_config() +static void +print_config(void) { char display_allowed[MAX_HOST*MAX_DOWNSTREAM] = {0}; if (*config.trusted_allowed[0]) @@ -4063,8 +4064,8 @@ static void print_config() " pool-fee-wallet = %s\n" " pool-start-diff = %"PRIu64"\n" " pool-fixed-diff = %"PRIu64"\n" - " pool-fee = %.3f\n" - " payment-threshold = %.2f\n" + " pool-fee = %g\n" + " payment-threshold = %g\n" " share-mul = %.2f\n" " retarget-time = %u\n" " retarget-ratio = %.2f\n" diff --git a/src/webui.c b/src/webui.c index 9ae93d8..46d7291 100644 --- a/src/webui.c +++ b/src/webui.c @@ -99,8 +99,8 @@ send_json_stats(struct evhttp_request *req, void *arg) "\"last_template_fetched\":%"PRIu64"," "\"last_block_found\":%"PRIu64"," "\"pool_blocks_found\":%d," - "\"payment_threshold\":%.2f," - "\"pool_fee\":%.3f," + "\"payment_threshold\":%g," + "\"pool_fee\":%g," "\"pool_port\":%d," "\"pool_ssl_port\":%d," "\"allow_self_select\":%u,"