mescc: Mes C Library: Fix compile warnings.

* lib/stdio/fputc.c (fputc): Oops, stream is a long.
* lib/stdlib/malloc.c (malloc): Cast to char *. FIXME
* lib/string/memchr.c (memchr): Cast to void *.
* lib/string/memcmp.c (memcmp): Add const cast.
This commit is contained in:
Jan Nieuwenhuizen 2019-05-26 13:41:00 +02:00
parent 198d4a652d
commit eff35b8a54
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
4 changed files with 5 additions and 5 deletions

View file

@ -23,5 +23,5 @@
int int
fputc (int c, FILE * stream) fputc (int c, FILE * stream)
{ {
return fdputc (c, (int) stream); return fdputc (c, (long) stream);
} }

View file

@ -24,7 +24,7 @@ void *
malloc (size_t size) malloc (size_t size)
{ {
if (!__brk) if (!__brk)
__brk = brk (0); __brk = (char *) brk (0);
if (brk (__brk + size) == -1) if (brk (__brk + size) == -1)
return 0; return 0;
char *p = __brk; char *p = __brk;

View file

@ -27,7 +27,7 @@ memchr (void const *block, int c, size_t size)
while (size--) while (size--)
{ {
if (c == *p) if (c == *p)
return p; return (void *) p;
p++; p++;
} }
return 0; return 0;

View file

@ -25,8 +25,8 @@ memcmp (void const *s1, void const *s2, size_t size)
{ {
if (!size) if (!size)
return 0; return 0;
char *a = s1; char const *a = s1;
char *b = s2; char const *b = s2;
while (*a == *b && --size) while (*a == *b && --size)
{ {
a++; a++;