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 /lobject.c | |
| parent | 4c0e36a46e11be2f101203ed0db66ea750bf4333 (diff) | |
| download | lua-e4e5aa85a24bba6c243aeeaedc66ec712856c6db.tar.gz lua-e4e5aa85a24bba6c243aeeaedc66ec712856c6db.tar.bz2 lua-e4e5aa85a24bba6c243aeeaedc66ec712856c6db.zip | |
detail ('signal' -> 'sign' in comments)
Diffstat (limited to 'lobject.c')
| -rw-r--r-- | lobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -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 */ |
