[or-cvs] Be consistent about preferring foo* to struct foo*

Nick Mathewson nickm at seul.org
Fri Jul 22 21:12:12 UTC 2005


Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv1713/src/common

Modified Files:
	compat.c container.c container.h 
Log Message:
Be consistent about preferring foo* to struct foo*

Index: compat.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/compat.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- compat.c	13 Jul 2005 17:24:55 -0000	1.60
+++ compat.c	22 Jul 2005 21:12:10 -0000	1.61
@@ -733,14 +733,14 @@
  */
 
 #if defined(USE_PTHREADS)
-struct tor_pthread_data_t {
+typedef struct tor_pthread_data_t {
   int (*func)(void *);
   void *data;
-};
+} tor_pthread_data_t;
 static void *
 tor_pthread_helper_fn(void *_data)
 {
-  struct tor_pthread_data_t *data = _data;
+  tor_pthread_data_t *data = _data;
   int (*func)(void*);
   void *arg;
   func = data->func;
@@ -771,8 +771,8 @@
   return 0;
 #elif defined(USE_PTHREADS)
   pthread_t thread;
-  struct tor_pthread_data_t *d;
-  d = tor_malloc(sizeof(struct tor_pthread_data_t));
+  tor_pthread_data_t *d;
+  d = tor_malloc(sizeof(tor_pthread_data_t));
   d->data = data;
   d->func = func;
   if (pthread_create(&thread,NULL,tor_pthread_helper_fn,d))

Index: container.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/container.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- container.c	18 Jul 2005 23:33:19 -0000	1.31
+++ container.c	22 Jul 2005 21:12:10 -0000	1.32
@@ -388,18 +388,18 @@
 
 /* Splay-tree implementation of string-to-void* map
  */
-struct strmap_entry_t {
+typedef struct strmap_entry_t {
   SPLAY_ENTRY(strmap_entry_t) node;
   char *key;
   void *val;
-};
+} strmap_entry_t;
 
 struct strmap_t {
   SPLAY_HEAD(strmap_tree, strmap_entry_t) head;
 };
 
-static int compare_strmap_entries(struct strmap_entry_t *a,
-                                 struct strmap_entry_t *b)
+static int compare_strmap_entries(strmap_entry_t *a,
+                                  strmap_entry_t *b)
 {
   return strcmp(a->key, b->key);
 }

Index: container.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/container.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- container.h	9 Jun 2005 19:03:31 -0000	1.13
+++ container.h	22 Jul 2005 21:12:10 -0000	1.14
@@ -72,7 +72,6 @@
 
 /* Map from const char * to void*. Implemented with a splay tree. */
 typedef struct strmap_t strmap_t;
-typedef struct strmap_entry_t strmap_entry_t;
 typedef struct strmap_entry_t strmap_iter_t;
 strmap_t* strmap_new(void);
 void* strmap_set(strmap_t *map, const char *key, void *val);



More information about the tor-commits mailing list