Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140503658
D29535.id54425.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D29535.id54425.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D29535: libc/string/bcopy.c: Use intptr_t as the copy type
Attached
Detach File
Event Timeline
Log In to Comment