compilation fixes GCC.

This commit is contained in:
Enno Rehling 2008-04-26 16:46:05 +00:00
parent 43422a0619
commit 77b292e05a
10 changed files with 26 additions and 13 deletions

View File

@ -153,8 +153,8 @@ if ! $(DEBUG) {
}
if $(MSPACES) {
CCFLAGS += -DMSPACES -DDL_DEBUG=$(DEBUG) ;
C++FLAGS += -DMSPACES -DDL_DEBUG=$(DEBUG) ;
CCFLAGS += -DMSPACES -DDL_DEBUG=0 ;
C++FLAGS += -DMSPACES -DDL_DEBUG=0 ;
}
if $(WITHOUT_LUA) {

View File

@ -56,7 +56,6 @@ a_readgive(attrib * a, struct storage * store)
{
give_data * gdata = (give_data*)a->data.v;
variant var;
int result;
char zText[32];
var.i = store->r_id(store);

View File

@ -43,6 +43,8 @@ SOURCES =
terrain.c
unit.c
xmlreader.c
textstore.c
binarystore.c
;
Library kernel : $(SOURCES) ;

View File

@ -64,6 +64,7 @@ struct ship;
struct ship_type;
struct skill;
struct spell;
struct storage;
struct strlist;
struct terrain_type;
struct unit;

View File

@ -18,6 +18,7 @@
extern "C" {
#endif
struct storage;
typedef void (*afun)(void);
typedef struct attrib {

View File

@ -21,6 +21,7 @@ extern "C" {
struct attrib;
struct trigger;
struct storage;
typedef struct trigger_type {
const char * name;

View File

@ -268,9 +268,11 @@ static const struct {
{"", luaopen_base},
{LUA_TABLIBNAME, luaopen_table},
{LUA_IOLIBNAME, luaopen_io},
{LUA_OSLIBNAME, luaopen_os},
{LUA_STRLIBNAME, luaopen_string},
{LUA_MATHLIBNAME, luaopen_math},
#if LUA_VERSION_NUM>=501
{LUA_OSLIBNAME, luaopen_os},
#endif
{ NULL, NULL }
};

View File

@ -1,3 +1,11 @@
function open_game(turn)
file = "" .. get_turn()
if read_game(file .. ".dat", "binary")~=0 then
return read_game(file, "text")
end
return 0
end
function write_emails(locales)
local files = {}
local key

View File

@ -9,6 +9,8 @@ function loadscript(name)
end
end
loadscript("default.lua")
function change_locales()
-- local localechange = { }
local localechange = { en = { "adun" } }
@ -29,7 +31,6 @@ function run_scripts()
"spells.lua",
"extensions.lua",
"familiars.lua",
"default.lua",
"eressea/eternath.lua",
"eressea/wedding-jadee.lua",
"eressea/ponnuki.lua",
@ -53,8 +54,7 @@ function process(orders)
equipment_setitem("new_faction", "stone", "30");
equipment_setitem("new_faction", "money", "4200");
file = "" .. get_turn()
if read_game(file)~=0 then
if open_game(get_turn())~=0 then
print("could not read game")
return -1
end
@ -102,8 +102,8 @@ function process(orders)
write_files(locales)
file = "" .. get_turn()
if write_game(file)~=0 then
file = "" .. get_turn() .. ".dat"
if write_game(file, "binary")~=0 then
print("could not write game")
return -1
end

View File

@ -3,8 +3,7 @@ local locales = { "de", "en" }
function process(orders)
-- read game and orders
local turnfile = "" .. get_turn()
if read_game(turnfile)~=0 then
if open_game(get_turn())~=0 then
print("could not read game")
return -1
end
@ -40,7 +39,7 @@ function process(orders)
-- save the game
outfile = "" .. get_turn()
if write_game(outfile)~=0 then
if write_game(outfile, "text")~=0 then
print("could not write game")
return -1
end