Rev 3271 | Rev 3427 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 3271 | Rev 3274 | ||
|---|---|---|---|
| Line 67... | Line 67... | ||
| 67 | 67 | ||
| 68 | for (j = 0; j < n % sizeof(unsigned long); j++) |
68 | for (j = 0; j < n % sizeof(unsigned long); j++) |
| 69 | ((unsigned char *) (((unsigned long *) dst) + i))[j] = |
69 | ((unsigned char *) (((unsigned long *) dst) + i))[j] = |
| 70 | ((unsigned char *) (((unsigned long *) src) + i))[j]; |
70 | ((unsigned char *) (((unsigned long *) src) + i))[j]; |
| 71 | 71 | ||
| 72 | return (char *) src; |
72 | return (char *) dst; |
| 73 | } |
73 | } |
| 74 | 74 | ||
| 75 | void *memcpy(void *dst, const void *src, size_t n) |
75 | void *memcpy(void *dst, const void *src, size_t n) |
| 76 | { |
76 | { |
| 77 | int i, j; |
77 | int i, j; |
| Line 85... | Line 85... | ||
| 85 | 85 | ||
| 86 | for (j = 0; j < n % sizeof(unsigned long); j++) |
86 | for (j = 0; j < n % sizeof(unsigned long); j++) |
| 87 | ((unsigned char *) (((unsigned long *) dst) + i))[j] = |
87 | ((unsigned char *) (((unsigned long *) dst) + i))[j] = |
| 88 | ((unsigned char *) (((unsigned long *) src) + i))[j]; |
88 | ((unsigned char *) (((unsigned long *) src) + i))[j]; |
| 89 | 89 | ||
| 90 | return (char *) src; |
90 | return (char *) dst; |
| 91 | } |
91 | } |
| 92 | 92 | ||
| 93 | void *memmove(void *dst, const void *src, size_t n) |
93 | void *memmove(void *dst, const void *src, size_t n) |
| 94 | { |
94 | { |
| 95 | int i, j; |
95 | int i, j; |
| Line 102... | Line 102... | ||
| 102 | ((unsigned char *) ((unsigned long *) src))[j]; |
102 | ((unsigned char *) ((unsigned long *) src))[j]; |
| 103 | 103 | ||
| 104 | for (i = n / sizeof(unsigned long) - 1; i >=0 ; i--) |
104 | for (i = n / sizeof(unsigned long) - 1; i >=0 ; i--) |
| 105 | ((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; |
105 | ((unsigned long *) dst)[i] = ((unsigned long *) src)[i]; |
| 106 | 106 | ||
| 107 | return (char *) src; |
107 | return (char *) dst; |
| 108 | } |
108 | } |
| 109 | 109 | ||
| 110 | /** Compare two memory areas. |
110 | /** Compare two memory areas. |
| 111 | * |
111 | * |
| 112 | * @param s1 Pointer to the first area to compare. |
112 | * @param s1 Pointer to the first area to compare. |