aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2004-11-22 23:28:26 +0000
committerNick Mathewson <nickm@torproject.org>2004-11-22 23:28:26 +0000
commit22dba27d8dd55e3494775b9241e258e494caf5d3 (patch)
tree8e3e1a756c6efc65d8211e884bf5c5b9dd60dea1 /src/common
parentfe32c2d1412e7a3906fa4f0ae0f99f12de5b882b (diff)
downloadtor-22dba27d8dd55e3494775b9241e258e494caf5d3.tar
tor-22dba27d8dd55e3494775b9241e258e494caf5d3.tar.gz
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. svn:r2943
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c13
-rw-r--r--src/common/compat.h2
-rw-r--r--src/common/container.c3
-rw-r--r--src/common/util.c3
4 files changed, 12 insertions, 9 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 395194b37..4a02dd1c7 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -239,9 +239,9 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
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 @@ tor_socketpair(int family, int type, int protocol, int fd[2])
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 @@ get_uname(void)
* 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;
diff --git a/src/common/compat.h b/src/common/compat.h
index 5b0ed36a0..f62e83354 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -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
diff --git a/src/common/container.c b/src/common/container.c
index ec47adf72..f41dfd76a 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -597,7 +597,8 @@ int strmap_iter_done(strmap_iter_t *iter)
/** 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) {
diff --git a/src/common/util.c b/src/common/util.c
index d3add33e1..3099b125c 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -540,7 +540,8 @@ static const int days_per_month[] =
/** 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().
*/