|
@@ -44,7 +44,7 @@ list * queue = NULL;
|
|
|
list * active = NULL;
|
|
|
|
|
|
// car initializer/allocator
|
|
|
-struct car * newcar(Direction origin, Direction dest)
|
|
|
+car * newcar(Direction origin, Direction dest)
|
|
|
{
|
|
|
car * temp = kmalloc(sizeof(car));
|
|
|
|
|
@@ -58,10 +58,12 @@ struct car * newcar(Direction origin, Direction dest)
|
|
|
temp->old = 0;
|
|
|
temp->next = NULL;
|
|
|
temp->cv = NULL;
|
|
|
+
|
|
|
+ return temp;
|
|
|
}
|
|
|
|
|
|
// list initializer/allocator
|
|
|
-struct list * newlist()
|
|
|
+list * newlist()
|
|
|
{
|
|
|
list * temp = kmalloc(sizeof(list));
|
|
|
|
|
@@ -72,6 +74,8 @@ struct list * newlist()
|
|
|
|
|
|
temp->front = NULL;
|
|
|
temp->back = NULL;
|
|
|
+
|
|
|
+ return temp;
|
|
|
}
|
|
|
|
|
|
// puts a car into the queue, at the front if old is true, the back otherwise
|