Page MenuHomeFreeBSD

D29535.id54425.diff
No OneTemporary

D29535.id54425.diff

diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c
--- a/lib/libc/string/bcopy.c
+++ b/lib/libc/string/bcopy.c
@@ -40,11 +40,7 @@
#include <sys/types.h>
-/*
- * sizeof(word) MUST BE A POWER OF TWO
- * SO THAT wmask BELOW IS ALL ONES
- */
-typedef int word; /* "word" used for optimal copy speed */
+typedef intptr_t word; /* "word" used for optimal copy speed */
#define wsize sizeof(word)
#define wmask (wsize - 1)
@@ -105,7 +101,8 @@
* Copy whole words, then mop up any trailing bytes.
*/
t = length / wsize;
- TLOOP(*(word *)dst = *(word *)src; src += wsize; dst += wsize);
+ TLOOP(*(word *)(void *)dst = *(const word *)(const void *)src;
+ src += wsize; dst += wsize);
t = length & wmask;
TLOOP(*dst++ = *src++);
} else {
@@ -126,7 +123,8 @@
TLOOP1(*--dst = *--src);
}
t = length / wsize;
- TLOOP(src -= wsize; dst -= wsize; *(word *)dst = *(word *)src);
+ TLOOP(src -= wsize; dst -= wsize;
+ *(word *)(void *)dst = *(const word *)(const void *)src);
t = length & wmask;
TLOOP(*--dst = *--src);
}

File Metadata

Mime Type
text/plain
Expires
Thu, Dec 25, 5:29 PM (3 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27254052
Default Alt Text
D29535.id54425.diff (1 KB)

Event Timeline