[or-cvs] Normalize a few more kinds of whitespace. We now dislike:
Nick Mathewson
nickm at seul.org
Mon Nov 22 23:28:28 UTC 2004
Update of /home/or/cvsroot/tor/src/common
In directory moria.mit.edu:/tmp/cvs-serv29140/src/common
Modified Files:
compat.c compat.h container.c util.c
Log Message:
Normalize a few more kinds of whitespace. We now dislike:
- func (args)
- if (x){
This doesn't normalize if(x), for(x); while(x), and friends.
Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- compat.c 10 Nov 2004 14:23:31 -0000 1.10
+++ compat.c 22 Nov 2004 23:28:26 -0000 1.11
@@ -239,9 +239,9 @@
listener = socket(AF_INET, type, 0);
if (listener == -1)
return -1;
- memset (&listen_addr, 0, sizeof (listen_addr));
+ memset(&listen_addr, 0, sizeof(listen_addr));
listen_addr.sin_family = AF_INET;
- listen_addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
+ listen_addr.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
listen_addr.sin_port = 0; /* kernel choses port. */
if (bind(listener, (struct sockaddr *) &listen_addr, sizeof (listen_addr))
== -1)
@@ -253,16 +253,16 @@
if (connector == -1)
goto tidy_up_and_fail;
/* We want to find out the port number to connect to. */
- size = sizeof (connect_addr);
+ size = sizeof(connect_addr);
if (getsockname(listener, (struct sockaddr *) &connect_addr, &size) == -1)
goto tidy_up_and_fail;
if (size != sizeof (connect_addr))
goto abort_tidy_up_and_fail;
if (connect(connector, (struct sockaddr *) &connect_addr,
- sizeof (connect_addr)) == -1)
+ sizeof(connect_addr)) == -1)
goto tidy_up_and_fail;
- size = sizeof (listen_addr);
+ size = sizeof(listen_addr);
acceptor = accept(listener, (struct sockaddr *) &listen_addr, &size);
if (acceptor == -1)
goto tidy_up_and_fail;
@@ -468,7 +468,8 @@
* unix calls fork, on win32 calls beginthread. Returns -1 on failure.
* func should not return, but rather should call spawn_exit.
*/
-int spawn_func(int (*func)(void *), void *data)
+int
+spawn_func(int (*func)(void *), void *data)
{
#ifdef MS_WINDOWS
int rv;
Index: compat.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- compat.h 20 Nov 2004 00:37:00 -0000 1.8
+++ compat.h 22 Nov 2004 23:28:26 -0000 1.9
@@ -35,7 +35,7 @@
/* GCC can check printf types on arbitrary functions. */
#ifdef __GNUC__
#define CHECK_PRINTF(formatIdx, firstArg) \
- __attribute__ ((format (printf, formatIdx, firstArg)))
+ __attribute__ ((format(printf, formatIdx, firstArg)))
#else
#define CHECK_PRINTF(formatIdx, firstArg)
#endif
Index: container.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/container.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- container.c 12 Nov 2004 21:14:05 -0000 1.6
+++ container.c 22 Nov 2004 23:28:26 -0000 1.7
@@ -597,7 +597,8 @@
/** Remove all entries from <b>map</b>, and deallocate storage for those entries.
* If free_val is provided, it is invoked on every value in <b>map</b>.
*/
-void strmap_free(strmap_t *map, void (*free_val)(void*))
+void
+strmap_free(strmap_t *map, void (*free_val)(void*))
{
strmap_entry_t *ent, *next;
for (ent = SPLAY_MIN(strmap_tree, &map->head); ent != NULL; ent = next) {
Index: util.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/util.c,v
retrieving revision 1.182
retrieving revision 1.183
diff -u -d -r1.182 -r1.183
--- util.c 22 Nov 2004 21:38:44 -0000 1.182
+++ util.c 22 Nov 2004 23:28:26 -0000 1.183
@@ -540,7 +540,8 @@
/** Return a time_t given a struct tm. The result is given in GMT, and
* does not account for leap seconds.
*/
-time_t tor_timegm (struct tm *tm) {
+time_t
+tor_timegm(struct tm *tm) {
/* This is a pretty ironclad timegm implementation, snarfed from Python2.2.
* It's way more brute-force than fiddling with tzset().
*/
More information about the tor-commits
mailing list