From 7c4e9dd71d6f02f686c52551ccdcc27b89ef8025 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 6 Sep 2014 17:30:33 +0000 Subject: (svn r26771) -Cleanup: remove OTTD2SQ and SQ2OTTD --- src/script/squirrel_helper.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/script/squirrel_helper.hpp') diff --git a/src/script/squirrel_helper.hpp b/src/script/squirrel_helper.hpp index 760d6c3bf..7a4bf7e08 100644 --- a/src/script/squirrel_helper.hpp +++ b/src/script/squirrel_helper.hpp @@ -88,8 +88,8 @@ namespace SQConvert { template <> inline int Return (HSQUIRRELVM vm, int64 res) { sq_pushinteger(vm, res); return 1; } template <> inline int Return (HSQUIRRELVM vm, Money res) { sq_pushinteger(vm, res); return 1; } template <> inline int Return (HSQUIRRELVM vm, bool res) { sq_pushbool (vm, res); return 1; } - template <> inline int Return (HSQUIRRELVM vm, char *res) { if (res == NULL) sq_pushnull(vm); else { sq_pushstring(vm, OTTD2SQ(res), -1); free(res); } return 1; } - template <> inline int Return(HSQUIRRELVM vm, const char *res) { if (res == NULL) sq_pushnull(vm); else { sq_pushstring(vm, OTTD2SQ(res), -1); } return 1; } + template <> inline int Return (HSQUIRRELVM vm, char *res) { if (res == NULL) sq_pushnull(vm); else { sq_pushstring(vm, res, -1); free(res); } return 1; } + template <> inline int Return(HSQUIRRELVM vm, const char *res) { if (res == NULL) sq_pushnull(vm); else { sq_pushstring(vm, res, -1); } return 1; } template <> inline int Return (HSQUIRRELVM vm, void *res) { sq_pushuserpointer(vm, res); return 1; } template <> inline int Return (HSQUIRRELVM vm, HSQOBJECT res) { sq_pushobject(vm, res); return 1; } @@ -115,7 +115,7 @@ namespace SQConvert { const SQChar *tmp; sq_getstring(vm, -1, &tmp); - char *tmp_str = stredup(SQ2OTTD(tmp)); + char *tmp_str = stredup(tmp); sq_poptop(vm); *ptr->Append() = (void *)tmp_str; str_validate(tmp_str, tmp_str + strlen(tmp_str)); @@ -749,7 +749,7 @@ namespace SQConvert { /* Protect against calls to a non-static method in a static way */ sq_pushroottable(vm); const char *className = GetClassName(); - sq_pushstring(vm, OTTD2SQ(className), -1); + sq_pushstring(vm, className, -1); sq_get(vm, -2); sq_pushobject(vm, instance); if (sq_instanceof(vm) != SQTrue) return sq_throwerror(vm, _SC("class method is non-static")); @@ -791,7 +791,7 @@ namespace SQConvert { /* Protect against calls to a non-static method in a static way */ sq_pushroottable(vm); const char *className = GetClassName(); - sq_pushstring(vm, OTTD2SQ(className), -1); + sq_pushstring(vm, className, -1); sq_get(vm, -2); sq_pushobject(vm, instance); if (sq_instanceof(vm) != SQTrue) return sq_throwerror(vm, _SC("class method is non-static")); -- cgit v1.2.3-54-g00ecf