From 01fd653508fb6698ee36761a3d19f78f7922c22d Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 11 Jun 2005 17:10:55 +0000 Subject: [PATCH] reduced the size of some data types (won't help much, but might help a little) --- src/common/kernel/eressea.h | 4 ++-- src/common/kernel/unit.h | 6 +++--- src/common/kernel/xmlreader.c | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/common/kernel/eressea.h b/src/common/kernel/eressea.h index 9975bfc27..ea060f238 100644 --- a/src/common/kernel/eressea.h +++ b/src/common/kernel/eressea.h @@ -462,7 +462,7 @@ extern const char *keywords[MAXKEYWORDS]; /* ------------------ Status von Einheiten --------------------- */ -typedef int status_t; +typedef unsigned char status_t; enum { ST_AGGRO, ST_FIGHT, @@ -474,7 +474,7 @@ enum { /* ----------------- Parameter --------------------------------- */ -typedef int param_t; +typedef unsigned char param_t; enum { P_LOCALE, P_ANY, diff --git a/src/common/kernel/unit.h b/src/common/kernel/unit.h index 834b931ae..b64b41b54 100644 --- a/src/common/kernel/unit.h +++ b/src/common/kernel/unit.h @@ -82,8 +82,8 @@ typedef struct unit { struct faction *faction; struct building *building; struct ship *ship; - short age; unsigned short number; + short age; /* skill data */ short skill_size; @@ -112,8 +112,8 @@ typedef struct unit { unsigned int flags; struct attrib * attribs; status_t status; - int n; /* enno: attribut? */ - int wants; /* enno: attribut? */ + int n; /* enno: attribut? */ + int wants; /* enno: attribut? */ } unit; typedef struct unit_list { diff --git a/src/common/kernel/xmlreader.c b/src/common/kernel/xmlreader.c index 7668a992a..12342e844 100644 --- a/src/common/kernel/xmlreader.c +++ b/src/common/kernel/xmlreader.c @@ -363,7 +363,6 @@ parse_calendar(xmlDocPtr doc) seasons = nsetSeasons->nodeNr; seasonnames = malloc(sizeof(char *) * seasons); - storms = malloc(sizeof(int) * seasons); for (i=0;i!=nsetSeasons->nodeNr;++i) { xmlNodePtr season = nsetSeasons->nodeTab[i];