diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-16 11:19:06 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-16 11:19:06 -0200 |
commit | e4e5aa85a24bba6c243aeeaedc66ec712856c6db (patch) | |
tree | f2a4333254eb0e8ed7691d9110ff568d3bd6ec61 | |
parent | 4c0e36a46e11be2f101203ed0db66ea750bf4333 (diff) | |
download | lua-e4e5aa85a24bba6c243aeeaedc66ec712856c6db.tar.gz lua-e4e5aa85a24bba6c243aeeaedc66ec712856c6db.tar.bz2 lua-e4e5aa85a24bba6c243aeeaedc66ec712856c6db.zip |
detail ('signal' -> 'sign' in comments)
-rw-r--r-- | lbaselib.c | 4 | ||||
-rw-r--r-- | lbitlib.c | 4 | ||||
-rw-r--r-- | liolib.c | 6 | ||||
-rw-r--r-- | lobject.c | 8 | ||||
-rw-r--r-- | lstrlib.c | 4 |
5 files changed, 13 insertions, 13 deletions
@@ -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; |
@@ -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 | } |
@@ -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 */ |
@@ -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 */ |
@@ -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" */ |