aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormd52011-05-15 13:46:22 +0300
committermd52011-05-15 13:46:22 +0300
commit5f583eda0dbd09034ae44dd726b710a18d1aaec5 (patch)
tree4ef3144f652deb55038f80818daeaaa95c04cd25
parentb34e776e517b893d3cc140e7282a99026c2500f8 (diff)
downloadscummvm-rg350-5f583eda0dbd09034ae44dd726b710a18d1aaec5.tar.gz
scummvm-rg350-5f583eda0dbd09034ae44dd726b710a18d1aaec5.tar.bz2
scummvm-rg350-5f583eda0dbd09034ae44dd726b710a18d1aaec5.zip
SWORD25 (LUA): Removed unused non-portable locale code
-rw-r--r--engines/sword25/util/lua/llex.cpp13
-rw-r--r--engines/sword25/util/lua/loslib.cpp10
2 files changed, 5 insertions, 18 deletions
diff --git a/engines/sword25/util/lua/llex.cpp b/engines/sword25/util/lua/llex.cpp
index 91413ba55c..87eafea45a 100644
--- a/engines/sword25/util/lua/llex.cpp
+++ b/engines/sword25/util/lua/llex.cpp
@@ -6,7 +6,6 @@
#include <ctype.h>
-#include <locale.h>
#include <string.h>
#define llex_c
@@ -176,17 +175,11 @@ static void buffreplace (LexState *ls, char from, char to) {
static void trydecpoint (LexState *ls, SemInfo *seminfo) {
/* format error: try to update decimal point separator */
-#if defined(__ANDROID__)
- // Android is missing the decimal_point member from the lconv struct.
- // For more information, refer to:
- // http://www.damonkohler.com/2008/12/lua-on-android.html
+ // Non-portable call to update the decimal point separator.
+ // It has been simplified in ScummVM to not use any system locale
+ // information, as it's not used in sword25.
char old = ls->decpoint;
ls->decpoint = '.';
-#else
- struct lconv *cv = localeconv();
- char old = ls->decpoint;
- ls->decpoint = (cv ? cv->decimal_point[0] : '.');
-#endif
buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */
if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
/* format error with correct decimal point: no more options */
diff --git a/engines/sword25/util/lua/loslib.cpp b/engines/sword25/util/lua/loslib.cpp
index de96860812..578a7cb09a 100644
--- a/engines/sword25/util/lua/loslib.cpp
+++ b/engines/sword25/util/lua/loslib.cpp
@@ -5,7 +5,6 @@
*/
-#include <locale.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -183,13 +182,8 @@ static int os_difftime (lua_State *L) {
static int os_setlocale (lua_State *L) {
- static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY,
- LC_NUMERIC, LC_TIME};
- static const char *const catnames[] = {"all", "collate", "ctype", "monetary",
- "numeric", "time", NULL};
- const char *l = luaL_optstring(L, 1, NULL);
- int op = luaL_checkoption(L, 2, "all", catnames);
- lua_pushstring(L, setlocale(cat[op], l));
+ // Non-portable call to set the numeric locale. Removed in ScummVM, as it's
+ // not used in sword25.
return 1;
}