reduzierte warnings unter visual C

This commit is contained in:
Enno Rehling 2001-02-10 10:40:12 +00:00
parent 9a70cdedab
commit 62e08f00c8
16 changed files with 144 additions and 120 deletions

View File

@ -117,6 +117,10 @@ SOURCE=.\reduceproduction.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\roadsoverride.h
# End Source File
# Begin Source File
SOURCE=.\targetregion.h SOURCE=.\targetregion.h
# End Source File # End Source File
# End Group # End Group
@ -158,6 +162,10 @@ SOURCE=.\reduceproduction.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\roadsoverride.c
# End Source File
# Begin Source File
SOURCE=.\targetregion.c SOURCE=.\targetregion.c
# End Source File # End Source File
# End Target # End Target

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: attributes.c,v 1.5 2001/02/04 08:42:36 enno Exp $ * $Id: attributes.c,v 1.6 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -24,6 +24,7 @@
#include "follow.h" #include "follow.h"
#include "iceberg.h" #include "iceberg.h"
#include "hate.h" #include "hate.h"
#include "overrideroads.h"
/* util includes */ /* util includes */
#include <attrib.h> #include <attrib.h>
@ -32,13 +33,11 @@
* library initialization * library initialization
*/ */
extern attrib_type at_roads_override;
void void
init_attributes(void) init_attributes(void)
{ {
at_register(&at_orcification); at_register(&at_orcification);
at_register(&at_roads_override); at_register(&at_overrideroads);
/* at_iceberg */ /* at_iceberg */
init_iceberg(); init_iceberg();
/* at_key */ /* at_key */

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: creport.c,v 1.5 2001/02/05 16:11:57 enno Exp $ * $Id: creport.c,v 1.6 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -20,46 +20,46 @@
*/ */
#include <config.h> #include <config.h>
#include "eressea.h" #include <eressea.h>
#include "creport.h" #include "creport.h"
#include <reports.h>
#include <plane.h>
#include <render.h>
#include "movement.h"
#include "item.h"
#include "faction.h"
#include "alchemy.h"
#include "magic.h"
#include "race.h"
#include "building.h"
#include "economy.h"
#include "goodies.h"
#include "region.h"
#include "unit.h"
#include "skill.h"
#include "message.h"
#include "border.h"
#include "teleport.h"
#include "ship.h"
#include "karma.h"
#ifdef GROUPS
#include "group.h"
#endif
/* modules include */ /* modules include */
#include <modules/score.h> #include <modules/score.h>
/* attributes include */ /* attributes include */
#include <attributes/follow.h> #include <attributes/follow.h>
/* gamecode includes */
#include "laws.h"
#include "economy.h"
/* kernel includes */
#include <alchemy.h>
#include <border.h>
#include <building.h>
#include <faction.h>
#include <group.h>
#include <item.h>
#include <karma.h>
#include <magic.h>
#include <message.h>
#include <movement.h>
#include <plane.h>
#include <race.h>
#include <region.h>
#include <render.h>
#include <reports.h>
#include <ship.h>
#include <skill.h>
#include <teleport.h>
#include <unit.h>
/* util includes */
#include <goodies.h>
/* libc includes */
#include <math.h> #include <math.h>
#include <stdio.h> #include <stdio.h>
#ifdef WIN32
#else
#include <unistd.h>
#endif
#include <assert.h> #include <assert.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: economy.c,v 1.3 2001/02/03 13:45:29 enno Exp $ * $Id: economy.c,v 1.4 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -46,6 +46,9 @@
#include "reports.h" #include "reports.h"
#include "karma.h" #include "karma.h"
/* gamecode includes */
#include "laws.h"
/* util includes */ /* util includes */
#include <attrib.h> #include <attrib.h>
#include <base36.h> #include <base36.h>

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: laws.c,v 1.8 2001/02/09 15:17:30 corwin Exp $ * $Id: laws.c,v 1.9 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -2980,3 +2980,24 @@ processorders (void)
write_skillfix(); write_skillfix();
#endif #endif
} }
int
count_migrants (const faction * f)
{
#ifndef NDEBUG
unit *u = f->units;
int n = 0;
while (u) {
assert(u->faction == f);
if (u->race != f->race && u->race != RC_ILLUSION && u->race != RC_SPELL
&& !nonplayer(u) && !(is_cursed(u->attribs, C_SLAVE, 0)))
{
n += u->number;
}
u = u->nextF;
}
if (f->num_migrants != n)
puts("FEHLER: Anzahl Migranten falsch");
#endif
return f->num_migrants;
}

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: laws.h,v 1.2 2001/01/26 16:19:39 enno Exp $ * $Id: laws.h,v 1.3 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -42,5 +42,6 @@ extern void sinkships(void);
extern void * resolve_ship(void * data); extern void * resolve_ship(void * data);
void processorders(void); void processorders(void);
extern int count_migrants (const struct faction * f);
#endif #endif

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: randenc.c,v 1.6 2001/02/03 13:45:30 enno Exp $ * $Id: randenc.c,v 1.7 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -1305,7 +1305,10 @@ randomevents(void)
if(is_cursed(r->attribs, C_HOLYGROUND, 0)) continue; if(is_cursed(r->attribs, C_HOLYGROUND, 0)) continue;
/* Chance 0.1% * chaosfactor */ /* Chance 0.1% * chaosfactor */
if (unburied && r->land && rand() % 10000 < (100 + 100 * chaosfactor(r))) { if (r->land && unburied > r->land->peasants / 20 && rand() % 10000 < (100 + 100 * chaosfactor(r))) {
/* es ist sinnfrei, wenn irgendwo im Wald 3er-Einheiten Untote entstehen.
* Lieber sammeln lassen, bis sie mindestens 5% der Bevölkerung sind, und
* dann erst auferstehen. */
int undead = unburied / (rand() % 2 + 1); int undead = unburied / (rand() % 2 + 1);
race_t rc; race_t rc;
int i; int i;

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: report.c,v 1.11 2001/02/05 16:11:57 enno Exp $ * $Id: report.c,v 1.12 2001/02/10 10:40:10 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -23,42 +23,47 @@
#define INDENT 0 #define INDENT 0
#include <config.h> #include <config.h>
#include "eressea.h" #include <eressea.h>
#include "reports.h"
#include "item.h"
#include "alchemy.h"
#include "faction.h"
#include "region.h"
#include "unit.h"
#include "skill.h"
#include "movement.h"
#include "message.h"
#include "ship.h"
#include "building.h"
#include "economy.h"
#include "build.h"
#include "creation.h"
#include "save.h"
#include "build.h"
#include "magic.h"
#include "race.h"
#include "monster.h"
#include "plane.h"
#include "pool.h"
#include "teleport.h"
#include "border.h"
#include "objtypes.h"
#include "goodies.h"
#include "karma.h"
#include "render.h"
#ifdef GROUPS
#include "group.h"
#endif
/* modules includes */
#include <modules/score.h> #include <modules/score.h>
/* attributes includes */
#include <attributes/overrideroads.h>
/* gamecode includes */
#include "creation.h"
#include "economy.h"
#include "monster.h"
#include "laws.h"
/* kernel includes */
#include <alchemy.h>
#include <border.h>
#include <build.h>
#include <building.h>
#include <faction.h>
#include <group.h>
#include <item.h>
#include <karma.h>
#include <magic.h>
#include <message.h>
#include <movement.h>
#include <objtypes.h>
#include <plane.h>
#include <pool.h>
#include <race.h>
#include <region.h>
#include <render.h>
#include <reports.h>
#include <save.h>
#include <ship.h>
#include <skill.h>
#include <teleport.h>
#include <unit.h>
/* util includes */ /* util includes */
#include <goodies.h>
#include <base36.h> #include <base36.h>
/* libc includes */ /* libc includes */
@ -861,8 +866,6 @@ see_border(border * b, faction * f, region * r)
return cs; return cs;
} }
extern attrib_type at_roads_override;
static void static void
describe(FILE * F, region * r, int partial, faction * f) describe(FILE * F, region * r, int partial, faction * f)
{ {
@ -1025,7 +1028,7 @@ describe(FILE * F, region * r, int partial, faction * f)
} }
if (!is_cursed(r->attribs, C_REGCONF, 0)) { if (!is_cursed(r->attribs, C_REGCONF, 0)) {
attrib *a_do = a_find(r->attribs, &at_roads_override); attrib *a_do = a_find(r->attribs, &at_overrideroads);
if(a_do) { if(a_do) {
scat(" "); scat(" ");
scat((char *)a_do->data.v); scat((char *)a_do->data.v);

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: alchemy.c,v 1.4 2001/02/09 13:53:51 corwin Exp $ * $Id: alchemy.c,v 1.5 2001/02/10 10:40:11 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -178,8 +178,9 @@ a_readeffect(attrib *a, FILE *f)
ptype = oldpotiontype[data.sa[0]]; ptype = oldpotiontype[data.sa[0]];
power = data.sa[1]; power = data.sa[1];
} else { } else {
fscanf(f, "%s %d", buf, &power); char zText[32];
ptype = pt_find(buf); fscanf(f, "%s %d", zText, &power);
ptype = pt_find(zText);
} }
if (ptype==NULL || power==0) return 0; if (ptype==NULL || power==0) return 0;
edata->type = ptype; edata->type = ptype;

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: battle.c,v 1.8 2001/02/09 15:17:31 corwin Exp $ * $Id: battle.c,v 1.9 2001/02/10 10:40:11 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -2449,8 +2449,9 @@ print_fighters(battle * b, cvector * fighters)
int row = get_unitrow(df); int row = get_unitrow(df);
if (row != lastrow) { if (row != lastrow) {
sprintf(buf, "... in der %d. Kampflinie:", row); char zText[32];
battlerecord(b, buf); sprintf(zText, "... in der %d. Kampflinie:", row);
battlerecord(b, zText);
lastrow = row; lastrow = row;
} }
battle_punit(du, b); battle_punit(du, b);

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: border.c,v 1.3 2001/01/28 08:01:51 enno Exp $ * $Id: border.c,v 1.4 2001/02/10 10:40:11 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -89,18 +89,20 @@ read_borders(FILE * f)
for (;;) { for (;;) {
int fx, fy, tx, ty; int fx, fy, tx, ty;
unsigned int bid = 0; unsigned int bid = 0;
char zText[32];
border * b; border * b;
region * from, * to; region * from, * to;
border_type * type; border_type * type;
fscanf(f, "%s", buf);
if (!strcmp(buf, "end")) break; fscanf(f, "%s", zText);
if (!strcmp(zText, "end")) break;
if (global.data_version<BORDERID_VERSION) { if (global.data_version<BORDERID_VERSION) {
fscanf(f, "%d %d %d %d ", &fx, &fy, &tx, &ty); fscanf(f, "%d %d %d %d ", &fx, &fy, &tx, &ty);
bid = ++nextborder; bid = ++nextborder;
} else { } else {
fscanf(f, "%d %d %d %d %d", &bid, &fx, &fy, &tx, &ty); fscanf(f, "%d %d %d %d %d", &bid, &fx, &fy, &tx, &ty);
} }
type = find_bordertype(buf); type = find_bordertype(zText);
assert(type || !"border type not registered"); assert(type || !"border type not registered");
from = findregion(fx, fy); from = findregion(fx, fy);
if (!from) { if (!from) {

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: eressea.c,v 1.10 2001/02/05 19:10:46 reich Exp $ * $Id: eressea.c,v 1.11 2001/02/10 10:40:11 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -1028,27 +1028,6 @@ update_lighthouse(building * lh)
} }
} }
int
count_migrants (const faction * f)
{
#ifndef NDEBUG
region *r;
unit *u;
int n = 0;
region *last = lastregion(f);
for (r = firstregion(f); r != last; r = r->next)
for (u = r->units; u; u = u->next)
if (u->faction == f && u->race != f->race
&& u->race != RC_ILLUSION && u->race != RC_SPELL
&& !nonplayer(u))
if(!(is_cursed(u->attribs, C_SLAVE, 0)))
n += u->number;
if (f->num_migrants != n)
puts("FEHLER: Anzahl Migranten falsch");
#endif
return f->num_migrants;
}
int int
count_all(const faction * f) count_all(const faction * f)
{ {

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: eressea.h,v 1.12 2001/02/05 16:11:58 enno Exp $ * $Id: eressea.h,v 1.13 2001/02/10 10:40:11 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -995,7 +995,6 @@ char *shipname(const ship * sh);
struct building *largestbuilding(const struct region * r, boolean img); struct building *largestbuilding(const struct region * r, boolean img);
int count_migrants(const struct faction * f);
int count_all(const struct faction * f); int count_all(const struct faction * f);
int teure_talente(struct unit * u); int teure_talente(struct unit * u);
int count_maxmigrants(const struct faction * f); int count_maxmigrants(const struct faction * f);

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: event.h,v 1.2 2001/01/26 16:19:41 enno Exp $ * $Id: event.h,v 1.3 2001/02/10 10:40:12 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -21,12 +21,12 @@ struct attrib;
struct trigger; struct trigger;
typedef union { typedef union {
void * v; void *v;
int i; int i;
char c; char c;
short s; short s;
short sa[2]; short sa[2];
char ca[4]; char ca[4];
} variant; } variant;
typedef struct trigger_type { typedef struct trigger_type {

View File

@ -1,6 +1,6 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* $Id: umlaut.c,v 1.2 2001/01/26 16:19:41 enno Exp $ * $Id: umlaut.c,v 1.3 2001/02/10 10:40:12 enno Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000 * Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
@ -30,7 +30,7 @@
void void
addtoken(tnode * root, const char* str, void * id) addtoken(tnode * root, const char* str, void * id)
{ {
static char buf[1024]; static char zText[1024];
static struct replace { static struct replace {
char c; char c;
const char * str; const char * str;
@ -66,8 +66,8 @@ addtoken(tnode * root, const char* str, void * id)
addtoken(tk, str+1, id); addtoken(tk, str+1, id);
while (replace[i].str) { while (replace[i].str) {
if (*str==replace[i].c) { if (*str==replace[i].c) {
strcat(strcpy(buf, replace[i].str), str+1); strcat(strcpy(zText, replace[i].str), str+1);
addtoken(root, buf, id); addtoken(root, zText, id);
break; break;
} }
++i; ++i;

View File

@ -112,7 +112,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "Profile" # PROP Intermediate_Dir "Profile"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /I "../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /I "../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /Za /W4 /GX- /Z7 /O2 /I "../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c # ADD CPP /nologo /Za /W4 /Z7 /O2 /I "../.." /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE RSC /l 0x407 # ADD BASE RSC /l 0x407
# ADD RSC /l 0x407 # ADD RSC /l 0x407
BSC32=bscmake.exe BSC32=bscmake.exe
@ -236,6 +236,10 @@ SOURCE=.\resolve.c
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\translation.c
# End Source File
# Begin Source File
SOURCE=.\umlaut.c SOURCE=.\umlaut.c
# End Source File # End Source File
# Begin Source File # Begin Source File