aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdlib
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2017-12-03 20:25:16 -0600
committerYaakov Selkowitz <yselkowi@redhat.com>2018-01-17 11:47:08 -0600
commit0bda30e1ffd23488aa4a9b73f228089463fbee1a (patch)
treeb0efb851be762c4d530cc259070005318702321d /newlib/libc/stdlib
parent6783860a2e4e4183c073f62e4bb938cea0e096c3 (diff)
downloadnewlib-0bda30e1ffd23488aa4a9b73f228089463fbee1a.zip
newlib-0bda30e1ffd23488aa4a9b73f228089463fbee1a.tar.gz
newlib-0bda30e1ffd23488aa4a9b73f228089463fbee1a.tar.bz2
ansification: remove _CONST
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r--newlib/libc/stdlib/__exp10.c2
-rw-r--r--newlib/libc/stdlib/atof.c2
-rw-r--r--newlib/libc/stdlib/atoff.c2
-rw-r--r--newlib/libc/stdlib/atoi.c4
-rw-r--r--newlib/libc/stdlib/atol.c4
-rw-r--r--newlib/libc/stdlib/atoll.c4
-rw-r--r--newlib/libc/stdlib/gdtoa-gethex.c6
-rw-r--r--newlib/libc/stdlib/gdtoa-hexnan.c12
-rw-r--r--newlib/libc/stdlib/getenv.c4
-rw-r--r--newlib/libc/stdlib/getenv_r.c6
-rw-r--r--newlib/libc/stdlib/ldtoa.c108
-rw-r--r--newlib/libc/stdlib/mprec.c14
-rw-r--r--newlib/libc/stdlib/mprec.h12
-rw-r--r--newlib/libc/stdlib/setenv.c6
-rw-r--r--newlib/libc/stdlib/setenv_r.c6
-rw-r--r--newlib/libc/stdlib/strtod.c14
-rw-r--r--newlib/libc/stdlib/strtol.c4
-rw-r--r--newlib/libc/stdlib/strtoll.c6
-rw-r--r--newlib/libc/stdlib/strtoul.c4
-rw-r--r--newlib/libc/stdlib/strtoull.c4
-rw-r--r--newlib/libc/stdlib/system.c10
-rw-r--r--newlib/libc/stdlib/wcstod.c8
-rw-r--r--newlib/libc/stdlib/wcstol.c4
-rw-r--r--newlib/libc/stdlib/wcstoll.c4
-rw-r--r--newlib/libc/stdlib/wcstoul.c4
-rw-r--r--newlib/libc/stdlib/wcstoull.c4
26 files changed, 129 insertions, 129 deletions
diff --git a/newlib/libc/stdlib/__exp10.c b/newlib/libc/stdlib/__exp10.c
index 4e368b8..1ff81a6 100644
--- a/newlib/libc/stdlib/__exp10.c
+++ b/newlib/libc/stdlib/__exp10.c
@@ -9,7 +9,7 @@ double
_DEFUN (__exp10, (x),
unsigned x)
{
- static _CONST double powtab[] =
+ static const double powtab[] =
{1.0,
10.0,
100.0,
diff --git a/newlib/libc/stdlib/atof.c b/newlib/libc/stdlib/atof.c
index 4653d4f..7dfbd9c 100644
--- a/newlib/libc/stdlib/atof.c
+++ b/newlib/libc/stdlib/atof.c
@@ -58,7 +58,7 @@ Supporting OS subroutines required: <<close>>, <<fstat>>, <<isatty>>,
double
_DEFUN (atof, (s),
- _CONST char *s)
+ const char *s)
{
return strtod (s, NULL);
}
diff --git a/newlib/libc/stdlib/atoff.c b/newlib/libc/stdlib/atoff.c
index c97b78f..2966254 100644
--- a/newlib/libc/stdlib/atoff.c
+++ b/newlib/libc/stdlib/atoff.c
@@ -3,7 +3,7 @@
float
_DEFUN (atoff, (s),
- _CONST char *s)
+ const char *s)
{
return strtof (s, NULL);
}
diff --git a/newlib/libc/stdlib/atoi.c b/newlib/libc/stdlib/atoi.c
index 936b381..83ad241 100644
--- a/newlib/libc/stdlib/atoi.c
+++ b/newlib/libc/stdlib/atoi.c
@@ -48,7 +48,7 @@ No supporting OS subroutines are required.
#ifndef _REENT_ONLY
int
_DEFUN (atoi, (s),
- _CONST char *s)
+ const char *s)
{
return (int) strtol (s, NULL, 10);
}
@@ -57,7 +57,7 @@ _DEFUN (atoi, (s),
int
_DEFUN (_atoi_r, (s),
struct _reent *ptr,
- _CONST char *s)
+ const char *s)
{
return (int) _strtol_r (ptr, s, NULL, 10);
}
diff --git a/newlib/libc/stdlib/atol.c b/newlib/libc/stdlib/atol.c
index 8c2f556..cad512f 100644
--- a/newlib/libc/stdlib/atol.c
+++ b/newlib/libc/stdlib/atol.c
@@ -7,14 +7,14 @@
#ifndef _REENT_ONLY
long
-_DEFUN (atol, (s), _CONST char *s)
+_DEFUN (atol, (s), const char *s)
{
return strtol (s, NULL, 10);
}
#endif /* !_REENT_ONLY */
long
-_DEFUN (_atol_r, (ptr, s), struct _reent *ptr, _CONST char *s)
+_DEFUN (_atol_r, (ptr, s), struct _reent *ptr, const char *s)
{
return _strtol_r (ptr, s, NULL, 10);
}
diff --git a/newlib/libc/stdlib/atoll.c b/newlib/libc/stdlib/atoll.c
index d0d4983..e853f25 100644
--- a/newlib/libc/stdlib/atoll.c
+++ b/newlib/libc/stdlib/atoll.c
@@ -70,7 +70,7 @@ No supporting OS subroutines are required.
#ifndef _REENT_ONLY
long long
_DEFUN(atoll, (str),
- _CONST char *str)
+ const char *str)
{
return strtoll(str, (char **)NULL, 10);
}
@@ -79,7 +79,7 @@ _DEFUN(atoll, (str),
long long
_DEFUN(_atoll_r, (ptr, str),
struct _reent *ptr,
- _CONST char *str)
+ const char *str)
{
return _strtoll_r(ptr, str, (char **)NULL, 10);
}
diff --git a/newlib/libc/stdlib/gdtoa-gethex.c b/newlib/libc/stdlib/gdtoa-gethex.c
index 931ced3..18d9cc1 100644
--- a/newlib/libc/stdlib/gdtoa-gethex.c
+++ b/newlib/libc/stdlib/gdtoa-gethex.c
@@ -38,7 +38,7 @@ THIS SOFTWARE.
#include "gd_qnan.h"
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG)
-_CONST unsigned char __hexdig[256]=
+const unsigned char __hexdig[256]=
{
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
@@ -149,7 +149,7 @@ gethex (struct _reent *ptr, const char **sp, const FPI *fpi,
Long *exp, _Bigint **bp, int sign, locale_t loc)
{
_Bigint *b;
- _CONST unsigned char *decpt, *s0, *s, *s1;
+ const unsigned char *decpt, *s0, *s, *s1;
int esign, havedig, irv, k, n, nbits, up, zret;
__ULong L, lostbits, *x;
Long e, e1;
@@ -159,7 +159,7 @@ gethex (struct _reent *ptr, const char **sp, const FPI *fpi,
unsigned char decp_end = decimalpoint[decp_len - 1];
havedig = 0;
- s0 = *(_CONST unsigned char **)sp + 2;
+ s0 = *(const unsigned char **)sp + 2;
while(s0[havedig] == '0')
havedig++;
s0 += havedig;
diff --git a/newlib/libc/stdlib/gdtoa-hexnan.c b/newlib/libc/stdlib/gdtoa-hexnan.c
index 22033d9..fa98646 100644
--- a/newlib/libc/stdlib/gdtoa-hexnan.c
+++ b/newlib/libc/stdlib/gdtoa-hexnan.c
@@ -46,11 +46,11 @@ THIS SOFTWARE.
#ifdef INFNAN_CHECK
int
_DEFUN (match, (sp, t),
- _CONST char **sp,
+ const char **sp,
char *t)
{
int c, d;
- _CONST char *s = *sp;
+ const char *s = *sp;
while( (d = *t++) !=0) {
if ((c = *++s) >= 'A' && c <= 'Z')
@@ -81,12 +81,12 @@ _DEFUN (L_shift, (x, x1, i),
int
_DEFUN (hexnan, (sp, fpi, x0),
- _CONST char **sp,
- _CONST FPI *fpi,
+ const char **sp,
+ const FPI *fpi,
__ULong *x0)
{
__ULong c, h, *x, *x1, *xe;
- _CONST char *s;
+ const char *s;
int havedig, hd0, i, nbits;
nbits = fpi->nbits;
@@ -97,7 +97,7 @@ _DEFUN (hexnan, (sp, fpi, x0),
x1 = xe = x;
havedig = hd0 = i = 0;
s = *sp;
- while((c = *(_CONST unsigned char*)++s)) {
+ while((c = *(const unsigned char*)++s)) {
if (!(h = __get_hexdig(c))) {
if (c <= ' ') {
if (hd0 < havedig) {
diff --git a/newlib/libc/stdlib/getenv.c b/newlib/libc/stdlib/getenv.c
index 2d394e2..973a547 100644
--- a/newlib/libc/stdlib/getenv.c
+++ b/newlib/libc/stdlib/getenv.c
@@ -65,7 +65,7 @@ variables vary from one system to another.
char *
_DEFUN (_findenv, (name, offset),
- register _CONST char *name,
+ register const char *name,
int *offset)
{
return _findenv_r (_REENT, name, offset);
@@ -78,7 +78,7 @@ _DEFUN (_findenv, (name, offset),
char *
_DEFUN (getenv, (name),
- _CONST char *name)
+ const char *name)
{
int offset;
diff --git a/newlib/libc/stdlib/getenv_r.c b/newlib/libc/stdlib/getenv_r.c
index b34c2a9..315d283 100644
--- a/newlib/libc/stdlib/getenv_r.c
+++ b/newlib/libc/stdlib/getenv_r.c
@@ -76,12 +76,12 @@ static char ***p_environ = &environ;
char *
_DEFUN (_findenv_r, (reent_ptr, name, offset),
struct _reent *reent_ptr,
- register _CONST char *name,
+ register const char *name,
int *offset)
{
register int len;
register char **p;
- _CONST char *c;
+ const char *c;
ENV_LOCK;
@@ -121,7 +121,7 @@ _DEFUN (_findenv_r, (reent_ptr, name, offset),
char *
_DEFUN (_getenv_r, (reent_ptr, name),
struct _reent *reent_ptr,
- _CONST char *name)
+ const char *name)
{
int offset;
diff --git a/newlib/libc/stdlib/ldtoa.c b/newlib/libc/stdlib/ldtoa.c
index a44413c..10a7537 100644
--- a/newlib/libc/stdlib/ldtoa.c
+++ b/newlib/libc/stdlib/ldtoa.c
@@ -61,13 +61,13 @@ typedef struct
unsigned short equot[NI];
} LDPARMS;
-static void esub (_CONST short unsigned int *a, _CONST short unsigned int *b,
+static void esub (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, LDPARMS * ldp);
-static void emul (_CONST short unsigned int *a, _CONST short unsigned int *b,
+static void emul (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, LDPARMS * ldp);
-static void ediv (_CONST short unsigned int *a, _CONST short unsigned int *b,
+static void ediv (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, LDPARMS * ldp);
-static int ecmp (_CONST short unsigned int *a, _CONST short unsigned int *b);
+static int ecmp (const short unsigned int *a, const short unsigned int *b);
static int enormlz (short unsigned int *x);
static int eshift (short unsigned int *x, int sc);
static void eshup1 (register short unsigned int *x);
@@ -77,7 +77,7 @@ static void eshdn1 (register short unsigned int *x);
static void eshdn8 (register short unsigned int *x);
static void eshdn6 (register short unsigned int *x);
static void eneg (short unsigned int *x);
-static void emov (register _CONST short unsigned int *a,
+static void emov (register const short unsigned int *a,
register short unsigned int *b);
static void eclear (register short unsigned int *x);
static void einfin (register short unsigned int *x, register LDPARMS * ldp);
@@ -111,24 +111,24 @@ static void e113toe (short unsigned int *pe, short unsigned int *y,
#if NE == 10
/* 0.0 */
-static _CONST unsigned short ezero[NE] = { 0x0000, 0x0000, 0x0000, 0x0000,
+static const unsigned short ezero[NE] = { 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
};
/* 1.0E0 */
-static _CONST unsigned short eone[NE] = { 0x0000, 0x0000, 0x0000, 0x0000,
+static const unsigned short eone[NE] = { 0x0000, 0x0000, 0x0000, 0x0000,
0x0000, 0x0000, 0x0000, 0x0000, 0x8000, 0x3fff,
};
#else
/* 0.0 */
-static _CONST unsigned short ezero[NE] = {
+static const unsigned short ezero[NE] = {
0, 0000000, 0000000, 0000000, 0000000, 0000000,
};
/* 1.0E0 */
-static _CONST unsigned short eone[NE] = {
+static const unsigned short eone[NE] = {
0, 0000000, 0000000, 0000000, 0100000, 0x3fff,
};
@@ -140,7 +140,7 @@ static _CONST unsigned short eone[NE] = {
* messages is bound to the error codes defined
* in mconf.h.
*/
-static _CONST char *_CONST ermsg[7] = {
+static const char *const ermsg[7] = {
"unknown", /* error code 0 */
"domain", /* error code 1 */
"singularity", /* et seq. */
@@ -432,17 +432,17 @@ static int edivm (short unsigned int *den, short unsigned int *num,
LDPARMS * ldp);
static int emulm (short unsigned int *a, short unsigned int *b,
LDPARMS * ldp);
-static int eisneg (_CONST short unsigned int *x);
-static int eisinf (_CONST short unsigned int *x);
-static void emovi (_CONST short unsigned int *a, short unsigned int *b);
+static int eisneg (const short unsigned int *x);
+static int eisinf (const short unsigned int *x);
+static void emovi (const short unsigned int *a, short unsigned int *b);
static void emovo (short unsigned int *a, short unsigned int *b,
LDPARMS * ldp);
static void emovz (register short unsigned int *a,
register short unsigned int *b);
static void ecleaz (register short unsigned int *xi);
-static void eadd1 (_CONST short unsigned int *a, _CONST short unsigned int *b,
+static void eadd1 (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, int subflg, LDPARMS * ldp);
-static int eisnan (_CONST short unsigned int *x);
+static int eisnan (const short unsigned int *x);
static int eiisnan (short unsigned int *x);
#ifdef DEC
@@ -473,7 +473,7 @@ eclear (register short unsigned int *x)
*/
static void
-emov (register _CONST short unsigned int *a, register short unsigned int *b)
+emov (register const short unsigned int *a, register short unsigned int *b)
{
register int i;
@@ -506,7 +506,7 @@ eneg (short unsigned int *x)
* else return zero.
*/
static int
-eisneg (_CONST short unsigned int *x)
+eisneg (const short unsigned int *x)
{
#ifdef NANS
@@ -524,7 +524,7 @@ eisneg (_CONST short unsigned int *x)
* else return zero.
*/
static int
-eisinf (_CONST short unsigned int *x)
+eisinf (const short unsigned int *x)
{
if ((x[NE - 1] & 0x7fff) == 0x7fff)
@@ -542,7 +542,7 @@ eisinf (_CONST short unsigned int *x)
/* Check if e-type number is not a number.
*/
static int
-eisnan (_CONST short unsigned int *x)
+eisnan (const short unsigned int *x)
{
#ifdef NANS
@@ -612,9 +612,9 @@ einfin (register short unsigned int *x, register LDPARMS * ldp)
* converting it to internal format.
*/
static void
-emovi (_CONST short unsigned int *a, short unsigned int *b)
+emovi (const short unsigned int *a, short unsigned int *b)
{
- register _CONST unsigned short *p;
+ register const unsigned short *p;
register unsigned short *q;
int i;
@@ -1421,7 +1421,7 @@ mdfin:
*/
static void
-esub (_CONST short unsigned int *a, _CONST short unsigned int *b,
+esub (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, LDPARMS * ldp)
{
@@ -1452,7 +1452,7 @@ esub (_CONST short unsigned int *a, _CONST short unsigned int *b,
static void
-eadd1 (_CONST short unsigned int *a, _CONST short unsigned int *b,
+eadd1 (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, int subflg, LDPARMS * ldp)
{
unsigned short ai[NI], bi[NI], ci[NI];
@@ -1563,7 +1563,7 @@ done:
; ediv( a, b, c, ldp ); c = b / a
*/
static void
-ediv (_CONST short unsigned int *a, _CONST short unsigned int *b,
+ediv (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, LDPARMS * ldp)
{
unsigned short ai[NI], bi[NI];
@@ -1669,7 +1669,7 @@ dnzro2:
; emul( a, b, c, ldp ); c = b * a
*/
static void
-emul (_CONST short unsigned int *a, _CONST short unsigned int *b,
+emul (const short unsigned int *a, const short unsigned int *b,
short unsigned int *c, LDPARMS * ldp)
{
unsigned short ai[NI], bi[NI];
@@ -2415,7 +2415,7 @@ toe24 (short unsigned int *x, short unsigned int *y)
* -2 if either a or b is a NaN.
*/
static int
-ecmp (_CONST short unsigned int *a, _CONST short unsigned int *b)
+ecmp (const short unsigned int *a, const short unsigned int *b)
{
unsigned short ai[NI], bi[NI];
register unsigned short *p, *q;
@@ -2627,7 +2627,7 @@ normdn:
#define MAXP 4096
#if NE == 10
-static _CONST unsigned short etens[NTEN + 1][NE] = {
+static const unsigned short etens[NTEN + 1][NE] = {
{0x6576, 0x4a92, 0x804a, 0x153f,
0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */
{0x6a32, 0xce52, 0x329a, 0x28ce,
@@ -2656,7 +2656,7 @@ static _CONST unsigned short etens[NTEN + 1][NE] = {
0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */
};
-static _CONST unsigned short emtens[NTEN + 1][NE] = {
+static const unsigned short emtens[NTEN + 1][NE] = {
{0x2030, 0xcffc, 0xa1c3, 0x8123,
0x2de3, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */
{0x8264, 0xd2cb, 0xf2ea, 0x12d4,
@@ -2685,7 +2685,7 @@ static _CONST unsigned short emtens[NTEN + 1][NE] = {
0xcccc, 0xcccc, 0xcccc, 0xcccc, 0xcccc, 0x3ffb,}, /* 10**-1 */
};
#else
-static _CONST unsigned short etens[NTEN + 1][NE] = {
+static const unsigned short etens[NTEN + 1][NE] = {
{0xc94c, 0x979a, 0x8a20, 0x5202, 0xc460, 0x7525,}, /* 10**4096 */
{0xa74d, 0x5de4, 0xc53d, 0x3b5d, 0x9e8b, 0x5a92,}, /* 10**2048 */
{0x650d, 0x0c17, 0x8175, 0x7586, 0xc976, 0x4d48,},
@@ -2701,7 +2701,7 @@ static _CONST unsigned short etens[NTEN + 1][NE] = {
{0x0000, 0x0000, 0x0000, 0x0000, 0xa000, 0x4002,}, /* 10**1 */
};
-static _CONST unsigned short emtens[NTEN + 1][NE] = {
+static const unsigned short emtens[NTEN + 1][NE] = {
{0x2de4, 0x9fde, 0xd2ce, 0x04c8, 0xa6dd, 0x0ad8,}, /* 10**-4096 */
{0x4925, 0x2de4, 0x3436, 0x534f, 0xceae, 0x256b,}, /* 10**-2048 */
{0x87a6, 0xc0bd, 0xda57, 0x82a5, 0xa2a6, 0x32b5,},
@@ -2973,7 +2973,7 @@ etoasc (short unsigned int *x, char *string, int ndigits, int outformat,
{
long digit;
unsigned short y[NI], t[NI], u[NI], w[NI];
- _CONST unsigned short *p, *r, *ten;
+ const unsigned short *p, *r, *ten;
unsigned short sign;
int i, j, k, expon, rndsav, ndigs;
char *s, *ss;
@@ -3328,7 +3328,7 @@ asctoeg (char *ss, short unsigned int *y, int oprec, LDPARMS * ldp)
int k, trail, c, rndsav;
long lexp;
unsigned short nsign;
- _CONST unsigned short *p;
+ const unsigned short *p;
char *sp, *s, *lstr;
int lenldstr;
int mflag = 0;
@@ -3654,7 +3654,7 @@ aexit:
*
* efloor( x, y, ldp );
*/
-static _CONST unsigned short bmask[] = {
+static const unsigned short bmask[] = {
0xffff,
0xfffe,
0xfffc,
@@ -3756,47 +3756,47 @@ eiremain (short unsigned int *den, short unsigned int *num, LDPARMS * ldp)
*/
#ifdef MIEEE
#if !defined(__mips)
-static _CONST unsigned short nan113[8] = {
+static const unsigned short nan113[8] = {
0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
};
-static _CONST unsigned short nan64[6] = {
+static const unsigned short nan64[6] = {
0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
};
-static _CONST unsigned short nan53[4] = { 0x7fff, 0xffff, 0xffff, 0xffff };
-static _CONST unsigned short nan24[2] = { 0x7fff, 0xffff };
+static const unsigned short nan53[4] = { 0x7fff, 0xffff, 0xffff, 0xffff };
+static const unsigned short nan24[2] = { 0x7fff, 0xffff };
#elif defined(__mips_nan2008) /* __mips */
-static _CONST unsigned short nan113[8] = { 0x7fff, 0x8000, 0, 0, 0, 0, 0, 0 };
-static _CONST unsigned short nan64[6] = { 0x7fff, 0xc000, 0, 0, 0, 0 };
-static _CONST unsigned short nan53[4] = { 0x7ff8, 0, 0, 0 };
-static _CONST unsigned short nan24[2] = { 0x7fc0, 0 };
+static const unsigned short nan113[8] = { 0x7fff, 0x8000, 0, 0, 0, 0, 0, 0 };
+static const unsigned short nan64[6] = { 0x7fff, 0xc000, 0, 0, 0, 0 };
+static const unsigned short nan53[4] = { 0x7ff8, 0, 0, 0 };
+static const unsigned short nan24[2] = { 0x7fc0, 0 };
#else /* __mips && !__mips_nan2008 */
-static _CONST unsigned short nan113[8] = {
+static const unsigned short nan113[8] = {
0x7fff, 0x7fff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff
};
-static _CONST unsigned short nan64[6] = {
+static const unsigned short nan64[6] = {
0x7fff, 0xbfff, 0xffff, 0xffff, 0xffff, 0xffff
};
-static _CONST unsigned short nan53[4] = { 0x7ff7, 0xffff, 0xffff, 0xffff };
-static _CONST unsigned short nan24[2] = { 0x7fbf, 0xffff };
+static const unsigned short nan53[4] = { 0x7ff7, 0xffff, 0xffff, 0xffff };
+static const unsigned short nan24[2] = { 0x7fbf, 0xffff };
#endif /* __mips && !__mips_nan2008 */
#else /* !MIEEE */
#if !defined(__mips) || defined(__mips_nan2008)
-static _CONST unsigned short nan113[8] = { 0, 0, 0, 0, 0, 0, 0x8000, 0x7fff };
-static _CONST unsigned short nan64[6] = { 0, 0, 0, 0, 0xc000, 0x7fff };
-static _CONST unsigned short nan53[4] = { 0, 0, 0, 0x7ff8 };
-static _CONST unsigned short nan24[2] = { 0, 0x7fc0 };
+static const unsigned short nan113[8] = { 0, 0, 0, 0, 0, 0, 0x8000, 0x7fff };
+static const unsigned short nan64[6] = { 0, 0, 0, 0, 0xc000, 0x7fff };
+static const unsigned short nan53[4] = { 0, 0, 0, 0x7ff8 };
+static const unsigned short nan24[2] = { 0, 0x7fc0 };
#else /* __mips && !__mips_nan2008 */
-static _CONST unsigned short nan113[8] = {
+static const unsigned short nan113[8] = {
0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0x7fff, 0x7fff
};
-static _CONST unsigned short nan64[6] = {
+static const unsigned short nan64[6] = {
0xffff, 0xffff, 0xffff, 0xffff, 0xbfff, 0x7fff
};
-static _CONST unsigned short nan53[4] = { 0xffff, 0xffff, 0xffff, 0x7ff7 };
-static _CONST unsigned short nan24[2] = { 0xffff, 0x7fbf };
+static const unsigned short nan53[4] = { 0xffff, 0xffff, 0xffff, 0x7ff7 };
+static const unsigned short nan24[2] = { 0xffff, 0x7fbf };
#endif /* __mips && !__mips_nan2008 */
#endif /* !MIEEE */
@@ -3805,7 +3805,7 @@ static void
enan (short unsigned int *nan, int size)
{
int i, n;
- _CONST unsigned short *p;
+ const unsigned short *p;
switch (size)
{
diff --git a/newlib/libc/stdlib/mprec.c b/newlib/libc/stdlib/mprec.c
index cb6866d..bd1c691 100644
--- a/newlib/libc/stdlib/mprec.c
+++ b/newlib/libc/stdlib/mprec.c
@@ -193,7 +193,7 @@ _DEFUN (multadd, (ptr, b, m, a),
_Bigint *
_DEFUN (s2b, (ptr, s, nd0, nd, y9),
struct _reent * ptr,
- _CONST char *s,
+ const char *s,
int nd0,
int nd,
__ULong y9)
@@ -424,7 +424,7 @@ _DEFUN (pow5mult,
{
_Bigint *b1, *p5, *p51;
int i;
- static _CONST int p05[3] = {5, 25, 125};
+ static const int p05[3] = {5, 25, 125};
if ((i = k & 3) != 0)
b = multadd (ptr, b, p05[i - 1], 0);
@@ -951,7 +951,7 @@ _DEFUN (ratio, (a, b), _Bigint * a, _Bigint * b)
}
-_CONST double
+const double
tens[] =
{
1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9,
@@ -961,16 +961,16 @@ _CONST double
};
#if !defined(_DOUBLE_IS_32BITS) && !defined(__v800)
-_CONST double bigtens[] =
+const double bigtens[] =
{1e16, 1e32, 1e64, 1e128, 1e256};
-_CONST double tinytens[] =
+const double tinytens[] =
{1e-16, 1e-32, 1e-64, 1e-128, 1e-256};
#else
-_CONST double bigtens[] =
+const double bigtens[] =
{1e16, 1e32};
-_CONST double tinytens[] =
+const double tinytens[] =
{1e-16, 1e-32};
#endif
diff --git a/newlib/libc/stdlib/mprec.h b/newlib/libc/stdlib/mprec.h
index 330c398..a98120a 100644
--- a/newlib/libc/stdlib/mprec.h
+++ b/newlib/libc/stdlib/mprec.h
@@ -401,7 +401,7 @@ _Bigint * _EXFUN(lshift,(struct _reent *p, _Bigint *b, int k));
int _EXFUN(match,(const char**, char*));
_Bigint * _EXFUN(diff,(struct _reent *p, _Bigint *a, _Bigint *b));
int _EXFUN(cmp,(_Bigint *a, _Bigint *b));
-int _EXFUN(gethex,(struct _reent *p, _CONST char **sp, _CONST struct FPI *fpi, Long *exp, _Bigint **bp, int sign, locale_t loc));
+int _EXFUN(gethex,(struct _reent *p, const char **sp, const struct FPI *fpi, Long *exp, _Bigint **bp, int sign, locale_t loc));
double _EXFUN(ratio,(_Bigint *a, _Bigint *b));
__ULong _EXFUN(any_on,(_Bigint *b, int k));
void _EXFUN(copybits,(__ULong *c, int n, _Bigint *b));
@@ -419,16 +419,16 @@ int _strtodg_l (struct _reent *p, const char *s00, char **se,
unsigned char _EXFUN(__hexdig_fun,(unsigned char));
#endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */
#ifdef INFNAN_CHECK
-int _EXFUN(hexnan,(_CONST char **sp, _CONST struct FPI *fpi, __ULong *x0));
+int _EXFUN(hexnan,(const char **sp, const struct FPI *fpi, __ULong *x0));
#endif
#define Bcopy(x,y) memcpy((char *)&x->_sign, (char *)&y->_sign, y->_wds*sizeof(__Long) + 2*sizeof(int))
-extern _CONST double tinytens[];
-extern _CONST double bigtens[];
-extern _CONST double tens[];
+extern const double tinytens[];
+extern const double bigtens[];
+extern const double tens[];
#if !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG)
-extern _CONST unsigned char __hexdig[];
+extern const unsigned char __hexdig[];
#endif /* !defined(PREFER_SIZE_OVER_SPEED) && !defined(__OPTIMIZE_SIZE__) && !defined(_SMALL_HEXDIG) */
diff --git a/newlib/libc/stdlib/setenv.c b/newlib/libc/stdlib/setenv.c
index 7e89494..c963a33 100644
--- a/newlib/libc/stdlib/setenv.c
+++ b/newlib/libc/stdlib/setenv.c
@@ -33,8 +33,8 @@ extern int _unsetenv_r _PARAMS ((struct _reent *, const char *));
int
_DEFUN (setenv, (name, value, rewrite),
- _CONST char *name,
- _CONST char *value,
+ const char *name,
+ const char *value,
int rewrite)
{
return _setenv_r (_REENT, name, value, rewrite);
@@ -46,7 +46,7 @@ _DEFUN (setenv, (name, value, rewrite),
*/
int
_DEFUN (unsetenv, (name),
- _CONST char *name)
+ const char *name)
{
return _unsetenv_r (_REENT, name);
}
diff --git a/newlib/libc/stdlib/setenv_r.c b/newlib/libc/stdlib/setenv_r.c
index 75f2173..b3bc1fc 100644
--- a/newlib/libc/stdlib/setenv_r.c
+++ b/newlib/libc/stdlib/setenv_r.c
@@ -51,8 +51,8 @@ extern char *_findenv_r _PARAMS ((struct _reent *, const char *, int *));
int
_DEFUN (_setenv_r, (reent_ptr, name, value, rewrite),
struct _reent *reent_ptr,
- _CONST char *name,
- _CONST char *value,
+ const char *name,
+ const char *value,
int rewrite)
{
static int alloced; /* if allocated space before */
@@ -135,7 +135,7 @@ _DEFUN (_setenv_r, (reent_ptr, name, value, rewrite),
int
_DEFUN (_unsetenv_r, (reent_ptr, name),
struct _reent *reent_ptr,
- _CONST char *name)
+ const char *name)
{
register char **P;
int offset;
diff --git a/newlib/libc/stdlib/strtod.c b/newlib/libc/stdlib/strtod.c
index e3c9b7f..1abff4f 100644
--- a/newlib/libc/stdlib/strtod.c
+++ b/newlib/libc/stdlib/strtod.c
@@ -152,7 +152,7 @@ THIS SOFTWARE.
#undef tinytens
/* The factor of 2^106 in tinytens[4] helps us avoid setting the underflow */
/* flag unnecessarily. It leads to a song and dance at the end of strtod. */
-static _CONST double tinytens[] = { 1e-16, 1e-32,
+static const double tinytens[] = { 1e-16, 1e-32,
#ifdef _DOUBLE_IS_32BITS
0.0, 0.0, 0.0
#else
@@ -243,7 +243,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se,
#endif
int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, decpt, dsign,
e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign;
- _CONST char *s, *s0, *s1;
+ const char *s, *s0, *s1;
double aadj, adj;
U aadj1, rv, rv0;
Long L;
@@ -288,7 +288,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se,
if (*s == '0') {
#ifndef NO_HEX_FP
{
- static _CONST FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI };
+ static const FPI fpi = { 53, 1-1023-53+1, 2046-1023-53+1, 1, SI };
Long exp;
__ULong bits[2];
switch(s[1]) {
@@ -415,7 +415,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se,
#ifdef INFNAN_CHECK
/* Check for Nan and Infinity */
__ULong bits[2];
- static _CONST FPI fpinan = /* only 52 explicit bits */
+ static const FPI fpinan = /* only 52 explicit bits */
{ 52, 1-1023-53+1, 2046-1023-53+1, 1, SI };
if (!decpt)
switch(c) {
@@ -1254,7 +1254,7 @@ _strtod_l (struct _reent *ptr, const char *__restrict s00, char **__restrict se,
double
_DEFUN (_strtod_r, (ptr, s00, se),
struct _reent *ptr,
- _CONST char *__restrict s00,
+ const char *__restrict s00,
char **__restrict se)
{
return _strtod_l (ptr, s00, se, __get_current_locale ());
@@ -1270,7 +1270,7 @@ strtod_l (const char *__restrict s00, char **__restrict se, locale_t loc)
double
_DEFUN (strtod, (s00, se),
- _CONST char *__restrict s00, char **__restrict se)
+ const char *__restrict s00, char **__restrict se)
{
return _strtod_l (_REENT, s00, se, __get_current_locale ());
}
@@ -1291,7 +1291,7 @@ strtof_l (const char *__restrict s00, char **__restrict se, locale_t loc)
float
_DEFUN (strtof, (s00, se),
- _CONST char *__restrict s00,
+ const char *__restrict s00,
char **__restrict se)
{
double val = _strtod_l (_REENT, s00, se, __get_current_locale ());
diff --git a/newlib/libc/stdlib/strtol.c b/newlib/libc/stdlib/strtol.c
index 7ffa6a9..a366680 100644
--- a/newlib/libc/stdlib/strtol.c
+++ b/newlib/libc/stdlib/strtol.c
@@ -214,7 +214,7 @@ _strtol_l (struct _reent *rptr, const char *__restrict nptr,
long
_DEFUN (_strtol_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST char *__restrict nptr,
+ const char *__restrict nptr,
char **__restrict endptr,
int base)
{
@@ -232,7 +232,7 @@ strtol_l (const char *__restrict s, char **__restrict ptr, int base,
long
_DEFUN (strtol, (s, ptr, base),
- _CONST char *__restrict s,
+ const char *__restrict s,
char **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/strtoll.c b/newlib/libc/stdlib/strtoll.c
index 5175265..9fc8323 100644
--- a/newlib/libc/stdlib/strtoll.c
+++ b/newlib/libc/stdlib/strtoll.c
@@ -133,7 +133,7 @@ No supporting OS subroutines are required.
* Convert a string to a long long integer.
*/
static long long
-_strtoll_l (struct _reent *rptr, _CONST char *__restrict nptr,
+_strtoll_l (struct _reent *rptr, const char *__restrict nptr,
char **__restrict endptr, int base, locale_t loc)
{
register const unsigned char *s = (const unsigned char *)nptr;
@@ -216,7 +216,7 @@ _strtoll_l (struct _reent *rptr, _CONST char *__restrict nptr,
long long
_DEFUN (_strtoll_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST char *__restrict nptr,
+ const char *__restrict nptr,
char **__restrict endptr,
int base)
{
@@ -234,7 +234,7 @@ strtoll_l (const char *__restrict s, char **__restrict ptr, int base,
long long
_DEFUN (strtoll, (s, ptr, base),
- _CONST char *__restrict s,
+ const char *__restrict s,
char **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/strtoul.c b/newlib/libc/stdlib/strtoul.c
index e184722..5a816da 100644
--- a/newlib/libc/stdlib/strtoul.c
+++ b/newlib/libc/stdlib/strtoul.c
@@ -193,7 +193,7 @@ _strtoul_l (struct _reent *rptr, const char *__restrict nptr,
unsigned long
_DEFUN (_strtoul_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST char *__restrict nptr,
+ const char *__restrict nptr,
char **__restrict endptr,
int base)
{
@@ -211,7 +211,7 @@ strtoul_l (const char *__restrict s, char **__restrict ptr, int base,
unsigned long
_DEFUN (strtoul, (s, ptr, base),
- _CONST char *__restrict s,
+ const char *__restrict s,
char **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/strtoull.c b/newlib/libc/stdlib/strtoull.c
index 4dfb28f..0f7c9e3 100644
--- a/newlib/libc/stdlib/strtoull.c
+++ b/newlib/libc/stdlib/strtoull.c
@@ -191,7 +191,7 @@ _strtoull_l (struct _reent *rptr, const char *__restrict nptr,
unsigned long long
_DEFUN (_strtoull_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST char *__restrict nptr,
+ const char *__restrict nptr,
char **__restrict endptr,
int base)
{
@@ -209,7 +209,7 @@ strtoull_l (const char *__restrict s, char **__restrict ptr, int base,
unsigned long long
_DEFUN (strtoull, (s, ptr, base),
- _CONST char *__restrict s,
+ const char *__restrict s,
char **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/system.c b/newlib/libc/stdlib/system.c
index f172e5d..0df7d60 100644
--- a/newlib/libc/stdlib/system.c
+++ b/newlib/libc/stdlib/system.c
@@ -53,13 +53,13 @@ Supporting OS subroutines required: <<_exit>>, <<_execve>>, <<_fork_r>>,
#include <reent.h>
#if defined (unix) || defined (__CYGWIN__)
-static int _EXFUN(do_system, (struct _reent *ptr, _CONST char *s));
+static int _EXFUN(do_system, (struct _reent *ptr, const char *s));
#endif
int
_DEFUN(_system_r, (ptr, s),
struct _reent *ptr,
- _CONST char *s)
+ const char *s)
{
#if defined(HAVE_SYSTEM)
return _system (s);
@@ -94,7 +94,7 @@ _DEFUN(_system_r, (ptr, s),
int
_DEFUN(system, (s),
- _CONST char *s)
+ const char *s)
{
return _system_r (_REENT, s);
}
@@ -112,7 +112,7 @@ static char ***p_environ = &environ;
static int
_DEFUN(do_system, (ptr, s),
struct _reent *ptr,
- _CONST char *s)
+ const char *s)
{
char *argv[4];
int pid, status;
@@ -144,7 +144,7 @@ _DEFUN(do_system, (ptr, s),
static int
_DEFUN(do_system, (ptr, s),
struct _reent *ptr,
- _CONST char *s)
+ const char *s)
{
char *argv[4];
int pid, status;
diff --git a/newlib/libc/stdlib/wcstod.c b/newlib/libc/stdlib/wcstod.c
index 239f8d2..8a72e6f 100644
--- a/newlib/libc/stdlib/wcstod.c
+++ b/newlib/libc/stdlib/wcstod.c
@@ -216,7 +216,7 @@ _wcstod_l (struct _reent *ptr, const wchar_t *nptr, wchar_t **endptr,
double
_DEFUN (_wcstod_r, (ptr, nptr, endptr),
struct _reent *ptr,
- _CONST wchar_t *nptr,
+ const wchar_t *nptr,
wchar_t **endptr)
{
return _wcstod_l (ptr, nptr, endptr, __get_current_locale ());
@@ -225,7 +225,7 @@ _DEFUN (_wcstod_r, (ptr, nptr, endptr),
float
_DEFUN (_wcstof_r, (ptr, nptr, endptr),
struct _reent *ptr,
- _CONST wchar_t *nptr,
+ const wchar_t *nptr,
wchar_t **endptr)
{
double retval = _wcstod_l (ptr, nptr, endptr, __get_current_locale ());
@@ -245,7 +245,7 @@ wcstod_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
double
_DEFUN (wcstod, (nptr, endptr),
- _CONST wchar_t *__restrict nptr, wchar_t **__restrict endptr)
+ const wchar_t *__restrict nptr, wchar_t **__restrict endptr)
{
return _wcstod_l (_REENT, nptr, endptr, __get_current_locale ());
}
@@ -267,7 +267,7 @@ wcstof_l (const wchar_t *__restrict nptr, wchar_t **__restrict endptr,
float
_DEFUN (wcstof, (nptr, endptr),
- _CONST wchar_t *__restrict nptr,
+ const wchar_t *__restrict nptr,
wchar_t **__restrict endptr)
{
double val = _wcstod_l (_REENT, nptr, endptr, __get_current_locale ());
diff --git a/newlib/libc/stdlib/wcstol.c b/newlib/libc/stdlib/wcstol.c
index 1f5fd4b..324d75e 100644
--- a/newlib/libc/stdlib/wcstol.c
+++ b/newlib/libc/stdlib/wcstol.c
@@ -215,7 +215,7 @@ _wcstol_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr,
long
_DEFUN (_wcstol_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST wchar_t *nptr,
+ const wchar_t *nptr,
wchar_t **endptr,
int base)
{
@@ -233,7 +233,7 @@ wcstol_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base,
long
_DEFUN (wcstol, (s, ptr, base),
- _CONST wchar_t *__restrict s,
+ const wchar_t *__restrict s,
wchar_t **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/wcstoll.c b/newlib/libc/stdlib/wcstoll.c
index be95000..00db2ad 100644
--- a/newlib/libc/stdlib/wcstoll.c
+++ b/newlib/libc/stdlib/wcstoll.c
@@ -215,7 +215,7 @@ _wcstoll_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr,
long long
_DEFUN (_wcstoll_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST wchar_t *nptr,
+ const wchar_t *nptr,
wchar_t **endptr,
int base)
{
@@ -233,7 +233,7 @@ wcstoll_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base,
long long
_DEFUN (wcstoll, (s, ptr, base),
- _CONST wchar_t *__restrict s,
+ const wchar_t *__restrict s,
wchar_t **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/wcstoul.c b/newlib/libc/stdlib/wcstoul.c
index 2470bfa..5c54ec5 100644
--- a/newlib/libc/stdlib/wcstoul.c
+++ b/newlib/libc/stdlib/wcstoul.c
@@ -194,7 +194,7 @@ _wcstoul_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr,
unsigned long
_DEFUN (_wcstoul_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST wchar_t *nptr,
+ const wchar_t *nptr,
wchar_t **endptr,
int base)
{
@@ -212,7 +212,7 @@ wcstoul_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base,
unsigned long
_DEFUN (wcstoul, (s, ptr, base),
- _CONST wchar_t *__restrict s,
+ const wchar_t *__restrict s,
wchar_t **__restrict ptr,
int base)
{
diff --git a/newlib/libc/stdlib/wcstoull.c b/newlib/libc/stdlib/wcstoull.c
index 55ab3ca..4724d61 100644
--- a/newlib/libc/stdlib/wcstoull.c
+++ b/newlib/libc/stdlib/wcstoull.c
@@ -210,7 +210,7 @@ _wcstoull_l (struct _reent *rptr, const wchar_t *nptr, wchar_t **endptr,
unsigned long long
_DEFUN (_wcstoull_r, (rptr, nptr, endptr, base),
struct _reent *rptr,
- _CONST wchar_t *nptr,
+ const wchar_t *nptr,
wchar_t **endptr,
int base)
{
@@ -228,7 +228,7 @@ wcstoull_l (const wchar_t *__restrict s, wchar_t **__restrict ptr, int base,
unsigned long long
_DEFUN (wcstoull, (s, ptr, base),
- _CONST wchar_t *__restrict s,
+ const wchar_t *__restrict s,
wchar_t **__restrict ptr,
int base)
{