Bug 1216318, Get NSS ready for android, use memcpy, r=kaie
authorMartin Thomson <martin.thomson@gmail.com>
Thu, 22 Oct 2015 19:18:52 +0200
changeset 11695 44d431c47dcc4d389effeb58b32de52e71325751
parent 11694 311b58f69300da0f5442556575ef7607d2149ec7
child 11696 feae8cff7fed6f450b8136af59e7f50e448a5c12
push id835
push userkaie@kuix.de
push dateThu, 22 Oct 2015 17:18:59 +0000
reviewerskaie
bugs1216318
Bug 1216318, Get NSS ready for android, use memcpy, r=kaie
lib/freebl/desblapi.c
--- a/lib/freebl/desblapi.c
+++ b/lib/freebl/desblapi.c
@@ -17,38 +17,18 @@
 #include <stddef.h>
 #include "secerr.h"
 
 #if defined(NSS_X86_OR_X64)
 /* Intel X86 CPUs do unaligned loads and stores without complaint. */
 #define COPY8B(to, from, ptr) \
     	HALFPTR(to)[0] = HALFPTR(from)[0]; \
     	HALFPTR(to)[1] = HALFPTR(from)[1]; 
-#elif defined(USE_MEMCPY)
+#else
 #define COPY8B(to, from, ptr) memcpy(to, from, 8)
-#else
-#define COPY8B(to, from, ptr) \
-    if (((ptrdiff_t)(ptr) & 0x3) == 0) { \
-    	HALFPTR(to)[0] = HALFPTR(from)[0]; \
-    	HALFPTR(to)[1] = HALFPTR(from)[1]; \
-    } else if (((ptrdiff_t)(ptr) & 0x1) == 0) { \
-    	SHORTPTR(to)[0] = SHORTPTR(from)[0]; \
-    	SHORTPTR(to)[1] = SHORTPTR(from)[1]; \
-    	SHORTPTR(to)[2] = SHORTPTR(from)[2]; \
-    	SHORTPTR(to)[3] = SHORTPTR(from)[3]; \
-    } else { \
-    	BYTEPTR(to)[0] = BYTEPTR(from)[0]; \
-    	BYTEPTR(to)[1] = BYTEPTR(from)[1]; \
-    	BYTEPTR(to)[2] = BYTEPTR(from)[2]; \
-    	BYTEPTR(to)[3] = BYTEPTR(from)[3]; \
-    	BYTEPTR(to)[4] = BYTEPTR(from)[4]; \
-    	BYTEPTR(to)[5] = BYTEPTR(from)[5]; \
-    	BYTEPTR(to)[6] = BYTEPTR(from)[6]; \
-    	BYTEPTR(to)[7] = BYTEPTR(from)[7]; \
-    } 
 #endif
 #define COPY8BTOHALF(to, from) COPY8B(to, from, from)
 #define COPY8BFROMHALF(to, from) COPY8B(to, from, to)
 
 static void 
 DES_ECB(DESContext *cx, BYTE *out, const BYTE *in, unsigned int len)
 {
     while (len) {