23 lines
599 B
C
23 lines
599 B
C
|
/* 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;
|
||
|
}
|