]> git.pond.sub.org Git - empserver/commitdiff
(OFFSET): Remove, use standard offsetof().
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 7 Apr 2004 17:38:43 +0000 (17:38 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 7 Apr 2004 17:38:43 +0000 (17:38 +0000)
(SETOFF): Unused, remove.

include/misc.h
src/lib/global/product.c

index e89a016fbe0d92a8964f2ab0b3521d41635472a8..8ac43c467ba799c80716b3197645b8cad1343e55 100644 (file)
@@ -108,12 +108,6 @@ typedef signed char s_char;
 #define ATTRIBUTE(attr)
 #endif /* !aix && !sgi */
 typedef short coord;
-/*
- * watch it; your compiler might not like this.
- * If you think this is bogus, look at /usr/include/struct.h
- */
-#define        OFFSET(stype, oset) ((int)(&(((struct stype *)0)->oset)))
-#define        SETOFF(sinst, oset) ((s_char *) (sinst) + (oset))
 
 #ifndef bit
 #define        bit(x)          (1<<(x))
index 5f2c30fb0d9e3852ae37ffb1d8ac1ecbe28a82ee..f7893abcba5638929fdd0480b98491018454748e 100644 (file)
@@ -31,6 +31,7 @@
  *     
  */
 
+#include <stddef.h>
 #include "misc.h"
 #include "product.h"
 #include "sect.h"
@@ -53,19 +54,19 @@ struct pchrstr pchr[] = {
      V_PETROL, -1, 1, 0, 0, NAT_TLEV, 20, 10, 1000,
      "petrol", "petrol",},
     {0, {0}, {0},
-     V_IRON, -1, 0, OFFSET(sctstr, sct_min), 0, -1, 0, 0, 100,
+     V_IRON, -1, 0, offsetof(struct sctstr, sct_min), 0, -1, 0, 0, 100,
      "iron ore", "iron",},
     {0, {0}, {0},
-     V_DUST, -1, 0, OFFSET(sctstr, sct_gmin), 20, -1, 0, 0, 100,
+     V_DUST, -1, 0, offsetof(struct sctstr, sct_gmin), 20, -1, 0, 0, 100,
      "gold dust", "dust",},
     {1, {V_DUST}, {5},
      V_BAR, -1, 10, 0, 0, -1, 0, 0, 100,
      "gold bars", "bars",},
     {0, {0}, {0},
-     V_FOOD, -1, 0, OFFSET(sctstr, sct_fertil), 0, NAT_TLEV, -10, 10, 900,
+     V_FOOD, -1, 0, offsetof(struct sctstr, sct_fertil), 0, NAT_TLEV, -10, 10, 900,
      "food", "food",},
     {0, {0}, {0},
-     V_OIL, -1, 0, OFFSET(sctstr, sct_oil), 10, NAT_TLEV, -10, 10, 100,
+     V_OIL, -1, 0, offsetof(struct sctstr, sct_oil), 10, NAT_TLEV, -10, 10, 100,
      "oil", "oil",},
     {1, {V_IRON}, {1},
      V_LCM, -1, 0, 0, 0, NAT_TLEV, -10, 10, 100,
@@ -86,10 +87,10 @@ struct pchrstr pchr[] = {
      0, NAT_HLEV, 9, 0, 0, -1, 0, 0, 100,
      "happy strollers", "happy",},
     {0, {0}, {0},
-     V_RAD, -1, 2, OFFSET(sctstr, sct_uran), 35, NAT_TLEV, 40, 10, 100,
+     V_RAD, -1, 2, offsetof(struct sctstr, sct_uran), 35, NAT_TLEV, 40, 10, 100,
      "radioactive materials", "rad",},
     {0, {0}, {0},
-     V_DUST, -1, 0, OFFSET(sctstr, sct_gmin), 20, -1, 0, 0, 75,
+     V_DUST, -1, 0, offsetof(struct sctstr, sct_gmin), 20, -1, 0, 0, 75,
      "gold dust", "dust",},
     {0, {0}, {0},
      0, 0, 0, 0, 0, 0, 0, 0, 0, "", "",}