From b5f0185729cac8b41d32ce1f08ee364bf3b75d6f Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 13 Nov 2013 12:14:55 -0800 Subject: [PATCH] fix(lua): replace lua_pushfstring with lua_pushstring Signed-off-by: Leonardo de Moura --- src/bindings/lua/context.cpp | 2 +- src/bindings/lua/environment.cpp | 2 +- src/bindings/lua/expr.cpp | 2 +- src/bindings/lua/format.cpp | 2 +- src/bindings/lua/leanlua_state.cpp | 2 +- src/bindings/lua/level.cpp | 2 +- src/bindings/lua/name.cpp | 2 +- src/bindings/lua/numerics.cpp | 4 ++-- src/bindings/lua/object.cpp | 4 ++-- src/bindings/lua/options.cpp | 4 ++-- src/bindings/lua/sexpr.cpp | 4 ++-- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/bindings/lua/context.cpp b/src/bindings/lua/context.cpp index a7804972e..5369bfc58 100644 --- a/src/bindings/lua/context.cpp +++ b/src/bindings/lua/context.cpp @@ -93,7 +93,7 @@ static int context_tostring(lua_State * L) { formatter fmt = get_global_formatter(L); options opts = get_global_options(L); out << mk_pair(fmt(to_context(L, 1), opts), opts); - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/environment.cpp b/src/bindings/lua/environment.cpp index 9329423eb..097644e5e 100644 --- a/src/bindings/lua/environment.cpp +++ b/src/bindings/lua/environment.cpp @@ -192,7 +192,7 @@ static int environment_tostring(lua_State * L) { formatter fmt = get_global_formatter(L); options opts = get_global_options(L); out << mk_pair(fmt(env, opts), opts); - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/expr.cpp b/src/bindings/lua/expr.cpp index 21639e2b0..4dd2db45f 100644 --- a/src/bindings/lua/expr.cpp +++ b/src/bindings/lua/expr.cpp @@ -70,7 +70,7 @@ static int expr_tostring(lua_State * L) { } else { out << ""; } - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/format.cpp b/src/bindings/lua/format.cpp index 5f331cc31..0ffeb0e50 100644 --- a/src/bindings/lua/format.cpp +++ b/src/bindings/lua/format.cpp @@ -58,7 +58,7 @@ static int format_gc(lua_State * L) { static int format_tostring(lua_State * L) { std::ostringstream out; out << mk_pair(to_format(L, 1), get_global_options(L)); - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/leanlua_state.cpp b/src/bindings/lua/leanlua_state.cpp index 5f053b886..2161b4376 100644 --- a/src/bindings/lua/leanlua_state.cpp +++ b/src/bindings/lua/leanlua_state.cpp @@ -64,7 +64,7 @@ static char const * reader(lua_State *, void * data, size_t * sz) { static void copy_values(lua_State * src, int first, int last, lua_State * tgt) { for (int i = first; i <= last; i++) { if (lua_isstring(src, i)) { - lua_pushfstring(tgt, lua_tostring(src, i)); + lua_pushstring(tgt, lua_tostring(src, i)); } else if (lua_isnumber(src, i)) { lua_pushnumber(tgt, lua_tonumber(src, i)); } else if (lua_isboolean(src, i)) { diff --git a/src/bindings/lua/level.cpp b/src/bindings/lua/level.cpp index 98025d97c..01149f01e 100644 --- a/src/bindings/lua/level.cpp +++ b/src/bindings/lua/level.cpp @@ -41,7 +41,7 @@ static int level_tostring(lua_State * L) { std::ostringstream out; options opts = get_global_options(L); out << mk_pair(pp(to_level(L, 1), opts), opts); - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/name.cpp b/src/bindings/lua/name.cpp index a4eec8328..7e13f5da3 100644 --- a/src/bindings/lua/name.cpp +++ b/src/bindings/lua/name.cpp @@ -58,7 +58,7 @@ static int name_gc(lua_State * L) { } static int name_tostring(lua_State * L) { - lua_pushfstring(L, to_name(L, 1).to_string().c_str()); + lua_pushstring(L, to_name(L, 1).to_string().c_str()); return 1; } diff --git a/src/bindings/lua/numerics.cpp b/src/bindings/lua/numerics.cpp index d4054b437..fd3793557 100644 --- a/src/bindings/lua/numerics.cpp +++ b/src/bindings/lua/numerics.cpp @@ -55,7 +55,7 @@ static int mpz_tostring(lua_State * L) { mpz * n = static_cast(luaL_checkudata(L, 1, mpz_mt)); std::ostringstream out; out << *n; - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } @@ -172,7 +172,7 @@ static int mpq_tostring(lua_State * L) { mpq * n = static_cast(luaL_checkudata(L, 1, mpq_mt)); std::ostringstream out; out << *n; - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/object.cpp b/src/bindings/lua/object.cpp index ab16fb4f2..52f2ef0ac 100644 --- a/src/bindings/lua/object.cpp +++ b/src/bindings/lua/object.cpp @@ -53,7 +53,7 @@ static int object_is_null(lua_State * L) { } static int object_keyword(lua_State * L) { - lua_pushfstring(L, to_nonnull_object(L, 1).keyword()); + lua_pushstring(L, to_nonnull_object(L, 1).keyword()); return 1; } @@ -157,7 +157,7 @@ static int object_tostring(lua_State * L) { out << mk_pair(fmt(to_object(L, 1), opts), opts); else out << ""; - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } diff --git a/src/bindings/lua/options.cpp b/src/bindings/lua/options.cpp index cb883609e..41b79b3c3 100644 --- a/src/bindings/lua/options.cpp +++ b/src/bindings/lua/options.cpp @@ -57,7 +57,7 @@ static int options_gc(lua_State * L) { static int options_tostring(lua_State * L) { std::ostringstream out; out << to_options(L, 1); - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } @@ -107,7 +107,7 @@ static int options_get_double(lua_State * L) { static int options_get_string(lua_State * L) { int nargs = lua_gettop(L); char const * defval = nargs < 3 ? "" : lua_tostring(L, 3); - lua_pushfstring(L, to_options(L, 1).get_string(to_key(L, 2), defval)); + lua_pushstring(L, to_options(L, 1).get_string(to_key(L, 2), defval)); return 1; } diff --git a/src/bindings/lua/sexpr.cpp b/src/bindings/lua/sexpr.cpp index 1ca6982db..eb58b593d 100644 --- a/src/bindings/lua/sexpr.cpp +++ b/src/bindings/lua/sexpr.cpp @@ -39,7 +39,7 @@ static int sexpr_gc(lua_State * L) { static int sexpr_tostring(lua_State * L) { std::ostringstream out; out << to_sexpr(L, 1); - lua_pushfstring(L, out.str().c_str()); + lua_pushstring(L, out.str().c_str()); return 1; } @@ -128,7 +128,7 @@ static int sexpr_to_string(lua_State * L) { sexpr const & e = to_sexpr(L, 1); if (!is_string(e)) throw exception("s-expression is not a string"); - lua_pushfstring(L, to_string(e).c_str()); + lua_pushstring(L, to_string(e).c_str()); return 1; }