Remove AFS_PARISC_LINUX24_ENV references
[openafs.git] / src / lwp / timer.c
index cdc2285..b917294 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"
@@ -45,7 +37,7 @@ typedef unsigned char bool;
 
 #define expiration TotalTime
 
-#define new_elem()     ((struct TM_Elem *) malloc(sizeof(struct TM_Elem)))
+#define new_elem()     (malloc(sizeof(struct TM_Elem)))
 
 #define MILLION        1000000
 
@@ -53,10 +45,10 @@ static int globalInitDone = 0;
 
 /* t1 = t2 - t3 */
 static void
-subtract(register struct timeval *t1, register struct timeval *t2, 
-        register struct timeval *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,7 +78,7 @@ subtract(register struct timeval *t1, register struct timeval *t2,
 /* t1 += t2; */
 
 static void
-add(register struct timeval *t1, register struct timeval *t2)
+add(struct timeval *t1, struct timeval *t2)
 {
     t1->tv_usec += t2->tv_usec;
     t1->tv_sec += t2->tv_sec;
@@ -95,7 +87,7 @@ add(register struct timeval *t1, register struct timeval *t2)
        t1->tv_usec -= MILLION;
     }
 }
-\f
+
 /* t1 == t2 */
 
 int
@@ -108,7 +100,7 @@ TM_eql(struct timeval *t1, struct timeval *t2)
 
 /*
 obsolete, commentless procedure, all done by hand expansion now.
-static bool geq(register struct timeval *t1, register struct timeval *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);
@@ -116,11 +108,11 @@ static bool geq(register struct timeval *t1, register struct timeval *t2)
 */
 
 static bool
-blocking(register struct TM_Elem *t)
+blocking(struct TM_Elem *t)
 {
     return (t->TotalTime.tv_sec < 0 || t->TotalTime.tv_usec < 0);
 }
-\f
+
 
 
 /*
@@ -128,7 +120,7 @@ blocking(register struct TM_Elem *t)
 */
 
 int
-TM_Init(register struct TM_Elem **list)
+TM_Init(struct TM_Elem **list)
 {
     if (!globalInitDone) {
        FT_Init(0, 0);
@@ -151,7 +143,7 @@ TM_Init(register struct TM_Elem **list)
 }
 
 int
-TM_Final(register struct TM_Elem **list)
+TM_Final(struct TM_Elem **list)
 {
     if (list == NULL || *list == NULL)
        return -1;
@@ -169,7 +161,7 @@ TM_Final(register struct TM_Elem **list)
 void
 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;
@@ -200,7 +192,7 @@ TM_Insert(struct TM_Elem *tlistPtr, struct TM_Elem *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.
@@ -210,13 +202,9 @@ int
 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)) {
@@ -256,7 +244,7 @@ TM_GetExpired(struct TM_Elem *tlist)        /* head pointer of timer list */
 struct TM_Elem *
 TM_GetEarliest(struct TM_Elem *tlist)
 {
-    register struct TM_Elem *e;
+    struct TM_Elem *e;
 
     e = tlist->Next;
     return (e == tlist ? NULL : e);