tarfeef101 6 лет назад
Родитель
Сommit
4eae9b8b22
1 измененных файлов с 33 добавлено и 33 удалено
  1. 33 33
      kern/synchprobs/traffic_synch.c

+ 33 - 33
kern/synchprobs/traffic_synch.c

@@ -22,10 +22,10 @@ car * active = NULL;
 // all of our offset arrays
 int * dirs;
 int ** compass;
-int * north;
-int * east;
-int * south;
-int * west;
+int * northa;
+int * easta;
+int * southa;
+int * westa;
 
 // car initializer/allocator
 static car * newcar(Direction origin, Direction dest)
@@ -95,10 +95,10 @@ static void clearint(car * done)
 static void cleanup()
 {
   kfree(active);
-  kfree(north);
-  kfree(east);
-  kfree(south);
-  kfree(west);
+  kfree(northa);
+  kfree(easta);
+  kfree(southa);
+  kfree(westa);
   kfree(compass);
   kfree(dirs);
 }
@@ -132,41 +132,41 @@ void intersection_sync_init()
 
   // holds the 4 offests for the dest coordinate in our array
   compass = kmalloc(4 * sizeof(int *));
-  *compass = north;
-  *(compass + 1) = east;
-  *(compass + 2) = south;
-  *(compass + 3) = west;
+  *compass = northa;
+  *(compass + 1) = easta;
+  *(compass + 2) = southa;
+  *(compass + 3) = westa;
 
 
   // represents offests for the dest coordinate in our array
-  north = kmalloc(4 * sizeof(int));
-  *north = 0;
-  *(north + 1) = 0;
-  *(north + 2) = 1;
-  *(north + 3) = 2;
+  northa = kmalloc(4 * sizeof(int));
+  *northa = 0;
+  *(northa + 1) = 0;
+  *(northa + 2) = 1;
+  *(northa + 3) = 2;
 
   // represents offests for the dest coordinate in our array
-  east = kmalloc(4 * sizeof(int));
-  *east = 2;
-  *(east + 1) = 0;
-  *(east + 2) = 0;
-  *(east + 3) = 1;
+  easta = kmalloc(4 * sizeof(int));
+  *easta = 2;
+  *(easta + 1) = 0;
+  *(easta + 2) = 0;
+  *(easta + 3) = 1;
 
   // represents offests for the dest coordinate in our array
-  south = kmalloc(4 * sizeof(int));
-  *south = 1;
-  *(south + 1) = 2;
-  *(south + 2) = 0;
-  *(south + 3) = 0;
+  southa = kmalloc(4 * sizeof(int));
+  *southa = 1;
+  *(southa + 1) = 2;
+  *(southa + 2) = 0;
+  *(southa + 3) = 0;
 
   // represents offests for the dest coordinate in our array
-  west = kmalloc(4 * sizeof(int));
-  *west = 0;
-  *(west + 1) = 1;
-  *(west + 2) = 2;
-  *(west + 3) = 0;
+  westa = kmalloc(4 * sizeof(int));
+  *westa = 0;
+  *(westa + 1) = 1;
+  *(westa + 2) = 2;
+  *(westa + 3) = 0;
   
-  if ((!compass) || !(dirs) || !(north) || !(east) || !(south) || !(west))
+  if ((!compass) || !(dirs) || !(northa) || !(easta) || !(southa) || !(westa))
   {
     panic("Could not allocate offset arrays.\n");
   }