Fixed some function definitions.

Future releases of GCC will render function definitions like

  func()

invalid by default. See the previous commit 09f88c9 ("Fixed main()
prototypes in auto tests.") for details.

Such functions should be defined like

  func(void)

This is a good thing to do regardless of the upcoming GCC changes.

Reviewed-by: Alejandro Colomar <alx@nginx.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
This commit is contained in:
Andrew Clayton
2022-10-28 00:54:01 +01:00
parent 8f0dd9478e
commit 58248a6220
4 changed files with 5 additions and 5 deletions

View File

@@ -50,7 +50,7 @@ nxt_capability_set(nxt_task_t *task, nxt_capabilities_t *cap)
#if (NXT_HAVE_LINUX_CAPABILITY) #if (NXT_HAVE_LINUX_CAPABILITY)
static uint32_t static uint32_t
nxt_capability_linux_get_version() nxt_capability_linux_get_version(void)
{ {
struct __user_cap_header_struct hdr; struct __user_cap_header_struct hdr;

View File

@@ -144,14 +144,14 @@ nxt_port_release(nxt_task_t *task, nxt_port_t *port)
nxt_port_id_t nxt_port_id_t
nxt_port_get_next_id() nxt_port_get_next_id(void)
{ {
return nxt_atomic_fetch_add(&nxt_port_last_id, 1); return nxt_atomic_fetch_add(&nxt_port_last_id, 1);
} }
void void
nxt_port_reset_next_id() nxt_port_reset_next_id(void)
{ {
nxt_port_last_id = 1; nxt_port_last_id = 1;
} }

View File

@@ -201,7 +201,7 @@ ws_chat_close_handler(nxt_unit_request_info_t *req)
int int
main() main(void)
{ {
nxt_unit_ctx_t *ctx; nxt_unit_ctx_t *ctx;
nxt_unit_init_t init; nxt_unit_init_t init;

View File

@@ -83,7 +83,7 @@ ws_echo_websocket_handler(nxt_unit_websocket_frame_t *ws)
int int
main() main(void)
{ {
nxt_unit_ctx_t *ctx; nxt_unit_ctx_t *ctx;
nxt_unit_init_t init; nxt_unit_init_t init;