diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-04 12:17:33 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-04 12:17:33 +0000 |
commit | 6726d9c371e0dbf4a3604c34e4a6043332372bd4 (patch) | |
tree | 46cd196eed7285abc3b14f2d0b95d465b6c527c8 /src | |
parent | 0afdd0b60dbbcdb565c5dbeb84ac30a8a9d076c0 (diff) | |
download | gnunet-6726d9c371e0dbf4a3604c34e4a6043332372bd4.tar.gz gnunet-6726d9c371e0dbf4a3604c34e4a6043332372bd4.zip |
fixing types
Diffstat (limited to 'src')
-rw-r--r-- | src/util/pseudonym.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/util/pseudonym.c b/src/util/pseudonym.c index 5bda78a89..c19662540 100644 --- a/src/util/pseudonym.c +++ b/src/util/pseudonym.c | |||
@@ -136,9 +136,9 @@ write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
136 | const struct GNUNET_CONTAINER_MetaData *meta, | 136 | const struct GNUNET_CONTAINER_MetaData *meta, |
137 | int32_t ranking, const char *ns_name) | 137 | int32_t ranking, const char *ns_name) |
138 | { | 138 | { |
139 | unsigned int size; | 139 | size_t size; |
140 | unsigned int tag; | 140 | size_t tag; |
141 | unsigned int off; | 141 | size_t off; |
142 | char *buf; | 142 | char *buf; |
143 | char *fn; | 143 | char *fn; |
144 | 144 | ||
@@ -146,7 +146,7 @@ write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
146 | GNUNET_assert (fn != NULL); | 146 | GNUNET_assert (fn != NULL); |
147 | size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta, | 147 | size = GNUNET_CONTAINER_meta_data_get_serialized_size (meta, |
148 | GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL); | 148 | GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL); |
149 | tag = size + sizeof (int) + 1; | 149 | tag = size + sizeof (int32_t) + 1; |
150 | off = 0; | 150 | off = 0; |
151 | if (ns_name != NULL) | 151 | if (ns_name != NULL) |
152 | { | 152 | { |
@@ -154,10 +154,10 @@ write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
154 | tag += off; | 154 | tag += off; |
155 | } | 155 | } |
156 | buf = GNUNET_malloc (tag); | 156 | buf = GNUNET_malloc (tag); |
157 | ((int *) buf)[0] = htonl (ranking); /* ranking */ | 157 | ((int32_t *) buf)[0] = htonl (ranking); /* ranking */ |
158 | if (ns_name != NULL) | 158 | if (ns_name != NULL) |
159 | { | 159 | { |
160 | memcpy (&buf[sizeof (int)], ns_name, off + 1); | 160 | memcpy (&buf[sizeof (int32_t)], ns_name, off + 1); |
161 | } | 161 | } |
162 | else | 162 | else |
163 | { | 163 | { |
@@ -166,7 +166,7 @@ write_pseudonym_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
166 | GNUNET_assert | 166 | GNUNET_assert |
167 | (size == GNUNET_CONTAINER_meta_data_serialize (meta, | 167 | (size == GNUNET_CONTAINER_meta_data_serialize (meta, |
168 | &buf[sizeof | 168 | &buf[sizeof |
169 | (int) + | 169 | (int32_t) + |
170 | off + 1], | 170 | off + 1], |
171 | size, | 171 | size, |
172 | GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL)); | 172 | GNUNET_CONTAINER_META_DATA_SERIALIZE_FULL)); |
@@ -184,9 +184,9 @@ read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
184 | struct GNUNET_CONTAINER_MetaData **meta, | 184 | struct GNUNET_CONTAINER_MetaData **meta, |
185 | int32_t * ranking, char **ns_name) | 185 | int32_t * ranking, char **ns_name) |
186 | { | 186 | { |
187 | unsigned long long len; | 187 | uint64_t len; |
188 | unsigned int size; | 188 | size_t size; |
189 | unsigned int zend; | 189 | size_t zend; |
190 | struct stat sbuf; | 190 | struct stat sbuf; |
191 | char *buf; | 191 | char *buf; |
192 | char *fn; | 192 | char *fn; |
@@ -204,7 +204,7 @@ read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
204 | GNUNET_free (fn); | 204 | GNUNET_free (fn); |
205 | return GNUNET_SYSERR; | 205 | return GNUNET_SYSERR; |
206 | } | 206 | } |
207 | if (len <= sizeof (int) + 1) | 207 | if (len <= sizeof (int32_t) + 1) |
208 | { | 208 | { |
209 | GNUNET_free (fn); | 209 | GNUNET_free (fn); |
210 | return GNUNET_SYSERR; | 210 | return GNUNET_SYSERR; |
@@ -226,8 +226,8 @@ read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
226 | return GNUNET_SYSERR; | 226 | return GNUNET_SYSERR; |
227 | } | 227 | } |
228 | if (ranking != NULL) | 228 | if (ranking != NULL) |
229 | *ranking = ntohl (((int *) buf)[0]); | 229 | *ranking = ntohl (((int32_t *) buf)[0]); |
230 | zend = sizeof (int); | 230 | zend = sizeof (int32_t); |
231 | while ((zend < len) && (buf[zend] != '\0')) | 231 | while ((zend < len) && (buf[zend] != '\0')) |
232 | zend++; | 232 | zend++; |
233 | if (zend == len) | 233 | if (zend == len) |
@@ -238,8 +238,8 @@ read_info (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
238 | } | 238 | } |
239 | if (ns_name != NULL) | 239 | if (ns_name != NULL) |
240 | { | 240 | { |
241 | if (zend != sizeof (int)) | 241 | if (zend != sizeof (int32_t)) |
242 | *ns_name = GNUNET_strdup (&buf[sizeof (int)]); | 242 | *ns_name = GNUNET_strdup (&buf[sizeof (int32_t)]); |
243 | else | 243 | else |
244 | *ns_name = NULL; | 244 | *ns_name = NULL; |
245 | } | 245 | } |
@@ -280,7 +280,7 @@ GNUNET_PSEUDONYM_id_to_name (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
280 | char *name; | 280 | char *name; |
281 | GNUNET_HashCode nh; | 281 | GNUNET_HashCode nh; |
282 | char *fn; | 282 | char *fn; |
283 | unsigned long long len; | 283 | uint64_t len; |
284 | struct GNUNET_DISK_FileHandle *fh; | 284 | struct GNUNET_DISK_FileHandle *fh; |
285 | unsigned int i; | 285 | unsigned int i; |
286 | unsigned int idx; | 286 | unsigned int idx; |
@@ -360,7 +360,7 @@ GNUNET_PSEUDONYM_name_to_id (const struct GNUNET_CONFIGURATION_Handle *cfg, | |||
360 | const char *ns_uname, GNUNET_HashCode * nsid) | 360 | const char *ns_uname, GNUNET_HashCode * nsid) |
361 | { | 361 | { |
362 | size_t slen; | 362 | size_t slen; |
363 | unsigned long long len; | 363 | uint64_t len; |
364 | unsigned int idx; | 364 | unsigned int idx; |
365 | char *name; | 365 | char *name; |
366 | GNUNET_HashCode nh; | 366 | GNUNET_HashCode nh; |