]> git.sur5r.net Git - freertos/commitdiff
Update the IP address copy macro so it never relies on any byte alignment.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 8 Nov 2010 21:59:23 +0000 (21:59 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 8 Nov 2010 21:59:23 +0000 (21:59 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1138 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/Common/ethernet/FreeTCPIP/net/uip.h

index 12e8242e38912566f0dd31967d851c9b14785ad0..88d8645a4a8006b7eeab874413a8d752785f5eb8 100644 (file)
@@ -73,9 +73,6 @@
        {\r
                u8_t    u8[4];  /* Initializer, must come first!!! */\r
                u16_t   u16[2];\r
-               #if 0\r
-                       u32_t   u32;\r
-               #endif\r
        } uip_ip4addr_t;\r
        typedef uip_ip4addr_t   uip_ipaddr_t;\r
 #endif /* UIP_CONF_IPV6 */\r
@@ -1017,7 +1014,14 @@ CCIF void        uip_send( const void *data, int len );
  * \hideinitializer\r
  */\r
 #ifndef uip_ipaddr_copy\r
-       #define uip_ipaddr_copy( dest, src )    ( ((unsigned long*)dest)[ 0 ] = ((unsigned long *)src)[ 0 ] )\r
+       #define uip_ipaddr_copy( dest, src )    \\r
+       do                                                                              \\r
+       {                                                                               \\r
+               (dest)->u8[0] = (src)->u8[0];           \\r
+               (dest)->u8[1] = (src)->u8[1];           \\r
+               (dest)->u8[2] = (src)->u8[2];           \\r
+               (dest)->u8[3] = (src)->u8[3];           \\r
+       } while( 0 )    \r
 #endif\r
 \r
                        /**\r