gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r19018 - gnunet/src/dns


From: gnunet
Subject: [GNUnet-SVN] r19018 - gnunet/src/dns
Date: Thu, 5 Jan 2012 21:20:22 +0100

Author: grothoff
Date: 2012-01-05 21:20:22 +0100 (Thu, 05 Jan 2012)
New Revision: 19018

Modified:
   gnunet/src/dns/gnunet-service-dns_new.c
Log:
-remove useless casts

Modified: gnunet/src/dns/gnunet-service-dns_new.c
===================================================================
--- gnunet/src/dns/gnunet-service-dns_new.c     2012-01-05 20:18:50 UTC (rev 
19017)
+++ gnunet/src/dns/gnunet-service-dns_new.c     2012-01-05 20:20:22 UTC (rev 
19018)
@@ -482,21 +482,21 @@
        ip.checksum = 0; /* checksum is optional */
        ip.source_address = dst->sin_addr;
        ip.destination_address = src->sin_addr;
-       ip.checksum = GNUNET_CRYPTO_crc16_n ((uint16_t*) &ip, sizeof (ip));
+       ip.checksum = GNUNET_CRYPTO_crc16_n (&ip, sizeof (ip));
 
        udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                               (uint16_t *) &ip.source_address,
+                                               &ip.source_address,
                                                sizeof (struct in_addr) * 2);
        {
          uint16_t tmp;
          
          tmp = htons (IPPROTO_UDP);
          udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                                 (uint16_t *) &tmp,    
+                                                 &tmp, 
                                                  sizeof (uint16_t));
          tmp = htons (rr->payload_length + sizeof (struct udp_packet));
          udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                                 (uint16_t *) &tmp,    
+                                                 &tmp, 
                                                  sizeof (uint16_t));
        }
        memcpy (&buf[off], &ip, sizeof (ip));
@@ -521,18 +521,18 @@
        ip.source_address = dst->sin6_addr;
        ip.destination_address = src->sin6_addr;
        udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum,
-                                               (uint16_t *) 
&ip.source_address, 
+                                               &ip.source_address, 
                                                sizeof (struct in6_addr) * 2);
        {
          uint32_t tmp;
          
          tmp = htons (rr->payload_length + sizeof (struct udp_packet));
          udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                                 (uint16_t *) &tmp,    
+                                                 &tmp, 
                                                  sizeof (uint32_t));
          tmp = htons (IPPROTO_UDP);
          udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                                 (uint16_t *) &tmp,    
+                                                 &tmp, 
                                                  sizeof (uint32_t));
        }
        memcpy (&buf[off], &ip, sizeof (ip));
@@ -552,10 +552,10 @@
       udp.len = htons (reply_len - off);
       udp.crc = 0; 
       udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                             (uint16_t *) &udp, 
+                                             &udp, 
                                              sizeof (udp));
       udp_crc_sum = GNUNET_CRYPTO_crc16_step (udp_crc_sum, 
-                                             (uint16_t *) rr->payload,
+                                             rr->payload,
                                              rr->payload_length);
       udp.crc = GNUNET_CRYPTO_crc16_finish (udp_crc_sum);
       memcpy (&buf[off], &udp, sizeof (udp));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]