Merge branch 'main' of github.com:ringtailsoftware/uvm32

This commit is contained in:
Toby Jaffey 2025-12-13 17:54:47 +00:00
commit a9af18488e

View file

@ -48,22 +48,24 @@ static uint32_t garbage;
#ifndef UVM32_MEMCPY #ifndef UVM32_MEMCPY
#define UVM32_MEMCPY uvm32_memcpy #define UVM32_MEMCPY uvm32_memcpy
void uvm32_memcpy(void *dst, const void *src, int len) { void *uvm32_memcpy(void *dst, const void *src, size_t len) {
uint8_t *d = (uint8_t *)dst; uint8_t *d = (uint8_t *)dst;
const uint8_t *s = (const uint8_t *)src; const uint8_t *s = (const uint8_t *)src;
while(len--) { while(len--) {
*(d++) = *(s++); *(d++) = *(s++);
} }
return dst;
} }
#endif #endif
#ifndef UVM32_MEMSET #ifndef UVM32_MEMSET
#define UVM32_MEMSET uvm32_memset #define UVM32_MEMSET uvm32_memset
void uvm32_memset(void *buf, int c, int len) { void *uvm32_memset(void *buf, int c, size_t len) {
uint8_t *b = (uint8_t *)buf; uint8_t *b = (uint8_t *)buf;
while(len--) { while(len--) {
*(b++) = c; *(b++) = c;
} }
return buf;
} }
#endif #endif