Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143874452
D31638.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
664 B
Referenced Files
None
Subscribers
None
D31638.diff
View Options
Index: lib/libc/string/swab.c
===================================================================
--- lib/libc/string/swab.c
+++ lib/libc/string/swab.c
@@ -43,15 +43,16 @@
void
swab(const void * __restrict from, void * __restrict to, ssize_t len)
{
- unsigned long temp;
- int n;
- char *fp, *tp;
+ unsigned char temp;
+ size_t n;
+ const unsigned char *fp;
+ unsigned char *tp;
if (len <= 0)
return;
- n = len >> 1;
- fp = (char *)from;
- tp = (char *)to;
+ n = (size_t)len >> 1;
+ fp = (const unsigned char *)from;
+ tp = (unsigned char *)to;
#define STEP temp = *fp++,*tp++ = *fp++,*tp++ = temp
/* round to multiple of 8 */
for (; n & 0x7; --n)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 2, 8:51 AM (11 h, 44 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28411501
Default Alt Text
D31638.diff (664 B)
Attached To
Mode
D31638: [libc] Optimize swab so that it can handle any ssize_t value
Attached
Detach File
Event Timeline
Log In to Comment