chiark / gitweb /
giant reorg abolishes TrainNum most of the time; working on making it build
[trains.git] / layout / layout-data.h
index 98796c647acbc4c104bc8393b67dece60c8485bd..4bb569a564bcdb8a9742dac8439680f52631f6c7 100644 (file)
 
 /*========== basic types etc. ==========*/
 
-typedef unsigned short TrainNum;
-typedef unsigned short SegmentNum;
-typedef unsigned short MovPosComb;
-typedef unsigned short BoardObject;
-
-typedef unsigned char Small;
-
-typedef short Distance;
-typedef char Speed;
-  /* for units, see safety.h */
+typedef int TrainNum;
+typedef int SegmentNum;
+typedef long MovPosComb;
+typedef long Speed;
+typedef int BoardObject;
+typedef int Small;
+typedef int Distance;
 
 typedef enum {
   mfk_none,
@@ -61,27 +58,18 @@ typedef struct {
   BoardObject sense, invert;
 } SegmentInfo;
 
-typedef struct {
-  Speed maxspeed;
-  Distance tail, detectable, head;
-  const char *pname;
-} TrainInfo;
-
-/* These data arrays have no sentinel members.  Use the info_nfoobars
- * constants.  Alternatively, it is legal to sed out everything from
+/* This data array has no sentinel member.  Use the info_nsegments
+ * constant.  Alternatively, it is legal to sed out everything from
  * <name-of-layout>.layout-data.c from the first #include onwards, and
- * this will give definitions of NUM_SEGMENTS and NUM_TRAINS.
+ * this will give a definition of NUM_SEGMENTS.
  */
 
 extern const SegmentNum info_nsegments;
 extern const SegmentInfo info_segments[];
 
-extern const TrainNum info_nsegments;
-extern const TrainInfo info_trains[];
-
 extern const BoardObject info_maxreverse; /* max. reverse + 1 */
 
-#define NOTA(x) (~(x##Num)0)
-#define SOMEP(x) (!!~(x))
+#define NOTA(x) (-1)
+#define SOMEP(x) ((x) >= 0)
 
 #endif /*LAYOUT_DATA_H*/