chiark / gitweb /
giant reorg abolishes TrainNum most of the time; working on making it build
[trains.git] / hostside / actual.c
index ef86d3a10615c0451d9873134fc969c62652e698..21eef04e61241576530ba166dffc280b4df9a463 100644 (file)
@@ -7,9 +7,6 @@
 
 static PicInsn polarityinsn= { { 0x90 }, 0 };
 
-#define SEG                                            \
-  const SegmentInfo *segi= &info_segments[segn];
-
 #define OPONBIT_BYTE (polarityinsn.d[bytenum])
 #define OPONBIT(body) do{                              \
     BoardObject bo;                                    \
@@ -25,8 +22,7 @@ static PicInsn polarityinsn= { { 0x90 }, 0 };
     { body }                                           \
   }while(0)
 
-int picinsn_polarity_testbit(const PicInsn *pi, SegmentNum segn) {
-  SEG;
+int picinsn_polarity_testbit(const PicInsn *pi, const SegmentInfo *segi) {
   OPONBIT({
     return !!(OPONBIT_BYTE & bitv);
   });
@@ -36,10 +32,8 @@ void actual_inversions_start(void) {
   polarityinsn.l= (info_maxreverse + 4 + 6) / 7;
 }
 
-void actual_inversions_segment(SegmentNum segn) {
-  SEG;
-  State *s= &safety_state;
-  const SegmentState *seg= &s->segments[segn];
+void actual_inversions_segment(Segment *seg) {
+  const SegmentInfo *segi= seg->i;
   
   OPONBIT({
     Byte *insnbyte= &OPONBIT_BYTE;