Change setrel(), setcont(), setrej() to return void

Nobody cares for their value anyway.
This commit is contained in:
Markus Armbruster 2011-02-05 09:30:12 +01:00
parent a302bde1fb
commit d4f0cb3576
2 changed files with 12 additions and 15 deletions

View file

@ -585,9 +585,9 @@ extern int delty(struct range *, coord);
extern void radmap(int, int, int, double, int, double); extern void radmap(int, int, int, double, int, double);
extern void rad_map_set(natid, int, int, int, double, int); extern void rad_map_set(natid, int, int, int, double, int);
/* rej.c */ /* rej.c */
extern int setrel(natid, natid, int); extern void setrel(natid, natid, int);
extern int setcont(natid, natid, int); extern void setcont(natid, natid, int);
extern int setrej(natid, natid, int, int); extern void setrej(natid, natid, int, int);
/* retreat.c */ /* retreat.c */
extern void retreat_ship(struct shpstr *, char); extern void retreat_ship(struct shpstr *, char);
extern void retreat_land(struct lndstr *, char); extern void retreat_land(struct lndstr *, char);

View file

@ -41,7 +41,7 @@
#include "prototypes.h" #include "prototypes.h"
#include "server.h" #include "server.h"
int void
setrel(natid us, natid them, int rel) setrel(natid us, natid them, int rel)
{ {
struct natstr *mynp = getnatp(us); struct natstr *mynp = getnatp(us);
@ -59,9 +59,10 @@ setrel(natid us, natid them, int rel)
if (CANT_HAPPEN(rel > ALLIED)) if (CANT_HAPPEN(rel > ALLIED))
rel = ALLIED; rel = ALLIED;
if (CANT_HAPPEN(!mynp || !themnp)) if (CANT_HAPPEN(!mynp || !themnp))
return RET_FAIL; return;
if ((oldrel = getrel(mynp, them)) == rel) oldrel = getrel(mynp, them);
return RET_FAIL; if (oldrel == rel)
return;
themname = cname(them); themname = cname(them);
if (rel > oldrel) if (rel > oldrel)
whichway = "upgraded"; whichway = "upgraded";
@ -109,30 +110,26 @@ setrel(natid us, natid them, int rel)
} }
if (opt_HIDDEN) if (opt_HIDDEN)
setcont(them, us, FOUND_TELE); setcont(them, us, FOUND_TELE);
return RET_OK;
} }
int void
setcont(natid us, natid them, int contact) setcont(natid us, natid them, int contact)
{ {
struct natstr *np = getnatp(us); struct natstr *np = getnatp(us);
if (CANT_HAPPEN(!np)) if (CANT_HAPPEN(!np))
return 0; return;
putcontact(np, them, contact); putcontact(np, them, contact);
putnat(np); putnat(np);
return 1;
} }
int void
setrej(natid us, natid them, int how, int what) setrej(natid us, natid them, int how, int what)
{ {
struct natstr *np = getnatp(us); struct natstr *np = getnatp(us);
if (CANT_HAPPEN(!np)) if (CANT_HAPPEN(!np))
return 0; return;
putreject(np, them, how, what); putreject(np, them, how, what);
putnat(np); putnat(np);
return 1;
} }