git » nmdb » commit 1c02309

Minor fixes to some function prototypes to reflect their static status.

author Alberto Bertogli
2007-03-30 04:47:27 UTC
committer Alberto Bertogli
2007-03-30 04:47:27 UTC
parent 758f64b75d89dc3c2f3445a8e2f2c301116ac249

Minor fixes to some function prototypes to reflect their static status.

sparse showed some static functions that weren't marked so, and some void
arguments missing. Mostly aesthetic, but worth fixing.

libnmdb/libnmdb.c +2 -2
libnmdb/timer.h +2 -2
nmdb/main.c +1 -1
nmdb/net.c +1 -0
nmdb/queue.c +2 -2

diff --git a/libnmdb/libnmdb.c b/libnmdb/libnmdb.c
index ceb7b05..f581169 100644
--- a/libnmdb/libnmdb.c
+++ b/libnmdb/libnmdb.c
@@ -178,7 +178,7 @@ static uint32_t get_rep(nmdb_t *db, struct nmdb_srv *srv,
 }
 
 /* Hash function used internally by select_srv(). See RFC 1071. */
-uint32_t checksum(const unsigned char *buf, size_t bsize)
+static uint32_t checksum(const unsigned char *buf, size_t bsize)
 {
 	uint32_t sum = 0;
 
@@ -375,7 +375,7 @@ int nmdb_cache_set(nmdb_t *db, const unsigned char *key, size_t ksize,
 
 
 
-int do_del(nmdb_t *db, const unsigned char *key, size_t ksize,
+static int do_del(nmdb_t *db, const unsigned char *key, size_t ksize,
 		int impact_db, int async)
 {
 	ssize_t rv, t;
diff --git a/libnmdb/timer.h b/libnmdb/timer.h
index 75315c5..a0a8191 100644
--- a/libnmdb/timer.h
+++ b/libnmdb/timer.h
@@ -25,11 +25,11 @@
 
 static struct timeval tv_s, tv_e;
 
-static void timer_start() {
+static void timer_start(void) {
 	gettimeofday(&tv_s, NULL);
 }
 
-static unsigned long timer_stop() {
+static unsigned long timer_stop(void) {
 	gettimeofday(&tv_e, NULL);
 	return (tv_e.tv_sec - tv_s.tv_sec) * 1000000ul
 		+ (tv_e.tv_usec - tv_s.tv_usec);
diff --git a/nmdb/main.c b/nmdb/main.c
index 2eb2fa2..3e5fb36 100644
--- a/nmdb/main.c
+++ b/nmdb/main.c
@@ -22,7 +22,7 @@ struct cache *cache_table;
 struct queue *op_queue;
 
 
-static void help() {
+static void help(void) {
 	char h[] = \
 	  "nmdb [options]\n"
 	  "  -d dbpath	database path ('database', must be created with dpmgr)\n"
diff --git a/nmdb/net.c b/nmdb/net.c
index ac4ea3d..a679b86 100644
--- a/nmdb/net.c
+++ b/nmdb/net.c
@@ -11,6 +11,7 @@ typedef unsigned char u_char;
 
 #include "common.h"
 #include "tipc.h"
+#include "net.h"
 
 
 static void exit_sighandler(int fd, short event, void *arg)
diff --git a/nmdb/queue.c b/nmdb/queue.c
index 7eeda67..3afbde5 100644
--- a/nmdb/queue.c
+++ b/nmdb/queue.c
@@ -5,7 +5,7 @@
 #include "queue.h"
 
 
-struct queue *queue_create()
+struct queue *queue_create(void)
 {
 	struct queue *q;
 	pthread_mutexattr_t attr;
@@ -66,7 +66,7 @@ int queue_timedwait(struct queue *q, struct timespec *ts)
 }
 
 
-struct queue_entry *queue_entry_create()
+struct queue_entry *queue_entry_create(void)
 {
 	struct queue_entry *e;