[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master] Fix compile with warnings problems on Snow Leopard



Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date: Mon, 19 Oct 2009 01:30:46 +0200
Subject: Fix compile with warnings problems on Snow Leopard
Commit: 740806c453c46e9c985029a644af3a6f899be205

---
 src/or/dirvote.c   |    2 +-
 src/or/microdesc.c |   12 ++++++------
 src/or/or.h        |    2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index eb3c7d2..ca81b2b 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -2790,7 +2790,7 @@ static char *microdesc_consensus_methods = NULL;
  * in a consensus vote document.  Write it into the <b>out_len</b>-byte buffer
  * in <b>out</b>.  Return -1 on failure and the number of characters written
  * on success. */
-int
+ssize_t
 dirvote_format_microdesc_vote_line(char *out, size_t out_len,
                                    const microdesc_t *md)
 {
diff --git a/src/or/microdesc.c b/src/or/microdesc.c
index e10589f..7a65705 100644
--- a/src/or/microdesc.c
+++ b/src/or/microdesc.c
@@ -56,10 +56,10 @@ HT_GENERATE(microdesc_map, microdesc_t, node,
  * On success, return the total number of bytes written, and set
  * *<b>annotation_len_out</b> to the number of bytes written as
  * annotations. */
-static int
-dump_microdescriptor(FILE *f, microdesc_t *md, int *annotation_len_out)
+static size_t
+dump_microdescriptor(FILE *f, microdesc_t *md, size_t *annotation_len_out)
 {
-  int r = 0;
+  size_t r = 0;
   /* XXXX drops unkown annotations. */
   if (md->last_listed) {
     char buf[ISO_TIME_LEN+1];
@@ -169,7 +169,7 @@ microdescs_add_list_to_cache(microdesc_cache_t *cache,
 
     /* Okay, it's a new one. */
     if (f) {
-      int annotation_len;
+      size_t annotation_len;
       size = dump_microdescriptor(f, md, &annotation_len);
       md->saved_location = SAVED_IN_JOURNAL;
       cache->journal_len += size;
@@ -269,7 +269,7 @@ microdesc_cache_rebuild(microdesc_cache_t *cache)
   FILE *f;
   microdesc_t **mdp;
   smartlist_t *wrote;
-  int size;
+  size_t size;
   off_t off = 0;
   int orig_size, new_size;
 
@@ -287,7 +287,7 @@ microdesc_cache_rebuild(microdesc_cache_t *cache)
 
   HT_FOREACH(mdp, microdesc_map, &cache->map) {
     microdesc_t *md = *mdp;
-    int annotation_len;
+    size_t annotation_len;
     if (md->no_save)
       continue;
 
diff --git a/src/or/or.h b/src/or/or.h
index 0ec8029..2fa4a79 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3919,7 +3919,7 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_env_t *private_key,
                                         authority_cert_t *cert);
 
 microdesc_t *dirvote_create_microdescriptor(const routerinfo_t *ri);
-int dirvote_format_microdesc_vote_line(char *out, size_t out_len,
+ssize_t dirvote_format_microdesc_vote_line(char *out, size_t out_len,
                                        const microdesc_t *md);
 int vote_routerstatus_find_microdesc_hash(char *digest256_out,
                                           const vote_routerstatus_t *vrs,
-- 
1.5.6.5