ソースを参照

forgot to return things with returns types :D

tarfeef101 6 年 前
コミット
45461fe95b
1 ファイル変更6 行追加2 行削除
  1. 6 2
      kern/synchprobs/traffic_synch.c

+ 6 - 2
kern/synchprobs/traffic_synch.c

@@ -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