Skip to content

Commit

Permalink
FPM fix strict prototype warnings.
Browse files Browse the repository at this point in the history
Closes GH-8986.
  • Loading branch information
devnexen committed Aug 28, 2022
1 parent f866295 commit e2a5428
Show file tree
Hide file tree
Showing 43 changed files with 116 additions and 184 deletions.
8 changes: 3 additions & 5 deletions sapi/fpm/fpm/events/devpoll.c
Expand Up @@ -29,7 +29,7 @@
#include <errno.h>

static int fpm_event_devpoll_init(int max);
static int fpm_event_devpoll_clean();
static int fpm_event_devpoll_clean(void);
static int fpm_event_devpoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout);
static int fpm_event_devpoll_add(struct fpm_event_s *ev);
static int fpm_event_devpoll_remove(struct fpm_event_s *ev);
Expand All @@ -51,15 +51,14 @@ static int npollfds = 0;

#endif /* HAVE_DEVPOLL */

struct fpm_event_module_s *fpm_event_devpoll_module() /* {{{ */
struct fpm_event_module_s *fpm_event_devpoll_module(void)
{
#ifdef HAVE_DEVPOLL
return &devpoll_module;
#else
return NULL;
#endif /* HAVE_DEVPOLL */
}
/* }}} */

#ifdef HAVE_DEVPOLL

Expand Down Expand Up @@ -113,7 +112,7 @@ static int fpm_event_devpoll_init(int max) /* {{{ */
/*
* Clean the module
*/
static int fpm_event_devpoll_clean() /* {{{ */
static int fpm_event_devpoll_clean(void)
{
/* close /dev/poll if open */
if (dpfd > -1) {
Expand All @@ -136,7 +135,6 @@ static int fpm_event_devpoll_clean() /* {{{ */
npollfds = 0;
return 0;
}
/* }}} */

/*
* wait for events or timeout
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/events/devpoll.h
Expand Up @@ -20,6 +20,6 @@
#include "../fpm_config.h"
#include "../fpm_events.h"

struct fpm_event_module_s *fpm_event_devpoll_module();
struct fpm_event_module_s *fpm_event_devpoll_module(void);

#endif /* FPM_EVENTS_DEVPOLL_H */
8 changes: 3 additions & 5 deletions sapi/fpm/fpm/events/epoll.c
Expand Up @@ -25,7 +25,7 @@
#include <errno.h>

static int fpm_event_epoll_init(int max);
static int fpm_event_epoll_clean();
static int fpm_event_epoll_clean(void);
static int fpm_event_epoll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout);
static int fpm_event_epoll_add(struct fpm_event_s *ev);
static int fpm_event_epoll_remove(struct fpm_event_s *ev);
Expand All @@ -46,15 +46,14 @@ static int epollfd = -1;

#endif /* HAVE_EPOLL */

struct fpm_event_module_s *fpm_event_epoll_module() /* {{{ */
struct fpm_event_module_s *fpm_event_epoll_module(void)
{
#ifdef HAVE_EPOLL
return &epoll_module;
#else
return NULL;
#endif /* HAVE_EPOLL */
}
/* }}} */

#ifdef HAVE_EPOLL

Expand Down Expand Up @@ -92,7 +91,7 @@ static int fpm_event_epoll_init(int max) /* {{{ */
/*
* Clean the module
*/
static int fpm_event_epoll_clean() /* {{{ */
static int fpm_event_epoll_clean(void)
{
/* free epollfds */
if (epollfds) {
Expand All @@ -108,7 +107,6 @@ static int fpm_event_epoll_clean() /* {{{ */

return 0;
}
/* }}} */

/*
* wait for events or timeout
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/events/epoll.h
Expand Up @@ -20,6 +20,6 @@
#include "../fpm_config.h"
#include "../fpm_events.h"

struct fpm_event_module_s *fpm_event_epoll_module();
struct fpm_event_module_s *fpm_event_epoll_module(void);

#endif /* FPM_EVENTS_EPOLL_H */
11 changes: 4 additions & 7 deletions sapi/fpm/fpm/events/poll.c
Expand Up @@ -26,7 +26,7 @@
#include <string.h>

static int fpm_event_poll_init(int max);
static int fpm_event_poll_clean();
static int fpm_event_poll_clean(void);
static int fpm_event_poll_wait(struct fpm_event_queue_s *queue, unsigned long int timeout);
static int fpm_event_poll_add(struct fpm_event_s *ev);
static int fpm_event_poll_remove(struct fpm_event_s *ev);
Expand All @@ -50,22 +50,21 @@ static int next_free_slot = 0;
/*
* return the module configuration
*/
struct fpm_event_module_s *fpm_event_poll_module() /* {{{ */
struct fpm_event_module_s *fpm_event_poll_module(void)
{
#ifdef HAVE_POLL
return &poll_module;
#else
return NULL;
#endif /* HAVE_POLL */
}
/* }}} */

#ifdef HAVE_POLL

/*
* Init the module
*/
static int fpm_event_poll_init(int max) /* {{{ */
static int fpm_event_poll_init(int max)
{
int i;

Expand Down Expand Up @@ -99,12 +98,11 @@ static int fpm_event_poll_init(int max) /* {{{ */
npollfds = max;
return 0;
}
/* }}} */

/*
* Clean the module
*/
static int fpm_event_poll_clean() /* {{{ */
static int fpm_event_poll_clean(void)
{
/* free pollfds */
if (pollfds) {
Expand All @@ -121,7 +119,6 @@ static int fpm_event_poll_clean() /* {{{ */
npollfds = 0;
return 0;
}
/* }}} */

/*
* wait for events or timeout
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/events/poll.h
Expand Up @@ -20,6 +20,6 @@
#include "../fpm_config.h"
#include "../fpm_events.h"

struct fpm_event_module_s *fpm_event_poll_module();
struct fpm_event_module_s *fpm_event_poll_module(void);

#endif /* FPM_EVENTS_POLL_H */
5 changes: 2 additions & 3 deletions sapi/fpm/fpm/events/port.c
Expand Up @@ -26,7 +26,7 @@
#include <errno.h>

static int fpm_event_port_init(int max);
static int fpm_event_port_clean();
static int fpm_event_port_clean(void);
static int fpm_event_port_wait(struct fpm_event_queue_s *queue, unsigned long int timeout);
static int fpm_event_port_add(struct fpm_event_s *ev);
static int fpm_event_port_remove(struct fpm_event_s *ev);
Expand Down Expand Up @@ -90,7 +90,7 @@ static int fpm_event_port_init(int max) /* {{{ */
/*
* Clean the module
*/
static int fpm_event_port_clean() /* {{{ */
static int fpm_event_port_clean(void)
{
if (pfd > -1) {
close(pfd);
Expand All @@ -105,7 +105,6 @@ static int fpm_event_port_clean() /* {{{ */
nevents = 0;
return 0;
}
/* }}} */

/*
* wait for events or timeout
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/events/port.h
Expand Up @@ -20,6 +20,6 @@
#include "../fpm_config.h"
#include "../fpm_events.h"

struct fpm_event_module_s *fpm_event_port_module();
struct fpm_event_module_s *fpm_event_port_module(void);

#endif /* FPM_EVENTS_PORT_H */
3 changes: 1 addition & 2 deletions sapi/fpm/fpm/events/select.c
Expand Up @@ -53,15 +53,14 @@ static fd_set fds;
/*
* return the module configuration
*/
struct fpm_event_module_s *fpm_event_select_module() /* {{{ */
struct fpm_event_module_s *fpm_event_select_module(void)
{
#ifdef HAVE_SELECT
return &select_module;
#else
return NULL;
#endif /* HAVE_SELECT */
}
/* }}} */

#ifdef HAVE_SELECT

Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/events/select.h
Expand Up @@ -20,6 +20,6 @@
#include "../fpm_config.h"
#include "../fpm_events.h"

struct fpm_event_module_s *fpm_event_select_module();
struct fpm_event_module_s *fpm_event_select_module(void);

#endif /* FPM_EVENTS_SELECT_H */
9 changes: 3 additions & 6 deletions sapi/fpm/fpm/fpm_children.c
Expand Up @@ -38,7 +38,7 @@ static void fpm_children_cleanup(int which, void *arg) /* {{{ */
}
/* }}} */

static struct fpm_child_s *fpm_child_alloc() /* {{{ */
static struct fpm_child_s *fpm_child_alloc(void)
{
struct fpm_child_s *ret;

Expand All @@ -52,7 +52,6 @@ static struct fpm_child_s *fpm_child_alloc() /* {{{ */
ret->scoreboard_i = -1;
return ret;
}
/* }}} */

static void fpm_child_free(struct fpm_child_s *child) /* {{{ */
{
Expand Down Expand Up @@ -177,7 +176,7 @@ int fpm_children_free(struct fpm_child_s *child) /* {{{ */
}
/* }}} */

void fpm_children_bury() /* {{{ */
void fpm_children_bury(void)
{
int status;
pid_t pid;
Expand Down Expand Up @@ -303,7 +302,6 @@ void fpm_children_bury() /* {{{ */
}
}
}
/* }}} */

static struct fpm_child_s *fpm_resources_prepare(struct fpm_worker_pool_s *wp) /* {{{ */
{
Expand Down Expand Up @@ -472,7 +470,7 @@ int fpm_children_create_initial(struct fpm_worker_pool_s *wp) /* {{{ */
}
/* }}} */

int fpm_children_init_main() /* {{{ */
int fpm_children_init_main(void)
{
if (fpm_global_config.emergency_restart_threshold &&
fpm_global_config.emergency_restart_interval) {
Expand All @@ -492,4 +490,3 @@ int fpm_children_init_main() /* {{{ */

return 0;
}
/* }}} */
4 changes: 2 additions & 2 deletions sapi/fpm/fpm/fpm_children.h
Expand Up @@ -12,8 +12,8 @@

int fpm_children_create_initial(struct fpm_worker_pool_s *wp);
int fpm_children_free(struct fpm_child_s *child);
void fpm_children_bury();
int fpm_children_init_main();
void fpm_children_bury(void);
int fpm_children_init_main(void);
int fpm_children_make(struct fpm_worker_pool_s *wp, int in_event_loop, int nb_to_spawn, int is_debug);

struct fpm_child_s;
Expand Down
9 changes: 3 additions & 6 deletions sapi/fpm/fpm/fpm_clock.c
Expand Up @@ -15,7 +15,7 @@

static int monotonic_works;

int fpm_clock_init() /* {{{ */
int fpm_clock_init(void)
{
struct timespec ts;

Expand All @@ -27,7 +27,6 @@ int fpm_clock_init() /* {{{ */

return 0;
}
/* }}} */

int fpm_clock_get(struct timeval *tv) /* {{{ */
{
Expand Down Expand Up @@ -59,7 +58,7 @@ static clock_serv_t mach_clock;

/* this code borrowed from here: http://lists.apple.com/archives/Darwin-development/2002/Mar/msg00746.html */
/* mach_clock also should be re-initialized in child process after fork */
int fpm_clock_init() /* {{{ */
int fpm_clock_init(void)
{
kern_return_t ret;
mach_timespec_t aTime;
Expand All @@ -81,7 +80,6 @@ int fpm_clock_init() /* {{{ */

return 0;
}
/* }}} */

int fpm_clock_get(struct timeval *tv) /* {{{ */
{
Expand All @@ -104,11 +102,10 @@ int fpm_clock_get(struct timeval *tv) /* {{{ */

#else /* no clock */

int fpm_clock_init() /* {{{ */
int fpm_clock_init(void)
{
return 0;
}
/* }}} */

int fpm_clock_get(struct timeval *tv) /* {{{ */
{
Expand Down
2 changes: 1 addition & 1 deletion sapi/fpm/fpm/fpm_clock.h
Expand Up @@ -5,7 +5,7 @@

#include <sys/time.h>

int fpm_clock_init();
int fpm_clock_init(void);
int fpm_clock_get(struct timeval *tv);

#endif

0 comments on commit e2a5428

Please sign in to comment.