Browse Source

made local functions static

tarfeef101 6 năm trước cách đây
mục cha
commit
87a9175776
1 tập tin đã thay đổi với 8 bổ sung8 xóa
  1. 8 8
      kern/synchprobs/traffic_synch.c

+ 8 - 8
kern/synchprobs/traffic_synch.c

@@ -44,7 +44,7 @@ list * queue = NULL;
 list * active = NULL;
 
 // car initializer/allocator
-car * newcar(Direction origin, Direction dest)
+static car * newcar(Direction origin, Direction dest)
 {
   car * temp = kmalloc(sizeof(car));
   
@@ -63,7 +63,7 @@ car * newcar(Direction origin, Direction dest)
 }
 
 // list initializer/allocator
-list * newlist()
+static list * newlist()
 {
   list * temp = kmalloc(sizeof(list));
   
@@ -79,7 +79,7 @@ list * newlist()
 }
 
 // puts a car into the queue, at the front if old is true, the back otherwise
-void enqueue(car * newcar)
+static void enqueue(car * newcar)
 {
   if (!(queue->back))
   {
@@ -101,7 +101,7 @@ void enqueue(car * newcar)
 }
 
 // push a car to the end of the active list
-void push(car * newcar)
+static void push(car * newcar)
 {
   if (!(active->front))
   {
@@ -114,7 +114,7 @@ void push(car * newcar)
 }
 
 // remove an element from the front of the queue
-struct car * pop()
+static car * pop()
 {
   if (!(queue->front))
   {
@@ -132,7 +132,7 @@ struct car * pop()
 }
 
 // called when a car clears the intersection
-void clearint(car * done)
+static void clearint(car * done)
 {
   car * temp = active->front;
   car * temp2 = NULL;
@@ -163,7 +163,7 @@ void clearint(car * done)
 }
 
 // cleans up a list
-void dellist(list * dead)
+static void dellist(list * dead)
 {
   car * temp = dead->front;
   
@@ -179,7 +179,7 @@ void dellist(list * dead)
 }
 
 // returns true if a car is turning right
-bool rightturn(car * car)
+static bool rightturn(car * car)
 {
   int temp = car->origin - car->dest;
   return (temp == 1 || temp == -3);