libwp: Tidy header includes
[openafs.git] / src / lwp / timer.c
index a8adc20..cad63b4 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
-
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#else
-#include <sys/time.h>
-#endif
-#include <stdlib.h>
+#include <roken.h>
 
 #define _TIMER_IMPL_
 #include "timer.h"
@@ -53,10 +45,10 @@ static int globalInitDone = 0;
 
 /* t1 = t2 - t3 */
 static void
-subtract(t1, t2, t3)
-     register struct timeval *t1, *t2, *t3;
+subtract(struct timeval *t1, struct timeval *t2,
+        struct timeval *t3)
 {
-    register int sec2, usec2, sec3, usec3;
+    int sec2, usec2, sec3, usec3;
 
     sec2 = t2->tv_sec;
     usec2 = t2->tv_usec;
@@ -86,8 +78,7 @@ subtract(t1, t2, t3)
 /* t1 += t2; */
 
 static void
-add(t1, t2)
-     register struct timeval *t1, *t2;
+add(struct timeval *t1, struct timeval *t2)
 {
     t1->tv_usec += t2->tv_usec;
     t1->tv_sec += t2->tv_sec;
@@ -96,7 +87,7 @@ add(t1, t2)
        t1->tv_usec -= MILLION;
     }
 }
-\f
+
 /* t1 == t2 */
 
 int
@@ -109,8 +100,7 @@ TM_eql(struct timeval *t1, struct timeval *t2)
 
 /*
 obsolete, commentless procedure, all done by hand expansion now.
-static bool geq(t1, t2)
-    register struct timeval *t1, *t2;
+static bool geq(struct timeval *t1, struct timeval *t2)
 {
     return (t1->tv_sec > t2->tv_sec) ||
           (t1->tv_sec == t2->tv_sec && t1->tv_usec >= t2->tv_usec);
@@ -118,12 +108,11 @@ static bool geq(t1, t2)
 */
 
 static bool
-blocking(t)
-     register struct TM_Elem *t;
+blocking(struct TM_Elem *t)
 {
     return (t->TotalTime.tv_sec < 0 || t->TotalTime.tv_usec < 0);
 }
-\f
+
 
 
 /*
@@ -131,8 +120,7 @@ blocking(t)
 */
 
 int
-TM_Init(list)
-     register struct TM_Elem **list;
+TM_Init(struct TM_Elem **list)
 {
     if (!globalInitDone) {
        FT_Init(0, 0);
@@ -155,8 +143,7 @@ TM_Init(list)
 }
 
 int
-TM_Final(list)
-     register struct TM_Elem **list;
+TM_Final(struct TM_Elem **list)
 {
     if (list == NULL || *list == NULL)
        return -1;
@@ -172,11 +159,9 @@ TM_Final(list)
 */
 
 void
-TM_Insert(tlistPtr, elem)
-     struct TM_Elem *tlistPtr; /* pointer to head pointer of timer list */
-     struct TM_Elem *elem;     /* element to be inserted */
+TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *elem)
 {
-    register struct TM_Elem *next;
+    struct TM_Elem *next;
 
     /* TimeLeft must be set for function IOMGR with infinite timeouts */
     elem->TimeLeft = elem->TotalTime;
@@ -207,24 +192,19 @@ TM_Insert(tlistPtr, elem)
            next = tlistPtr;
     openafs_insque(elem, next->Prev);
 }
-\f
+
 /*
     Walks through the specified list and updates the TimeLeft fields in it.
     Returns number of expired elements in the list.
 */
 
 int
-TM_Rescan(tlist)
-     struct TM_Elem *tlist;    /* head pointer of timer list */
+TM_Rescan(struct TM_Elem *tlist)       /* head pointer of timer list */
 {
     struct timeval time;
-    register int expired;
+    int expired;
 
-#ifndef AFS_DJGPP_ENV
     FT_AGetTimeOfDay(&time, 0);
-#else
-    FT_GetTimeOfDay(&time, 0); /* we need a real time value */
-#endif
     expired = 0;
     FOR_ALL_ELTS(e, tlist, {
                 if (!blocking(e)) {
@@ -243,8 +223,7 @@ TM_Rescan(tlist)
 */
 
 struct TM_Elem *
-TM_GetExpired(tlist)
-     struct TM_Elem *tlist;    /* head pointer of timer list */
+TM_GetExpired(struct TM_Elem *tlist)   /* head pointer of timer list */
 {
     FOR_ALL_ELTS(e, tlist, {
                 if (!blocking(e)
@@ -263,10 +242,9 @@ TM_GetExpired(tlist)
 */
 
 struct TM_Elem *
-TM_GetEarliest(tlist)
-     struct TM_Elem *tlist;
+TM_GetEarliest(struct TM_Elem *tlist)
 {
-    register struct TM_Elem *e;
+    struct TM_Elem *e;
 
     e = tlist->Next;
     return (e == tlist ? NULL : e);