[or-cvs] There is no need to cast void* to other pointer types.
Andrew R. Reiter
arr at watson.org
Wed Apr 7 20:15:01 UTC 2004
Hmm; any plans to support 64bit architectures? If so, even if later on,
might be wise to cast to types that are safe, no? like achar *
On Wed, 7 Apr 2004, Nick Mathewson wrote:
:Update of /home/or/cvsroot/src/or
:In directory moria.mit.edu:/tmp/cvs-serv31198/src/or
:
:Modified Files:
: buffers.c onion.c
:Log Message:
:There is no need to cast void* to other pointer types.
:
:Index: buffers.c
:===================================================================
:RCS file: /home/or/cvsroot/src/or/buffers.c,v
:retrieving revision 1.76
:retrieving revision 1.77
:diff -u -d -r1.76 -r1.77
:--- buffers.c 3 Apr 2004 03:07:25 -0000 1.76
:+++ buffers.c 7 Apr 2004 20:11:28 -0000 1.77
:@@ -119,9 +119,9 @@
: */
: 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);
:
:Index: onion.c
:===================================================================
:RCS file: /home/or/cvsroot/src/or/onion.c,v
:retrieving revision 1.147
:retrieving revision 1.148
:diff -u -d -r1.147 -r1.148
:--- onion.c 7 Apr 2004 19:46:26 -0000 1.147
:+++ onion.c 7 Apr 2004 20:11:28 -0000 1.148
:@@ -513,7 +513,7 @@
: 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 @@
: 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;
:
:
--
Andrew R. Reiter
arr at watson.org
arr at FreeBSD.org
More information about the tor-commits
mailing list