Compare commits
No commits in common. "3981746d2a9884a7106a54378bb6c74d9ac4f204" and "57fc34cb2d8ba78b78a4ed387fbb77b2f5439111" have entirely different histories.
3981746d2a
...
57fc34cb2d
1
Makefile
1
Makefile
|
@ -4,7 +4,6 @@ CFLAGS=-Ilib83 -c -mz80 --std-sdcc2x --no-std-crt0 --reserve-regs-iy --opt-code-
|
||||||
|
|
||||||
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
|
OBJS=_crt0.rel clrscr.rel putchar.rel puts.rel exit.rel gotoxy.rel __assert_fail.rel \
|
||||||
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel memcmp.rel \
|
getchar.rel put_int.rel ctype.rel memcpy.rel memset.rel memmove.rel memcmp.rel \
|
||||||
strcpy.rel strlen.rel \
|
|
||||||
main.rel
|
main.rel
|
||||||
|
|
||||||
.PHONY: all clean try
|
.PHONY: all clean try
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void * memcpy(void * dest, const void * src, size_t n) {
|
void * memcpy(void * dest, const void * src, size_t n) {
|
||||||
register char * d = dest;
|
char * d = dest;
|
||||||
register const char * s = src;
|
const char * s = src;
|
||||||
while (n--) *d++ = *s++;
|
while (n--) *d++ = *s++;
|
||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
void * memmove(void * dst, void * src, size_t acount) {
|
void * memmove(void * dst, void * src, size_t acount) {
|
||||||
register void * ret = dst;
|
void * ret = dst;
|
||||||
register char * d;
|
char * d;
|
||||||
register char * s;
|
char * s;
|
||||||
|
|
||||||
if (src < dst && (char *)src + acount > dst) {
|
if (((int)src < (int)dst) && ((((int)src) + acount) > (int)dst)) {
|
||||||
d = ((char *)dst) + acount - 1;
|
d = ((char *)dst) + acount - 1;
|
||||||
s = ((char *)src) + acount - 1;
|
s = ((char *)src) + acount - 1;
|
||||||
while (acount--) {
|
while (acount--) {
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
char * strcpy (char * d, const char * from) {
|
|
||||||
register char * to = d;
|
|
||||||
while (*to++ = *from++);
|
|
||||||
return d;
|
|
||||||
}
|
|
||||||
|
|
|
@ -14,7 +14,6 @@ extern char *strncpy(char *dest, const char *src, size_t n);
|
||||||
extern size_t strlen(const char *s);
|
extern size_t strlen(const char *s);
|
||||||
extern int8_t strcmp(const char *s1, const char *s2);
|
extern int8_t strcmp(const char *s1, const char *s2);
|
||||||
extern int8_t strncmp(const char *s1, const char *s2, size_t n);
|
extern int8_t strncmp(const char *s1, const char *s2, size_t n);
|
||||||
extern char * strcat(char *dest, const char *src);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
size_t strlen (const char * str) {
|
|
||||||
register size_t i = 0;
|
|
||||||
while(*str++) i++;
|
|
||||||
return i;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user