mescc: Mes C Library: Fix compile warnings.

* include/libmes.h (dtoab, itoa, ltoa, ntoab, ultoa, utoa): Return
char* (WAS: char const*).
* lib/*/*c: Update, add missing includes.
This commit is contained in:
Jan Nieuwenhuizen 2019-03-03 10:04:33 +01:00
parent c5e098bc35
commit 66019c8421
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
12 changed files with 33 additions and 28 deletions

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -24,13 +24,17 @@
#include <libmes-mini.h>
int __mes_debug ();
long abtol (char const** p, int base);
char const* ntoab (long number, int base, int signed_p);
char const* itoa (int number);
char const* ltoa (long number);
char const* ultoa (unsigned long number);
char const* utoa (unsigned number);
char const* ltoab (long x, int base);
void __ungetc_init ();
void __ungetc_clear (int filedes);
void __ungetc_set (int filedes, int c);
int __ungetc_p (int filedes);
long abtol (char const **p, int base);
char *itoa (int number);
char *ltoa (long number);
char *ltoab (long x, int base);
char *ntoab (long number, int base, int signed_p);
char *ultoa (unsigned long number);
char *utoa (unsigned number);
int atoi (char const *s);
int eputc (int c);
int fdgetc (int fd);

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -31,7 +31,7 @@
#define __FOO_VARARGS 1
#endif
typedef long va_list;
typedef char *va_list;
#define va_start(ap, last) (void)((ap) = (char*)(&(last) + 1))
#define va_arg(ap, type) (type)(((long*)((ap) = ((ap) + sizeof (void*))))[-1])
#define va_end(ap) (void)((ap) = 0)

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -31,6 +31,7 @@
#include <sys/types.h>
#include <alloca.h>
double atof (char const *s);
int atoi (char const *s);
int atexit (void (*function) (void));
void * calloc (size_t nmemb, size_t size);

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <libmes.h>
char const*
char *
itoa (int x)
{
return ntoab (x, 10, 1);

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,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <libmes.h>
char const*
char *
ltoa (long x)
{
return ntoab (x, 10, 1);

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <libmes.h>
char const*
char *
ltoab (long x, int base)
{
return ntoab (x, base, 1);

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <libmes.h>
char const*
char *
ntoab (long x, int base, int signed_p)
{
static char itoa_buf[20];

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,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <libmes.h>
char const*
char *
ultoa (unsigned long x)
{
return ntoab (x, 10, 1);

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2016,2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -20,7 +20,7 @@
#include <libmes.h>
char const*
char *
utoa (unsigned x)
{
return ntoab (x, 10, 0);

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -24,5 +24,5 @@
int
vprintf (char const* format, va_list ap)
{
return vfprintf (STDOUT, format, ap);
return vfprintf (stdout, format, ap);
}

View file

@ -1,6 +1,6 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2017,2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2017,2018,2019 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
*
* This file is part of GNU Mes.
*
@ -18,8 +18,8 @@
* along with GNU Mes. If not, see <http://www.gnu.org/licenses/>.
*/
#include <limits.h>
#include <stdarg.h>
#include <stdio.h>
int
vsprintf (char *str, char const* format, va_list ap)