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
This commit is contained in:
Nick Mathewson 2007-08-16 21:12:53 +00:00
parent 12fe087e12
commit 35983cd60f
7 changed files with 12 additions and 12 deletions

View File

@ -86,7 +86,7 @@ class Struct:
print >>file, '};\n' print >>file, '};\n'
print >>file, ( 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_free(struct %s *);\n' % (self._name, self._name) +
'void %s_clear(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' % ( 'void %s_marshal(struct evbuffer *, const struct %s *);\n' % (
@ -119,7 +119,7 @@ class Struct:
# Creation # Creation
print >>file, ( 'struct %s *\n' % self._name + print >>file, ( 'struct %s *\n' % self._name +
'%s_new()\n' % self._name + '%s_new(void)\n' % self._name +
'{\n' '{\n'
' struct %s *tmp;\n' % self._name + ' struct %s *tmp;\n' % self._name +
' if ((tmp = malloc(sizeof(struct %s))) == NULL) {\n' ' if ((tmp = malloc(sizeof(struct %s))) == NULL) {\n'

View File

@ -63,7 +63,7 @@ int decode_int(uint32_t *pnumber, struct evbuffer *evbuf);
static struct evbuffer *_buf; /* not thread safe */ static struct evbuffer *_buf; /* not thread safe */
void void
evtag_init() evtag_init(void)
{ {
if (_buf != NULL) if (_buf != NULL)
return; return;

View File

@ -271,7 +271,7 @@ static int evrpc_schedule_request(struct evhttp_connection *connection,
struct evrpc_request_wrapper *ctx); struct evrpc_request_wrapper *ctx);
struct evrpc_pool * struct evrpc_pool *
evrpc_pool_new() evrpc_pool_new(void)
{ {
struct evrpc_pool *pool = calloc(1, sizeof(struct evrpc_pool)); struct evrpc_pool *pool = calloc(1, sizeof(struct evrpc_pool));
if (pool == NULL) if (pool == NULL)

View File

@ -295,7 +295,7 @@ int evrpc_make_request(struct evrpc_request_wrapper *);
* a pool has a number of connections associated with it. * a pool has a number of connections associated with it.
* rpc requests are always made via a pool. * 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_free(struct evrpc_pool *);
void evrpc_pool_add_connection(struct evrpc_pool *, void evrpc_pool_add_connection(struct evrpc_pool *,
struct evhttp_connection *); struct evhttp_connection *);

View File

@ -909,7 +909,7 @@ evtag_int_test(void)
} }
void void
evtag_fuzz() evtag_fuzz(void)
{ {
u_char buffer[4096]; u_char buffer[4096];
struct evbuffer *tmp = evbuffer_new(); struct evbuffer *tmp = evbuffer_new();

View File

@ -121,7 +121,7 @@ out:
} }
void void
dns_gethostbyname() dns_gethostbyname(void)
{ {
fprintf(stdout, "Simple DNS resolve: "); fprintf(stdout, "Simple DNS resolve: ");
dns_ok = 0; dns_ok = 0;
@ -137,7 +137,7 @@ dns_gethostbyname()
} }
void void
dns_gethostbyname6() dns_gethostbyname6(void)
{ {
fprintf(stdout, "IPv6 DNS resolve: "); fprintf(stdout, "IPv6 DNS resolve: ");
dns_ok = 0; dns_ok = 0;
@ -153,7 +153,7 @@ dns_gethostbyname6()
} }
void void
dns_gethostbyaddr() dns_gethostbyaddr(void)
{ {
struct in_addr in; struct in_addr in;
in.s_addr = htonl(0x7f000001ul); /* 127.0.0.1 */ 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 void
dns_server() dns_server(void)
{ {
int sock; int sock;
struct sockaddr_in my_addr; struct sockaddr_in my_addr;

View File

@ -652,7 +652,7 @@ close_detect_cb(struct evhttp_request *req, void *arg)
void void
http_close_detection() http_close_detection(void)
{ {
short port = -1; short port = -1;
struct evhttp_connection *evcon = NULL; struct evhttp_connection *evcon = NULL;
@ -724,7 +724,7 @@ http_highport_test(void)
} }
void void
http_bad_header_test() http_bad_header_test(void)
{ {
struct evkeyvalq headers; struct evkeyvalq headers;