|
@@ -127,21 +127,6 @@ void intersection_sync_init()
|
|
|
|
|
|
// initilaize array of active cars
|
|
|
activeinit();
|
|
|
-
|
|
|
- // represents offests for the origin coordinate in our array
|
|
|
- dirs = kmalloc(4 * sizeof(int));
|
|
|
- *dirs = 0;
|
|
|
- *(dirs + 1) = 3;
|
|
|
- *(dirs + 2) = 6;
|
|
|
- *(dirs + 3) = 9;
|
|
|
-
|
|
|
- // holds the 4 offests for the dest coordinate in our array
|
|
|
- compass = kmalloc(4 * sizeof(int *));
|
|
|
- *compass = northa;
|
|
|
- *(compass + 1) = easta;
|
|
|
- *(compass + 2) = southa;
|
|
|
- *(compass + 3) = westa;
|
|
|
-
|
|
|
|
|
|
// represents offests for the dest coordinate in our array
|
|
|
northa = kmalloc(4 * sizeof(int));
|
|
@@ -171,6 +156,20 @@ void intersection_sync_init()
|
|
|
*(westa + 2) = 2;
|
|
|
*(westa + 3) = 0;
|
|
|
|
|
|
+ // represents offests for the origin coordinate in our array
|
|
|
+ dirs = kmalloc(4 * sizeof(int));
|
|
|
+ *dirs = 0;
|
|
|
+ *(dirs + 1) = 3;
|
|
|
+ *(dirs + 2) = 6;
|
|
|
+ *(dirs + 3) = 9;
|
|
|
+
|
|
|
+ // holds the 4 offests for the dest coordinate in our array
|
|
|
+ compass = kmalloc(4 * sizeof(int *));
|
|
|
+ *compass = northa;
|
|
|
+ *(compass + 1) = easta;
|
|
|
+ *(compass + 2) = southa;
|
|
|
+ *(compass + 3) = westa;
|
|
|
+
|
|
|
if ((!compass) || !(dirs) || !(northa) || !(easta) || !(southa) || !(westa))
|
|
|
{
|
|
|
panic("Could not allocate offset arrays.\n");
|