subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1345883 - /subversion/trunk/subversion/libsvn_subr/string.c
Date Mon, 04 Jun 2012 09:31:21 GMT
Author: stefan2
Date: Mon Jun  4 09:31:20 2012
New Revision: 1345883

URL: http://svn.apache.org/viewvc?rev=1345883&view=rev
Log:
Simplify COPY_TWO_BYTES macro and fix -Wstrict-aliasing warning.

* subversion/libsvn_subr/string.c
  (COPY_TWO_BYTES): implement as memcpy

Suggested by: philip

Modified:
    subversion/trunk/subversion/libsvn_subr/string.c

Modified: subversion/trunk/subversion/libsvn_subr/string.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/string.c?rev=1345883&r1=1345882&r2=1345883&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/string.c (original)
+++ subversion/trunk/subversion/libsvn_subr/string.c Mon Jun  4 09:31:20 2012
@@ -937,16 +937,8 @@ static const char decimal_table[100][4]
       , "90", "91", "92", "93", "94", "95", "96", "97", "98", "99"};
 
 /* Copy the two bytes at SOURCE[0] and SOURCE[1] to DEST[0] and DEST[1] */
-#if SVN_UNALIGNED_ACCESS_IS_OK
-#  define COPY_TWO_BYTES(dest,source)\
-      *(apr_uint16_t*)(dest) = *(apr_uint16_t*)(source)
-#else
-#  define COPY_TWO_BYTES(dest,source) \
-    do { \
-      (dest)[0] = (source)[0]; \
-      (dest)[1] = (source)[1]; \
-    } while (0)
-#endif
+#define COPY_TWO_BYTES(dest,source)\
+    memcpy(dest, source, 2)
 
 apr_size_t
 svn__ui64toa(char * dest, apr_uint64_t number)



Mime
View raw message