From b1db0ad1ee5283af7ce86e1c3690f424a9801497 Mon Sep 17 00:00:00 2001 From: Matthew Brush Date: Mon, 4 Mar 2013 19:56:12 -0800 Subject: [PATCH] Properly declare parameterless functions as such Also use void in the definitions for consistency. --- src/cfuconf.c | 2 +- src/cfuhash.c | 2 +- src/cfuhash.h | 2 +- src/cfulist.c | 2 +- src/cfulist.h | 2 +- src/cfuopt.c | 2 +- src/cfuopt.h | 2 +- src/cfustring.c | 2 +- src/cfustring.h | 2 +- src/cfutime.c | 2 +- src/cfutime.h | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/cfuconf.c b/src/cfuconf.c index fe05b20..f351074 100644 --- a/src/cfuconf.c +++ b/src/cfuconf.c @@ -78,7 +78,7 @@ typedef struct cfuconf_stack_entry { } cfuconf_stack_entry_t; static cfuconf_t * -cfuconf_new() { +cfuconf_new(void) { cfuconf_t *conf = calloc(1, sizeof(cfuconf_t)); conf->type = libcfu_t_conf; conf->containers = cfuhash_new_with_flags(CFUHASH_IGNORE_CASE); diff --git a/src/cfuhash.c b/src/cfuhash.c index c810c2d..df40c56 100644 --- a/src/cfuhash.c +++ b/src/cfuhash.c @@ -202,7 +202,7 @@ _cfuhash_new(size_t size, u_int32_t flags) { } extern cfuhash_table_t * -cfuhash_new() { +cfuhash_new(void) { return _cfuhash_new(8, CFUHASH_FROZEN_UNTIL_GROWS); } diff --git a/src/cfuhash.h b/src/cfuhash.h index e956179..337b133 100644 --- a/src/cfuhash.h +++ b/src/cfuhash.h @@ -67,7 +67,7 @@ typedef int (*cfuhash_foreach_fn_t)(void *key, size_t key_size, void *data, size void *arg); /* Creates a new hash table. */ -extern cfuhash_table_t * cfuhash_new(); +extern cfuhash_table_t * cfuhash_new(void); /* Creates a new hash table with the specified size (number of * buckets). diff --git a/src/cfulist.c b/src/cfulist.c index a0d2aaf..b9c5b71 100644 --- a/src/cfulist.c +++ b/src/cfulist.c @@ -72,7 +72,7 @@ struct cfulist { }; extern cfulist_t * -cfulist_new() { +cfulist_new(void) { cfulist_t *list = calloc(1, sizeof(cfulist_t)); #ifdef HAVE_PTHREAD_H pthread_mutex_init(&list->mutex, NULL); diff --git a/src/cfulist.h b/src/cfulist.h index 509d3c2..68b85ac 100644 --- a/src/cfulist.h +++ b/src/cfulist.h @@ -63,7 +63,7 @@ typedef void * (*cfulist_map_fn_t)(void *data, size_t data_size, void *arg, typedef void (*cfulist_free_fn_t)(void *data); /* Returns a new list. */ -extern cfulist_t * cfulist_new(); +extern cfulist_t * cfulist_new(void); /* Same as cfulist_new(), but set a function to be called on each * element when the list is destroyed. diff --git a/src/cfuopt.c b/src/cfuopt.c index beac7d4..e8c3db9 100644 --- a/src/cfuopt.c +++ b/src/cfuopt.c @@ -72,7 +72,7 @@ typedef struct cfuopt_list_entry { } cfuopt_list_entry_t; extern cfuopt_t * -cfuopt_new() { +cfuopt_new(void) { cfuopt_t *context = calloc(1, sizeof(cfuopt_t)); context->option_list = cfulist_new(); context->option_map = cfuhash_new(); diff --git a/src/cfuopt.h b/src/cfuopt.h index 82cd5c5..dd4d89f 100644 --- a/src/cfuopt.h +++ b/src/cfuopt.h @@ -45,7 +45,7 @@ CFU_BEGIN_DECLS typedef struct cfuopt_struct cfuopt_t; /* Returns a new options context */ -extern cfuopt_t *cfuopt_new(); +extern cfuopt_t *cfuopt_new(void); /* Adds to the list of known options. */ extern void cfuopt_add_entry(cfuopt_t *context, const char *opt_str, void *arg_data, diff --git a/src/cfustring.c b/src/cfustring.c index edf1c45..64ac86b 100644 --- a/src/cfustring.c +++ b/src/cfustring.c @@ -62,7 +62,7 @@ struct cfustring { }; extern cfustring_t * -cfustring_new() { +cfustring_new(void) { return cfustring_new_with_initial_size(0); } diff --git a/src/cfustring.h b/src/cfustring.h index cfc718e..8a49899 100644 --- a/src/cfustring.h +++ b/src/cfustring.h @@ -47,7 +47,7 @@ CFU_BEGIN_DECLS typedef struct cfustring cfustring_t; /* Returns a new String. */ -extern cfustring_t * cfustring_new(); +extern cfustring_t * cfustring_new(void); /* Returns a new String, but preallocates a buffer of the given size. */ extern cfustring_t * cfustring_new_with_initial_size(size_t initial_size); diff --git a/src/cfutime.c b/src/cfutime.c index d501b18..cfd7c55 100644 --- a/src/cfutime.c +++ b/src/cfutime.c @@ -51,7 +51,7 @@ typedef struct cfutime { } cfutime; extern cfutime_t * -cfutime_new() { +cfutime_new(void) { cfutime_t *time = calloc(1, sizeof(cfutime)); time->type = libcfu_t_time; return time; diff --git a/src/cfutime.h b/src/cfutime.h index ae34466..d2fe82a 100644 --- a/src/cfutime.h +++ b/src/cfutime.h @@ -45,7 +45,7 @@ CFU_BEGIN_DECLS typedef struct cfutime cfutime_t; /* Return a new cfutime structure. */ -extern cfutime_t *cfutime_new(); +extern cfutime_t *cfutime_new(void); /* Start the timer. */ extern void cfutime_begin(cfutime_t *time);