diff options
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 */ |