Skip to content

Commit

Permalink
*/*: fix invalid prototypes.
Browse files Browse the repository at this point in the history
Prototypes (or the declarations themselves, if there is no
corresponding prototype) for functions that take no arguments are
required by the C standard to specify (void) as their argument list;
for example,

  regex_pcre.h:79:1: error: function declaration isn't a prototype
  [-Werror=strict-prototypes]
     79 | cl_error_t cli_pcre_init_internal();

Future versions of clang may become strict about this, and there's no
harm in conforming to the standard right now, so we fix all such
instances in this commit.
  • Loading branch information
orlitzky authored and val-ms committed May 23, 2023
1 parent 4f076d3 commit d0179cc
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion clamonacc/clamonacc.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
pthread_t ddd_pid = 0;
pthread_t scan_queue_pid = 0;

static void onas_handle_signals();
static void onas_handle_signals(void);
static int startup_checks(struct onas_context *ctx);
static struct onas_context *g_ctx = NULL;

Expand Down
2 changes: 1 addition & 1 deletion clamonacc/client/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ struct onas_sock_t {
};

cl_error_t onas_set_sock_only_once(struct onas_context *ctx);
int onas_get_sockd();
int onas_get_sockd(void);
2 changes: 1 addition & 1 deletion clamonacc/inotif/hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

#if defined(HAVE_SYS_FANOTIFY_H)

static struct onas_bucket *onas_bucket_init();
static struct onas_bucket *onas_bucket_init(void);
static void onas_free_bucket(struct onas_bucket *bckt);
static int onas_bucket_insert(struct onas_bucket *bckt, struct onas_element *elem);
static int onas_bucket_remove(struct onas_bucket *bckt, struct onas_element *elem);
Expand Down
2 changes: 1 addition & 1 deletion clamonacc/inotif/inotif.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

static int onas_ddd_init_ht(uint32_t ht_size);
static int onas_ddd_init_wdlt(uint64_t nwatches);
static int onas_ddd_grow_wdlt();
static int onas_ddd_grow_wdlt(void);

static int onas_ddd_watch(const char *pathname, int fan_fd, uint64_t fan_mask, int in_fd, uint64_t in_mask);
static int onas_ddd_watch_hierarchy(const char *pathname, size_t len, int fd, uint64_t mask, uint32_t type);
Expand Down
6 changes: 3 additions & 3 deletions clamonacc/scan/onas_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static cl_error_t onas_new_event_queue_node(struct onas_event_queue_node **node)
return CL_SUCCESS;
}

static void *onas_init_event_queue()
static void *onas_init_event_queue(void)
{

if (CL_EMEM == onas_new_event_queue_node(&g_onas_event_queue_head)) {
Expand Down Expand Up @@ -122,7 +122,7 @@ static void onas_destroy_event_queue_node(struct onas_event_queue_node *node)
return;
}

static void onas_destroy_event_queue()
static void onas_destroy_event_queue(void)
{

if (NULL == g_onas_event_queue_head) {
Expand Down Expand Up @@ -200,7 +200,7 @@ void *onas_scan_queue_th(void *arg)
pthread_cleanup_pop(1);
}

static int onas_queue_is_b_empty()
static int onas_queue_is_b_empty(void)
{

if (g_onas_event_queue.head->next == g_onas_event_queue.tail) {
Expand Down
6 changes: 3 additions & 3 deletions libclamav/matcher-pcre.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ struct cli_pcre_meta {
};

/* PCRE PERFORMANCE DECLARATIONS */
void cli_pcre_perf_print();
void cli_pcre_perf_events_destroy();
void cli_pcre_perf_print(void);
void cli_pcre_perf_events_destroy(void);

/* PCRE MATCHER DECLARATIONS */
int cli_pcre_init();
int cli_pcre_init(void);
cl_error_t cli_pcre_addpatt(struct cli_matcher *root, const char *virname, const char *trigger, const char *pattern, const char *cflags, const char *offset, const uint32_t *lsigid, unsigned int options);
cl_error_t cli_pcre_build(struct cli_matcher *root, long long unsigned match_limit, long long unsigned recmatch_limit, const struct cli_dconf *dconf);
cl_error_t cli_pcre_recaloff(struct cli_matcher *root, struct cli_pcre_off *data, struct cli_target_info *info, cli_ctx *ctx);
Expand Down
2 changes: 1 addition & 1 deletion libclamav/regex_pcre.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct cli_pcre_results {
};
#endif

cl_error_t cli_pcre_init_internal();
cl_error_t cli_pcre_init_internal(void);
cl_error_t cli_pcre_addoptions(struct cli_pcre_data *pd, const char **opt, int errout);
cl_error_t cli_pcre_compile(struct cli_pcre_data *pd, long long unsigned match_limit, long long unsigned match_limit_recursion, unsigned int options, int opt_override);
int cli_pcre_match(struct cli_pcre_data *pd, const unsigned char *buffer, size_t buflen, size_t override_offset, int options, struct cli_pcre_results *results);
Expand Down
2 changes: 1 addition & 1 deletion m4/reorganization/compiler_checks.m4
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ extern void abort(void);
((bb_size) > 0 && (sb_size) > 0 && (size_t)(sb_size) <= (size_t)(bb_size) \
&& (sb) >= (bb) && ((sb) + (sb_size)) <= ((bb) + (bb_size)) && ((sb) + (sb_size)) > (bb) && (sb) < ((bb) + (bb_size)))
int crashtest()
int crashtest(void)
{
unsigned int backsize, dcur;
int dval=0x12000, unp_offset;
Expand Down
2 changes: 1 addition & 1 deletion shared/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int daemonize(void);
/*closes stdin, stdout, stderr. This is called by daemonize, but not
* daemonize_all_return. Users of daemonize_all_return should call this
* when initialization is complete.*/
int close_std_descriptors();
int close_std_descriptors(void);

/*Returns the return value of fork. All processes return */
int daemonize_all_return(void);
Expand Down

0 comments on commit d0179cc

Please sign in to comment.