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
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)
{
if (!__brk)
__brk = brk (0);
__brk = (char *) brk (0);
if (brk (__brk + size) == -1)
return 0;
char *p = __brk;

View File

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

View File

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