diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-30 16:48:08 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-30 16:48:08 -0300 |
commit | b9dcf9974d4dbff3ca28ff618259e277cb0090ea (patch) | |
tree | 66b903add6a56545bb50fda02d33baab24ba44d5 /liolib.c | |
parent | a77d263e86feea55529800028f960d7124c1385f (diff) | |
download | lua-github-b9dcf9974d4dbff3ca28ff618259e277cb0090ea.tar.gz |
detail (typos in comments)
Diffstat (limited to 'liolib.c')
-rw-r--r-- | liolib.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -1,5 +1,5 @@ /* -** $Id: liolib.c,v 2.125 2014/05/21 15:24:21 roberto Exp roberto $ +** $Id: liolib.c,v 2.126 2014/06/02 03:00:51 roberto Exp roberto $ ** Standard I/O (and system) library ** See Copyright Notice in lua.h */ @@ -402,11 +402,11 @@ static int test2 (RN *rn, const char *set) { /* -** Read a sequence of (hexa)digits +** Read a sequence of (hex)digits */ -static int readdigits (RN *rn, int hexa) { +static int readdigits (RN *rn, int hex) { int count = 0; - while ((hexa ? isxdigit(rn->c) : isdigit(rn->c)) && nextc(rn)) + while ((hex ? isxdigit(rn->c) : isdigit(rn->c)) && nextc(rn)) count++; return count; } @@ -426,7 +426,7 @@ static int readdigits (RN *rn, int hexa) { static int read_number (lua_State *L, FILE *f) { RN rn; int count = 0; - int hexa = 0; + int hex = 0; char decp[2] = "."; rn.f = f; rn.n = 0; decp[0] = getlocaledecpoint(); /* get decimal point from locale */ @@ -434,13 +434,13 @@ static int read_number (lua_State *L, FILE *f) { do { rn.c = l_getc(rn.f); } while (isspace(rn.c)); /* skip spaces */ test2(&rn, "-+"); /* optional signal */ if (test2(&rn, "0")) { - if (test2(&rn, "xX")) hexa = 1; /* numeral is hexadecimal */ + if (test2(&rn, "xX")) hex = 1; /* numeral is hexadecimal */ else count = 1; /* count initial '0' as a valid digit */ } - count += readdigits(&rn, hexa); /* integral part */ + count += readdigits(&rn, hex); /* integral part */ if (test2(&rn, decp)) /* decimal point? */ - count += readdigits(&rn, hexa); /* fractionary part */ - if (count > 0 && test2(&rn, (hexa ? "pP" : "eE"))) { /* exponent mark? */ + count += readdigits(&rn, hex); /* fractional part */ + if (count > 0 && test2(&rn, (hex ? "pP" : "eE"))) { /* exponent mark? */ test2(&rn, "-+"); /* exponent signal */ readdigits(&rn, 0); /* exponent digits */ } |