[or-cvs] Unbork windows whitespace

Nick Mathewson nickm at seul.org
Sat Jun 5 01:56:57 UTC 2004


Update of /home/or/cvsroot/src/common
In directory moria.mit.edu:/tmp/cvs-serv12655/src/common

Modified Files:
	fakepoll.c util.c util.h 
Log Message:
Unbork windows whitespace

Index: fakepoll.c
===================================================================
RCS file: /home/or/cvsroot/src/common/fakepoll.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- fakepoll.c	5 Jun 2004 01:50:35 -0000	1.31
+++ fakepoll.c	5 Jun 2004 01:56:54 -0000	1.32
@@ -10,9 +10,9 @@
 
 #include "orconfig.h"
 #include "fakepoll.h"
-
-#define MAXCONNECTIONS 10000 /* XXXX copied from or.h */
-#define FD_SETSIZE MAXCONNECTIONS
+
+#define MAXCONNECTIONS 10000 /* XXXX copied from or.h */
+#define FD_SETSIZE MAXCONNECTIONS
 
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.105
retrieving revision 1.106
diff -u -d -r1.105 -r1.106
--- util.c	5 Jun 2004 01:50:35 -0000	1.105
+++ util.c	5 Jun 2004 01:56:54 -0000	1.106
@@ -15,7 +15,7 @@
 #define WIN32_WINNT 0x400
 #define _WIN32_WINNT 0x400
 #define WIN32_LEAN_AND_MEAN
-#if _MSC_VER > 1300
+#if _MSC_VER > 1300
 #include <winsock2.h>
 #include <ws2tcpip.h>
 #elif defined(_MSC_VER)
@@ -1187,9 +1187,9 @@
   E(WSASYSNOTREADY, "Network subsystem is unavailable"),
   E(WSAVERNOTSUPPORTED, "Winsock.dll out of range"),
   E(WSANOTINITIALISED, "Successful WSAStartup not yet performed"),
-  E(WSAEDISCON, "Graceful shutdown now in progress"),
+  E(WSAEDISCON, "Graceful shutdown now in progress"),
 #ifdef WSATYPE_NOT_FOUND
-  E(WSATYPE_NOT_FOUND, "Class type not found"),
+  E(WSATYPE_NOT_FOUND, "Class type not found"),
 #endif
   E(WSAHOST_NOT_FOUND, "Host not found"),
   E(WSATRY_AGAIN, "Nonauthoritative host not found"),
@@ -1729,56 +1729,56 @@
 #endif
   }
 }
-
-#ifndef MS_WINDOWS
-struct tor_mutex_t {
-};
-tor_mutex_t *tor_mutex_new(void) { return NULL; }
-void tor_mutex_acquire(tor_mutex_t *m) { }
-void tor_mutex_release(tor_mutex_t *m) { }
-void tor_mutex_free(tor_mutex_t *m) { }
-#else
-struct tor_mutex_t {
-  HANDLE handle;
-};
-tor_mutex_t *tor_mutex_new(void) 
-{
-  tor_mutex_t *m;
-  m = tor_malloc_zero(sizeof(tor_mutex_t));
-  m->handle = CreateMutex(NULL, FALSE, NULL);
-  tor_assert(m->handle != NULL);
-  return m;
-}
-void tor_mutex_free(tor_mutex_t *m)
-{
-  CloseHandle(m->handle);
-  tor_free(m);
-}
-void tor_mutex_acquire(tor_mutex_t *m)
-{
-  DWORD r;
-  r = WaitForSingleObject(m->handle, INFINITE);
-  switch (r) {
-    case WAIT_ABANDONED: /* holding thread exited. */
-	case WAIT_OBJECT_0: /* we got the mutex normally. */
-      break;
-    case WAIT_TIMEOUT: /* Should never happen. */
-	  tor_assert(0);
-      break;
-	case WAIT_FAILED:
-      log_fn(LOG_WARN, "Failed to acquire mutex: %d", GetLastError());
-  }
-}
-void tor_mutex_release(tor_mutex_t *m)
-{
-  BOOL r;
-  r = ReleaseMutex(m->handle);
-  if (!r) {
-    log_fn(LOG_WARN, "Failed to release mutex: %d", GetLastError());      
-  }
-}
-
-#endif
+
+#ifndef MS_WINDOWS
+struct tor_mutex_t {
+};
+tor_mutex_t *tor_mutex_new(void) { return NULL; }
+void tor_mutex_acquire(tor_mutex_t *m) { }
+void tor_mutex_release(tor_mutex_t *m) { }
+void tor_mutex_free(tor_mutex_t *m) { }
+#else
+struct tor_mutex_t {
+  HANDLE handle;
+};
+tor_mutex_t *tor_mutex_new(void)
+{
+  tor_mutex_t *m;
+  m = tor_malloc_zero(sizeof(tor_mutex_t));
+  m->handle = CreateMutex(NULL, FALSE, NULL);
+  tor_assert(m->handle != NULL);
+  return m;
+}
+void tor_mutex_free(tor_mutex_t *m)
+{
+  CloseHandle(m->handle);
+  tor_free(m);
+}
+void tor_mutex_acquire(tor_mutex_t *m)
+{
+  DWORD r;
+  r = WaitForSingleObject(m->handle, INFINITE);
+  switch (r) {
+    case WAIT_ABANDONED: /* holding thread exited. */
+        case WAIT_OBJECT_0: /* we got the mutex normally. */
+      break;
+    case WAIT_TIMEOUT: /* Should never happen. */
+          tor_assert(0);
+      break;
+        case WAIT_FAILED:
+      log_fn(LOG_WARN, "Failed to acquire mutex: %d", GetLastError());
+  }
+}
+void tor_mutex_release(tor_mutex_t *m)
+{
+  BOOL r;
+  r = ReleaseMutex(m->handle);
+  if (!r) {
+    log_fn(LOG_WARN, "Failed to release mutex: %d", GetLastError());
+  }
+}
+
+#endif
 
 /*
   Local Variables:

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- util.h	5 Jun 2004 01:50:35 -0000	1.70
+++ util.h	5 Jun 2004 01:56:54 -0000	1.71
@@ -219,14 +219,14 @@
 int parse_line_from_file(char *line, int maxlen, FILE *f, char **key_out, char **value_out);
 
 int spawn_func(int (*func)(void *), void *data);
-void spawn_exit();
-
-/* Because we use threads instead of processes on Windows, we need locking on Windows.
- * On Unixy platforms, these functions are no-ops. */
-typedef struct tor_mutex_t tor_mutex_t;
-tor_mutex_t *tor_mutex_new(void);
-void tor_mutex_acquire(tor_mutex_t *m);
-void tor_mutex_release(tor_mutex_t *m);
+void spawn_exit();
+
+/* Because we use threads instead of processes on Windows, we need locking on Windows.
+ * On Unixy platforms, these functions are no-ops. */
+typedef struct tor_mutex_t tor_mutex_t;
+tor_mutex_t *tor_mutex_new(void);
+void tor_mutex_acquire(tor_mutex_t *m);
+void tor_mutex_release(tor_mutex_t *m);
 void tor_mutex_free(tor_mutex_t *m);
 
 int tor_socketpair(int family, int type, int protocol, int fd[2]);
@@ -267,7 +267,7 @@
 #define ERRNO_IS_CONN_EINPROGRESS(e) ((e) == EINPROGRESS)
 #define tor_socket_errno(sock)       (errno)
 #define tor_socket_strerror(e)       strerror(e)
-#endif
+#endif
 
 #endif
 



More information about the tor-commits mailing list