Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void * memcpy(void *out, const void *in, int size)
- {
- byte *pout = out;
- byte *pin = (byte *)in;
- while(size) {
- if(size >= 4) {
- *((u32*)pout) = *((u32*)pin);
- size -= 4; pout += 4; pin += 4;
- } else if(size >= 2) {
- *((u16*)pout) = *((u16*)pin);
- size -= 2; pout += 2; pin += 2;
- } else {
- *pout++ = *pin++;
- --size;
- }
- }
- return out;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement