aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbaselib.c4
-rw-r--r--lbitlib.c4
-rw-r--r--liolib.c6
-rw-r--r--lobject.c8
-rw-r--r--lstrlib.c4
5 files changed, 13 insertions, 13 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 87b0ce83..00452f2d 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.316 2017/05/26 19:14:29 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.317 2017/06/27 18:32:49 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -49,7 +49,7 @@ static const char *b_str2int (const char *s, int base, lua_Integer *pn) {
49 lua_Unsigned n = 0; 49 lua_Unsigned n = 0;
50 int neg = 0; 50 int neg = 0;
51 s += strspn(s, SPACECHARS); /* skip initial spaces */ 51 s += strspn(s, SPACECHARS); /* skip initial spaces */
52 if (*s == '-') { s++; neg = 1; } /* handle signal */ 52 if (*s == '-') { s++; neg = 1; } /* handle sign */
53 else if (*s == '+') s++; 53 else if (*s == '+') s++;
54 if (!isalnum((unsigned char)*s)) /* no digit? */ 54 if (!isalnum((unsigned char)*s)) /* no digit? */
55 return NULL; 55 return NULL;
diff --git a/lbitlib.c b/lbitlib.c
index 02483d69..63dbbe1d 100644
--- a/lbitlib.c
+++ b/lbitlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbitlib.c,v 1.29 2015/10/08 15:55:35 roberto Exp roberto $ 2** $Id: lbitlib.c,v 1.30 2015/11/11 19:08:09 roberto Exp roberto $
3** Standard library for bitwise operations 3** Standard library for bitwise operations
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -131,7 +131,7 @@ static int b_arshift (lua_State *L) {
131 else { /* arithmetic shift for 'negative' number */ 131 else { /* arithmetic shift for 'negative' number */
132 if (i >= LUA_NBITS) r = ALLONES; 132 if (i >= LUA_NBITS) r = ALLONES;
133 else 133 else
134 r = trim((r >> i) | ~(trim(~(lua_Unsigned)0) >> i)); /* add signal bit */ 134 r = trim((r >> i) | ~(trim(~(lua_Unsigned)0) >> i)); /* add sign bit */
135 pushunsigned(L, r); 135 pushunsigned(L, r);
136 return 1; 136 return 1;
137 } 137 }
diff --git a/liolib.c b/liolib.c
index 3fa87461..19068f87 100644
--- a/liolib.c
+++ b/liolib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: liolib.c,v 2.151 2016/12/20 18:37:00 roberto Exp roberto $ 2** $Id: liolib.c,v 2.152 2017/02/09 14:50:05 roberto Exp roberto $
3** Standard I/O (and system) library 3** Standard I/O (and system) library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -447,7 +447,7 @@ static int read_number (lua_State *L, FILE *f) {
447 decp[1] = '.'; /* always accept a dot */ 447 decp[1] = '.'; /* always accept a dot */
448 l_lockfile(rn.f); 448 l_lockfile(rn.f);
449 do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ 449 do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */
450 test2(&rn, "-+"); /* optional signal */ 450 test2(&rn, "-+"); /* optional sign */
451 if (test2(&rn, "00")) { 451 if (test2(&rn, "00")) {
452 if (test2(&rn, "xX")) hex = 1; /* numeral is hexadecimal */ 452 if (test2(&rn, "xX")) hex = 1; /* numeral is hexadecimal */
453 else count = 1; /* count initial '0' as a valid digit */ 453 else count = 1; /* count initial '0' as a valid digit */
@@ -456,7 +456,7 @@ static int read_number (lua_State *L, FILE *f) {
456 if (test2(&rn, decp)) /* decimal point? */ 456 if (test2(&rn, decp)) /* decimal point? */
457 count += readdigits(&rn, hex); /* fractional part */ 457 count += readdigits(&rn, hex); /* fractional part */
458 if (count > 0 && test2(&rn, (hex ? "pP" : "eE"))) { /* exponent mark? */ 458 if (count > 0 && test2(&rn, (hex ? "pP" : "eE"))) { /* exponent mark? */
459 test2(&rn, "-+"); /* exponent signal */ 459 test2(&rn, "-+"); /* exponent sign */
460 readdigits(&rn, 0); /* exponent digits */ 460 readdigits(&rn, 0); /* exponent digits */
461 } 461 }
462 ungetc(rn.c, rn.f); /* unread look-ahead char */ 462 ungetc(rn.c, rn.f); /* unread look-ahead char */
diff --git a/lobject.c b/lobject.c
index 32cdc4b0..fb2c172c 100644
--- a/lobject.c
+++ b/lobject.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.c,v 2.118 2017/10/10 20:05:40 roberto Exp roberto $ 2** $Id: lobject.c,v 2.119 2017/11/08 14:50:23 roberto Exp roberto $
3** Some generic functions over Lua objects 3** Some generic functions over Lua objects
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -206,7 +206,7 @@ static lua_Number lua_strx2number (const char *s, char **endptr) {
206 int hasdot = 0; /* true after seen a dot */ 206 int hasdot = 0; /* true after seen a dot */
207 *endptr = cast(char *, s); /* nothing is valid yet */ 207 *endptr = cast(char *, s); /* nothing is valid yet */
208 while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ 208 while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */
209 neg = isneg(&s); /* check signal */ 209 neg = isneg(&s); /* check sign */
210 if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */ 210 if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */
211 return 0.0; /* invalid format (no '0x') */ 211 return 0.0; /* invalid format (no '0x') */
212 for (s += 2; ; s++) { /* skip '0x' and read numeral */ 212 for (s += 2; ; s++) { /* skip '0x' and read numeral */
@@ -230,9 +230,9 @@ static lua_Number lua_strx2number (const char *s, char **endptr) {
230 e *= 4; /* each digit multiplies/divides value by 2^4 */ 230 e *= 4; /* each digit multiplies/divides value by 2^4 */
231 if (*s == 'p' || *s == 'P') { /* exponent part? */ 231 if (*s == 'p' || *s == 'P') { /* exponent part? */
232 int exp1 = 0; /* exponent value */ 232 int exp1 = 0; /* exponent value */
233 int neg1; /* exponent signal */ 233 int neg1; /* exponent sign */
234 s++; /* skip 'p' */ 234 s++; /* skip 'p' */
235 neg1 = isneg(&s); /* signal */ 235 neg1 = isneg(&s); /* sign */
236 if (!lisdigit(cast_uchar(*s))) 236 if (!lisdigit(cast_uchar(*s)))
237 return 0.0; /* invalid; must have at least one digit */ 237 return 0.0; /* invalid; must have at least one digit */
238 while (lisdigit(cast_uchar(*s))) /* read exponent */ 238 while (lisdigit(cast_uchar(*s))) /* read exponent */
diff --git a/lstrlib.c b/lstrlib.c
index 626c9159..9a4cf90d 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.257 2017/07/07 16:34:32 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.258 2017/11/08 14:50:23 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -994,7 +994,7 @@ static int num2straux (char *buff, int sz, lua_Number x) {
994 lua_Number m = l_mathop(frexp)(x, &e); /* 'x' fraction and exponent */ 994 lua_Number m = l_mathop(frexp)(x, &e); /* 'x' fraction and exponent */
995 int n = 0; /* character count */ 995 int n = 0; /* character count */
996 if (m < 0) { /* is number negative? */ 996 if (m < 0) { /* is number negative? */
997 buff[n++] = '-'; /* add signal */ 997 buff[n++] = '-'; /* add sign */
998 m = -m; /* make it positive */ 998 m = -m; /* make it positive */
999 } 999 }
1000 buff[n++] = '0'; buff[n++] = 'x'; /* add "0x" */ 1000 buff[n++] = '0'; buff[n++] = 'x'; /* add "0x" */