There is no need to cast void* to other pointer types.

svn:r1524
This commit is contained in:
Nick Mathewson 2004-04-07 20:11:28 +00:00
parent dfb009febb
commit 789df20e7d
2 changed files with 4 additions and 4 deletions

View File

@ -119,9 +119,9 @@ int find_on_inbuf(char *string, int string_len, buf_t *buf) {
*/
buf_t *buf_new_with_capacity(size_t size) {
buf_t *buf;
buf = (buf_t*)tor_malloc(sizeof(buf_t));
buf = tor_malloc(sizeof(buf_t));
buf->magic = BUFFER_MAGIC;
buf->mem = (char *)tor_malloc(size);
buf->mem = tor_malloc(size);
buf->len = size;
buf->datalen = 0;
// memset(buf->mem,0,size);

View File

@ -513,7 +513,7 @@ int onion_extend_cpath(crypt_path_t **head_ptr, cpath_build_state_t *state, rout
log_fn(LOG_DEBUG,"Chose router %s for hop %d (exit is %s)",
choice->nickname, cur_len, state->chosen_exit);
hop = (crypt_path_t *)tor_malloc_zero(sizeof(crypt_path_t));
hop = tor_malloc_zero(sizeof(crypt_path_t));
/* link hop into the cpath, at the end. */
onion_append_to_cpath(head_ptr, hop);
@ -568,7 +568,7 @@ onion_skin_create(crypto_pk_env_t *dest_router_key,
pkbytes = crypto_pk_keysize(dest_router_key);
assert(dhbytes == 128);
assert(pkbytes == 128);
challenge = (char *)tor_malloc_zero(ONIONSKIN_CHALLENGE_LEN-CIPHER_KEY_LEN);
challenge = tor_malloc_zero(ONIONSKIN_CHALLENGE_LEN-CIPHER_KEY_LEN);
if (crypto_dh_get_public(dh, challenge, dhbytes))
goto err;