fix(lua): replace lua_pushfstring with lua_pushstring

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2013-11-13 12:14:55 -08:00
parent a80adae1c3
commit b5f0185729
11 changed files with 15 additions and 15 deletions

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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)) {

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}