fix(lua): replace lua_pushfstring with lua_pushstring
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
a80adae1c3
commit
b5f0185729
11 changed files with 15 additions and 15 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ static int expr_tostring(lua_State * L) {
|
|||
} else {
|
||||
out << "<null-expr>";
|
||||
}
|
||||
lua_pushfstring(L, out.str().c_str());
|
||||
lua_pushstring(L, out.str().c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ static int mpz_tostring(lua_State * L) {
|
|||
mpz * n = static_cast<mpz*>(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<mpq*>(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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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 << "<null-kernel-object>";
|
||||
lua_pushfstring(L, out.str().c_str());
|
||||
lua_pushstring(L, out.str().c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue