~widelands-dev/widelands/remove-savegame-compatibility-after-economy-change

« back to all changes in this revision

Viewing changes to src/third_party/eris/lbaselib.c

Merged trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
** $Id: lbaselib.c,v 1.312 2015/10/29 15:21:04 roberto Exp $
 
2
** $Id: lbaselib.c,v 1.314 2016/09/05 19:06:34 roberto Exp $
3
3
** Basic library
4
4
** See Copyright Notice in lua.h
5
5
*/
102
102
static int luaB_error (lua_State *L) {
103
103
  int level = (int)luaL_optinteger(L, 2, 1);
104
104
  lua_settop(L, 1);
105
 
  if (lua_isstring(L, 1) && level > 0) {  /* add extra information? */
106
 
    luaL_where(L, level);
 
105
  if (lua_type(L, 1) == LUA_TSTRING && level > 0) {
 
106
    luaL_where(L, level);   /* add extra information */
107
107
    lua_pushvalue(L, 1);
108
108
    lua_concat(L, 2);
109
109
  }
208
208
 
209
209
static int pairsmeta (lua_State *L, const char *method, int iszero,
210
210
                      lua_CFunction iter) {
 
211
  luaL_checkany(L, 1);
211
212
  if (luaL_getmetafield(L, 1, method) == LUA_TNIL) {  /* no metamethod? */
212
 
    luaL_checktype(L, 1, LUA_TTABLE);  /* argument must be a table */
213
213
    lua_pushcfunction(L, iter);  /* will return generator, */
214
214
    lua_pushvalue(L, 1);  /* state, */
215
215
    if (iszero) lua_pushinteger(L, 0);  /* and initial value */
251
251
 
252
252
 
253
253
/*
254
 
** This function will use either 'ipairsaux' or 'ipairsaux_raw' to
255
 
** traverse a table, depending on whether the table has metamethods
256
 
** that can affect the traversal.
 
254
** 'ipairs' function. Returns 'ipairsaux', given "table", 0.
 
255
** (The given "table" may not be a table.)
257
256
*/
258
257
static int luaB_ipairs (lua_State *L) {
259
258
#if defined(LUA_COMPAT_IPAIRS)