]> git.pond.sub.org Git - empserver/commitdiff
(i_packing): New. Use where appropriate.
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 9 Apr 2004 06:30:21 +0000 (06:30 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 9 Apr 2004 06:30:21 +0000 (06:30 +0000)
(NPKG, WPKG, UPKG, BPKG, NUMPKG): Turn macros into enumeration
constants.
(NPKG, WPKG, UPKG, BPKG): Move from sect.h to item.h.

include/item.h
include/sect.h
src/lib/update/distribute.c

index f8688d81ab5e3f87eb96337e2c739d8c95b6d621..52d98fa83b051f44f41c64d2d97000b38a334b61 100644 (file)
 #ifndef _ITEM_H_
 #define _ITEM_H_
 
-#define        NUMPKG  4               /* number of different kinds of packaging */
+typedef enum {
+    NPKG,                      /* no special packaging */
+    WPKG,                      /* "warehouse" packaging */
+    UPKG,                      /* "urban" packaging */
+    BPKG                       /* "bank" packaging */
+} i_packing;
+
+enum {
+    NUMPKG = BPKG + 1
+};
 
 struct ichrstr {
     int i_mnem;                        /* usually the initial letter */
index 42cb74e96352a8df89a3b46922a1fc01b0da7cc4..4f9e03d3f47d01a06cd7bec4a03d08aa36a55b10 100644 (file)
@@ -37,6 +37,7 @@
 #ifndef _SECT_H_
 #define _SECT_H_
 
+#include "item.h"
 #include "var.h"
 
 /* The order of the following elements is there to match up with genitem */
@@ -92,7 +93,7 @@ struct dchrstr {
     int d_prd;                 /* product vtype */
     int d_mcst;                        /* movement cost */
     int d_flg;                 /* movement cost */
-    int d_pkg;                 /* type of packaging in these sects */
+    i_packing d_pkg;           /* type of packaging in these sects */
     float d_ostr;              /* offensive strength */
     float d_dstr;              /* defensive strength */
     int d_value;               /* resale ("collect") value */
@@ -103,11 +104,6 @@ struct dchrstr {
     s_char *d_name;            /* full name of sector type */
 };
 
-#define        NPKG    0               /* no special packaging */
-#define        WPKG    1               /* "warehouse" packaging */
-#define        UPKG    2               /* "urban" packaging */
-#define        BPKG    3               /* "bank" packaging */
-
 /* for d_flg */
 #define        NAVOK   1               /* ships can always navigate */
 #define        NAV_02  2               /* requires 2% effic to navigate */
index 7017c30bd8aa82ce82e09710979bad657f89d78e..ef147b9eaaf5aa18fc7fb43a7d63a5b174f02aaa 100644 (file)
@@ -58,10 +58,10 @@ dodistribute(struct sctstr *sp, int imex, s_char *path, double dist_i_cost,
     int thresh;
     int amt_dist;
     int amt_sect;
-    int packing;
+    i_packing packing;
     float imcost;
     float excost;
-    int dist_packing;
+    i_packing dist_packing;
     int diff;
     int item;
     int changed;