diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-09-06 17:34:18 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1999-09-06 17:34:18 -0300 |
commit | 2e13cd77ab3b3719ef139e4786328be813fb10e0 (patch) | |
tree | 17717c1015f20dff2ac62cfd2a082c4aba5ab206 /lundump.c | |
parent | ff9c0da7839543478d62306dd208f11caab130c1 (diff) | |
download | lua-2e13cd77ab3b3719ef139e4786328be813fb10e0.tar.gz lua-2e13cd77ab3b3719ef139e4786328be813fb10e0.tar.bz2 lua-2e13cd77ab3b3719ef139e4786328be813fb10e0.zip |
new interface for `luaO_strtod', which now checks signal, too.
Diffstat (limited to 'lundump.c')
-rw-r--r-- | lundump.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lundump.c,v 1.12 1999/07/08 12:43:23 roberto Exp roberto $ | 2 | ** $Id: lundump.c,v 1.13 1999/08/16 20:52:00 roberto Exp roberto $ |
3 | ** load bytecodes from files | 3 | ** load bytecodes from files |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -50,12 +50,12 @@ static unsigned long LoadLong (ZIO* Z) | |||
50 | /* | 50 | /* |
51 | * convert number from text | 51 | * convert number from text |
52 | */ | 52 | */ |
53 | double luaU_str2d (const char* b, const char* where) | 53 | real luaU_str2d (const char* b, const char* where) |
54 | { | 54 | { |
55 | int negative=(b[0]=='-'); | 55 | real x; |
56 | double x=luaO_str2d(b+negative); | 56 | if (!luaO_str2d(b, &x)) |
57 | if (x<0) luaL_verror("cannot convert number '%s' in %s",b,where); | 57 | luaL_verror("cannot convert number '%s' in %s",b,where); |
58 | return negative ? -x : x; | 58 | return x; |
59 | } | 59 | } |
60 | 60 | ||
61 | static real LoadNumber (ZIO* Z, int native) | 61 | static real LoadNumber (ZIO* Z, int native) |