lib: Fix compile warnings.

* lib/linux/read.c (read): Add casts.
* lib/linux/signal.c (signal): Likewise.
* lib/stdio/vfscanf.c: Include stdlib.h.
(vfscanf): Add cast.
* lib/stdlib/mbstowcs.c (mbstowcs): Add cast.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2023-02-12 23:02:24 +01:00
parent b28f42de07
commit 43fe67e2f9
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
4 changed files with 9 additions and 8 deletions

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -27,7 +27,7 @@ ssize_t
read (int filedes, void *buffer, size_t size)
{
long long_filedes = filedes;
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, buffer, size);
ssize_t bytes = _sys_call3 (SYS_read, long_filedes, (long) buffer, (long) size);
if (__mes_debug () > 4)
{
if (bytes == 1)

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018,2019,2022 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2019,2022,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -36,7 +36,7 @@ sighandler_t
signal (int signum, sighandler_t action)
{
#if __i386__
return _sys_call2 (SYS_signal, signum, action);
return (sighandler_t) _sys_call2 (SYS_signal, signum, (long) action);
#else
static struct sigaction setup_action = { 0 };
static struct sigaction old = { 0 };

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -22,6 +22,7 @@
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
int
vfscanf (FILE * stream, char const *template, va_list ap)
@ -76,7 +77,7 @@ vfscanf (FILE * stream, char const *template, va_list ap)
ungetc (p, stream);
*q = 0;
q = buf;
*d = abtol (&q, 10);
*d = abtol ((char const**)&q, 10);
count++;
break;
}

View File

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2018,2023 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -30,6 +30,6 @@ mbstowcs (wchar_t * wstring, char const *string, size_t size)
if (__mes_debug () && !stub)
eputs ("mbstowcs stub\n");
stub = 1;
strcpy (wstring, string);
strcpy ((char*)wstring, string);
return strlen (string);
}