diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-05 09:34:19 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-06-05 09:34:19 -0300 |
commit | fa233012511e42740cb3ed12d553ad8f0a8e49d2 (patch) | |
tree | 566b2370f1096e8ddcf6ace08a1e6660d9a7448f | |
parent | 94c2449d25d0e00d72c2aa22904d6ff2cbb11ee2 (diff) | |
download | lua-fa233012511e42740cb3ed12d553ad8f0a8e49d2.tar.gz lua-fa233012511e42740cb3ed12d553ad8f0a8e49d2.tar.bz2 lua-fa233012511e42740cb3ed12d553ad8f0a8e49d2.zip |
defintions for lua_number2str and lua_str2number don't need to be public
-rw-r--r-- | lobject.c | 7 | ||||
-rw-r--r-- | lua.h | 11 | ||||
-rw-r--r-- | lvm.c | 10 |
3 files changed, 15 insertions, 13 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.c,v 1.81 2002/05/16 18:39:46 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 1.82 2002/06/03 14:08:43 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 | */ |
@@ -19,6 +19,11 @@ | |||
19 | #include "lvm.h" | 19 | #include "lvm.h" |
20 | 20 | ||
21 | 21 | ||
22 | /* function to convert a string to a lua_Number */ | ||
23 | #ifndef lua_str2number | ||
24 | #define lua_str2number(s,p) strtod((s), (p)) | ||
25 | #endif | ||
26 | |||
22 | 27 | ||
23 | const TObject luaO_nilobject = {LUA_TNIL, {NULL}}; | 28 | const TObject luaO_nilobject = {LUA_TNIL, {NULL}}; |
24 | 29 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.135 2002/06/03 17:46:34 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.136 2002/06/03 20:11:07 roberto Exp roberto $ |
3 | ** Lua - An Extensible Extension Language | 3 | ** Lua - An Extensible Extension Language |
4 | ** Tecgraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil | 4 | ** Tecgraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil |
5 | ** e-mail: info@lua.org | 5 | ** e-mail: info@lua.org |
@@ -300,15 +300,6 @@ LUA_API int lua_pushupvalues (lua_State *L); | |||
300 | #define LUA_NUMBER_FMT "%.16g" | 300 | #define LUA_NUMBER_FMT "%.16g" |
301 | #endif | 301 | #endif |
302 | 302 | ||
303 | /* function to convert a lua_Number to a string */ | ||
304 | #ifndef lua_number2str | ||
305 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) | ||
306 | #endif | ||
307 | |||
308 | /* function to convert a string to a lua_Number */ | ||
309 | #ifndef lua_str2number | ||
310 | #define lua_str2number(s,p) strtod((s), (p)) | ||
311 | #endif | ||
312 | 303 | ||
313 | /* function to convert a lua_Number to int (with any rounding method) */ | 304 | /* function to convert a lua_Number to int (with any rounding method) */ |
314 | #ifndef lua_number2int | 305 | #ifndef lua_number2int |
@@ -1,12 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 1.233 2002/05/27 20:35:40 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 1.234 2002/06/03 14:08:43 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
6 | 6 | ||
7 | 7 | ||
8 | #include <stdarg.h> | 8 | #include <stdarg.h> |
9 | #include <stdio.h> | ||
10 | #include <stdlib.h> | 9 | #include <stdlib.h> |
11 | #include <string.h> | 10 | #include <string.h> |
12 | 11 | ||
@@ -25,6 +24,13 @@ | |||
25 | #include "lvm.h" | 24 | #include "lvm.h" |
26 | 25 | ||
27 | 26 | ||
27 | /* function to convert a lua_Number to a string */ | ||
28 | #ifndef lua_number2str | ||
29 | #include <stdio.h> | ||
30 | #define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) | ||
31 | #endif | ||
32 | |||
33 | |||
28 | /* limit for table tag-method chains (to avoid loops) */ | 34 | /* limit for table tag-method chains (to avoid loops) */ |
29 | #define MAXTAGLOOP 10000 | 35 | #define MAXTAGLOOP 10000 |
30 | 36 | ||