RISC-V/V203F6P6/gsm/wrap.c

23 lines
599 B
C
Raw Normal View History

2025-01-30 19:27:19 +01:00
/* Funkce z newlib, použité ve zdrojácích.
* Velmi zjednodušeno.
*/
typedef struct {
int quot, rem;
} div_t;
typedef __SIZE_TYPE__ size_t;
div_t div (int numerator, int denominator) {
const div_t result = { numerator / denominator, numerator % denominator };
return result;
}
void * memset(void * s, int c, size_t n) {
char * p = (char*) s;
for (unsigned i=0u; i<n; i++) p [i] = c;
return s;
}
void * memcpy(void * dest, const void * src, size_t n) {
char * d = (char*) dest;
const char * s = (const char*) src;
for (unsigned i=0u; i<n; i++) d [i] = s [i];
return dest;
}