aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/compat.c10
-rw-r--r--src/common/container.c8
-rw-r--r--src/common/container.h1
3 files changed, 9 insertions, 10 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 4da5d0da6..2f7d0399c 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -733,14 +733,14 @@ get_uname(void)
*/
#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 @@ spawn_func(int (*func)(void *), void *data)
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))
diff --git a/src/common/container.c b/src/common/container.c
index b53710d4f..a231afdc8 100644
--- a/src/common/container.c
+++ b/src/common/container.c
@@ -388,18 +388,18 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
/* 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);
}
diff --git a/src/common/container.h b/src/common/container.h
index 0b64a05e4..260177767 100644
--- a/src/common/container.h
+++ b/src/common/container.h
@@ -72,7 +72,6 @@ char *smartlist_join_strings2(smartlist_t *sl, const char *join,
/* 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);