From fa233012511e42740cb3ed12d553ad8f0a8e49d2 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 5 Jun 2002 09:34:19 -0300 Subject: [PATCH] defintions for lua_number2str and lua_str2number don't need to be public --- lobject.c | 7 ++++++- lua.h | 11 +---------- lvm.c | 10 ++++++++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/lobject.c b/lobject.c index 34cb1ad1..ce3f757b 100644 --- a/lobject.c +++ b/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 1.81 2002/05/16 18:39:46 roberto Exp roberto $ +** $Id: lobject.c,v 1.82 2002/06/03 14:08:43 roberto Exp roberto $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -19,6 +19,11 @@ #include "lvm.h" +/* function to convert a string to a lua_Number */ +#ifndef lua_str2number +#define lua_str2number(s,p) strtod((s), (p)) +#endif + const TObject luaO_nilobject = {LUA_TNIL, {NULL}}; diff --git a/lua.h b/lua.h index c2456039..38888730 100644 --- a/lua.h +++ b/lua.h @@ -1,5 +1,5 @@ /* -** $Id: lua.h,v 1.135 2002/06/03 17:46:34 roberto Exp roberto $ +** $Id: lua.h,v 1.136 2002/06/03 20:11:07 roberto Exp roberto $ ** Lua - An Extensible Extension Language ** Tecgraf: Grupo de Tecnologia em Computacao Grafica, PUC-Rio, Brazil ** e-mail: info@lua.org @@ -300,15 +300,6 @@ LUA_API int lua_pushupvalues (lua_State *L); #define LUA_NUMBER_FMT "%.16g" #endif -/* function to convert a lua_Number to a string */ -#ifndef lua_number2str -#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) -#endif - -/* function to convert a string to a lua_Number */ -#ifndef lua_str2number -#define lua_str2number(s,p) strtod((s), (p)) -#endif /* function to convert a lua_Number to int (with any rounding method) */ #ifndef lua_number2int diff --git a/lvm.c b/lvm.c index 10ba9cd5..5413c901 100644 --- a/lvm.c +++ b/lvm.c @@ -1,12 +1,11 @@ /* -** $Id: lvm.c,v 1.233 2002/05/27 20:35:40 roberto Exp roberto $ +** $Id: lvm.c,v 1.234 2002/06/03 14:08:43 roberto Exp roberto $ ** Lua virtual machine ** See Copyright Notice in lua.h */ #include -#include #include #include @@ -25,6 +24,13 @@ #include "lvm.h" +/* function to convert a lua_Number to a string */ +#ifndef lua_number2str +#include +#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) +#endif + + /* limit for table tag-method chains (to avoid loops) */ #define MAXTAGLOOP 10000