* device/include/pic16/pic18f1220.h,
[fw/sdcc] / device / lib / _memcpy.c
index d5ddf9e7a3faafe51e44b480a1e0d3225931675d..c973f159d9a43c6cc8f0af70eee309bbcbef6872 100644 (file)
 
 #if !_SDCC_PORT_PROVIDES_MEMCPY
 
-#define NULL (void *)0
-
 void * memcpy (
        void * dst,
        void * src,
-       int acount
+       size_t acount
        ) 
 {
 #if _SDCC_Z80_STYLE_LIB_OPT
 
-#pragma NOINDUCTION
+#pragma noinduction
 
        char * d = dst;
        char * s = src;
-       int count = -acount;
+       /* PENDING: Divide first to get around sign problems */
+       int count = -(acount >> 2);
 
-        count /= 4;
-        
         while (count) {
                *d++ = *s++;
                *d++ = *s++;