From 35983cd60ff2972add1db2c7236b3c7b244c7968 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 16 Aug 2007 21:12:53 +0000 Subject: [PATCH] r14618@catbus: nickm | 2007-08-16 17:11:47 -0400 In ANSI C, int func() is a function with unspecified arguments, whereas int func(void) is a function that takes no arguments. Using int func() to mean a function with no arguments is a C++ism, so let's not use or generate it. svn:r395 --- event_rpcgen.py | 4 ++-- event_tagging.c | 2 +- evrpc.c | 2 +- evrpc.h | 2 +- test/regress.c | 2 +- test/regress_dns.c | 8 ++++---- test/regress_http.c | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/event_rpcgen.py b/event_rpcgen.py index 41f0a016..54a1878a 100755 --- a/event_rpcgen.py +++ b/event_rpcgen.py @@ -86,7 +86,7 @@ class Struct: print >>file, '};\n' print >>file, ( - 'struct %s *%s_new();\n' % (self._name, self._name) + + 'struct %s *%s_new(void);\n' % (self._name, self._name) + 'void %s_free(struct %s *);\n' % (self._name, self._name) + 'void %s_clear(struct %s *);\n' % (self._name, self._name) + 'void %s_marshal(struct evbuffer *, const struct %s *);\n' % ( @@ -119,7 +119,7 @@ class Struct: # Creation print >>file, ( 'struct %s *\n' % self._name + - '%s_new()\n' % self._name + + '%s_new(void)\n' % self._name + '{\n' ' struct %s *tmp;\n' % self._name + ' if ((tmp = malloc(sizeof(struct %s))) == NULL) {\n' diff --git a/event_tagging.c b/event_tagging.c index 3266d543..955b3a0c 100644 --- a/event_tagging.c +++ b/event_tagging.c @@ -63,7 +63,7 @@ int decode_int(uint32_t *pnumber, struct evbuffer *evbuf); static struct evbuffer *_buf; /* not thread safe */ void -evtag_init() +evtag_init(void) { if (_buf != NULL) return; diff --git a/evrpc.c b/evrpc.c index 256f016d..0d24d36c 100644 --- a/evrpc.c +++ b/evrpc.c @@ -271,7 +271,7 @@ static int evrpc_schedule_request(struct evhttp_connection *connection, struct evrpc_request_wrapper *ctx); struct evrpc_pool * -evrpc_pool_new() +evrpc_pool_new(void) { struct evrpc_pool *pool = calloc(1, sizeof(struct evrpc_pool)); if (pool == NULL) diff --git a/evrpc.h b/evrpc.h index 18855b2a..5f45e780 100644 --- a/evrpc.h +++ b/evrpc.h @@ -295,7 +295,7 @@ int evrpc_make_request(struct evrpc_request_wrapper *); * a pool has a number of connections associated with it. * rpc requests are always made via a pool. */ -struct evrpc_pool *evrpc_pool_new(); +struct evrpc_pool *evrpc_pool_new(void); void evrpc_pool_free(struct evrpc_pool *); void evrpc_pool_add_connection(struct evrpc_pool *, struct evhttp_connection *); diff --git a/test/regress.c b/test/regress.c index 77742457..a75824a7 100644 --- a/test/regress.c +++ b/test/regress.c @@ -909,7 +909,7 @@ evtag_int_test(void) } void -evtag_fuzz() +evtag_fuzz(void) { u_char buffer[4096]; struct evbuffer *tmp = evbuffer_new(); diff --git a/test/regress_dns.c b/test/regress_dns.c index 35313b53..85f3855d 100644 --- a/test/regress_dns.c +++ b/test/regress_dns.c @@ -121,7 +121,7 @@ out: } void -dns_gethostbyname() +dns_gethostbyname(void) { fprintf(stdout, "Simple DNS resolve: "); dns_ok = 0; @@ -137,7 +137,7 @@ dns_gethostbyname() } void -dns_gethostbyname6() +dns_gethostbyname6(void) { fprintf(stdout, "IPv6 DNS resolve: "); dns_ok = 0; @@ -153,7 +153,7 @@ dns_gethostbyname6() } void -dns_gethostbyaddr() +dns_gethostbyaddr(void) { struct in_addr in; in.s_addr = htonl(0x7f000001ul); /* 127.0.0.1 */ @@ -278,7 +278,7 @@ dns_server_gethostbyname_cb(int result, char type, int count, int ttl, } void -dns_server() +dns_server(void) { int sock; struct sockaddr_in my_addr; diff --git a/test/regress_http.c b/test/regress_http.c index a272f6fd..50c7bc47 100644 --- a/test/regress_http.c +++ b/test/regress_http.c @@ -652,7 +652,7 @@ close_detect_cb(struct evhttp_request *req, void *arg) void -http_close_detection() +http_close_detection(void) { short port = -1; struct evhttp_connection *evcon = NULL; @@ -724,7 +724,7 @@ http_highport_test(void) } void -http_bad_header_test() +http_bad_header_test(void) { struct evkeyvalq headers;