]> git.pond.sub.org Git - empserver/commitdiff
(getcontact, putcontact, nat_contact): Change nat_contact
authorRon Koenderink <rkoenderink@yahoo.ca>
Fri, 18 Nov 2005 23:40:30 +0000 (23:40 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Fri, 18 Nov 2005 23:40:30 +0000 (23:40 +0000)
to unsigned char to reduce the space required for natstr.

include/nat.h
src/lib/common/nat.c

index 2504556fd8f2bec2e68fd4609d3c446d1af6507c..4c292acee1f2575e1acecc1441935bdcdb93ee7c 100644 (file)
@@ -86,7 +86,7 @@ struct natstr {
     float nat_level[4];                /* technology, etc */
     struct boundstr nat_b[MAXNOR];     /* realm bounds */
     short nat_relate[MAXNOC];
-    short nat_contact[MAXNOC];
+    unsigned char nat_contact[MAXNOC];
     short nat_rejects[(MAXNOC + 3) / 4]; /* four bits for each country */
     s_char nat_priorities[PRI_MAX+1]; /* budget priority */
     long nat_flags;            /* nation flags */
@@ -167,10 +167,11 @@ extern s_char *rejectname(struct natstr *np, natid other);
 extern s_char *natstate(struct natstr *np);
 extern int getrel(struct natstr *np, natid them);
 extern int getrejects(natid them, struct natstr *np);
-extern int getcontact(struct natstr *np, natid them);
+extern unsigned char getcontact(struct natstr *np, natid them);
 extern void putrel(struct natstr *np, natid them, int relate);
 extern void putreject(struct natstr *np, natid them, int how, int what);
-extern void putcontact(struct natstr *np, natid them, int contact);
+extern void putcontact(struct natstr *np, natid them,
+                      unsigned char contact);
 extern void agecontact(struct natstr *np);
 
 /* nation flags */
index bcd0775270f6e14d4dc248255732e1ff24ee7b18..b6628f1536623779ca3544437373055f8b04cd98 100644 (file)
@@ -128,7 +128,7 @@ agecontact(struct natstr *np)
     }
 }
 
-int
+unsigned char
 getcontact(struct natstr *np, natid them)
 {
     return np->nat_contact[them];
@@ -159,7 +159,7 @@ putreject(struct natstr *np, natid them, int how, int what)
 }
 
 void
-putcontact(struct natstr *np, natid them, int contact)
+putcontact(struct natstr *np, natid them, unsigned char contact)
 {
     if (np->nat_contact[them] < contact)
        np->nat_contact[them] = contact;