RX: Make rxi_Alloc return (void *)
[openafs.git] / src / rx / rx_event.c
index b6669df..f677392 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
@@ -18,8 +18,6 @@
 #include <sys/time_impl.h>
 #endif
 
-RCSID
-    ("$Header$");
 
 #ifdef KERNEL
 #ifndef UKERNEL
@@ -34,7 +32,6 @@ RCSID
 #include "rx/rx_kernel.h"
 #include "rx_kmutex.h"
 #ifdef RX_ENABLE_LOCKS
-#include "rx/rx_internal.h"
 #include "rx/rx.h"
 #endif /* RX_ENABLE_LOCKS */
 #include "rx/rx_globals.h"
@@ -62,7 +59,6 @@ extern void *osi_Alloc();
 #include "rx_lwp.h"
 #endif
 #ifdef RX_ENABLE_LOCKS
-#include "rx_internal.h"
 #include "rx.h"
 #endif /* RX_ENABLE_LOCKS */
 #include "rx_globals.h"
@@ -127,11 +123,11 @@ rxevent_adjTimes(struct clock *adjTime)
     int nAdjusted = 0;
     struct rxepoch *qep, *nqep;
     struct rxevent *qev, *nqev;
-    
+
     for (queue_Scan(&rxepoch_queue, qep, nqep, rxepoch)) {
        for (queue_Scan(&qep->events, qev, nqev, rxevent)) {
            if (clock_Gt(&qev->eventTime, adjTime)) {
-               clock_Sub(&qev->eventTime, adjTime); 
+               clock_Sub(&qev->eventTime, adjTime);
                nAdjusted++;
            }
        }
@@ -180,7 +176,7 @@ rxepoch_Allocate(struct clock *when)
      * and add them to the free queue */
     if (queue_IsEmpty(&rxepoch_free)) {
 #if    defined(AFS_AIX32_ENV) && defined(KERNEL)
-       ep = (struct rxepoch *)rxi_Alloc(sizeof(struct rxepoch));
+       ep = rxi_Alloc(sizeof(struct rxepoch));
        queue_Append(&rxepoch_free, &ep[0]), rxepoch_nFree++;
 #else
 #if defined(KERNEL) && !defined(UKERNEL) && defined(AFS_FBSD80_ENV)
@@ -216,8 +212,8 @@ rxepoch_Allocate(struct clock *when)
  * units. */
 
 static struct rxevent *
-_rxevent_Post(struct clock *when, struct clock *now, 
-             void (*func) (struct rxevent *, void *, void *, int), 
+_rxevent_Post(struct clock *when, struct clock *now,
+             void (*func) (struct rxevent *, void *, void *, int),
              void *arg, void *arg1, int arg2, int newargs)
 {
     struct rxevent *ev, *evqe, *evqpr;
@@ -229,8 +225,13 @@ _rxevent_Post(struct clock *when, struct clock *now,
     if (rx_Log_event) {
        struct clock now1;
        clock_GetTime(&now1);
-       fprintf(rx_Log_event, "%d.%d: rxevent_Post(%d.%d, %lp, %lp, %lp, %d)\n",
-               (int)now1.sec, (int)now1.usec, (int)when->sec, (int)when->usec,
+       fprintf(rx_Log_event, "%ld.%ld: rxevent_Post(%ld.%ld, "
+                             "%"AFS_PTR_FMT", %"AFS_PTR_FMT", "
+                             "%"AFS_PTR_FMT", %d)\n",
+               afs_printable_int32_ld(now1.sec),
+               afs_printable_int32_ld(now1.usec),
+               afs_printable_int32_ld(when->sec),
+               afs_printable_int32_ld(when->usec),
                func, arg,
                arg1, arg2);
     }
@@ -272,7 +273,7 @@ _rxevent_Post(struct clock *when, struct clock *now,
     if (queue_IsEmpty(&rxevent_free)) {
        int i;
 #if    defined(AFS_AIX32_ENV) && defined(KERNEL)
-       ev = (struct rxevent *)rxi_Alloc(sizeof(struct rxevent));
+       ev = rxi_Alloc(sizeof(struct rxevent));
        queue_Append(&rxevent_free, &ev[0]), rxevent_nFree++;
 #else
 
@@ -343,20 +344,20 @@ _rxevent_Post(struct clock *when, struct clock *now,
 }
 
 struct rxevent *
-rxevent_Post(struct clock *when, 
-            void (*func) (struct rxevent *, void *, void *), 
+rxevent_Post(struct clock *when,
+            void (*func) (struct rxevent *, void *, void *),
             void *arg, void *arg1)
 {
     struct clock now;
     clock_Zero(&now);
-    return _rxevent_Post(when, &now, 
+    return _rxevent_Post(when, &now,
                         (void (*)(struct rxevent *, void *, void *, int))func,
                         arg, arg1, 0, 0);
 }
 
 struct rxevent *
-rxevent_Post2(struct clock *when, 
-             void (*func) (struct rxevent *, void *, void *, int), 
+rxevent_Post2(struct clock *when,
+             void (*func) (struct rxevent *, void *, void *, int),
              void *arg, void *arg1, int arg2)
 {
     struct clock now;
@@ -365,18 +366,18 @@ rxevent_Post2(struct clock *when,
 }
 
 struct rxevent *
-rxevent_PostNow(struct clock *when, struct clock *now, 
-               void (*func) (struct rxevent *, void *, void *), 
+rxevent_PostNow(struct clock *when, struct clock *now,
+               void (*func) (struct rxevent *, void *, void *),
                void *arg, void *arg1)
 {
-    return _rxevent_Post(when, now, 
+    return _rxevent_Post(when, now,
                         (void (*)(struct rxevent *, void *, void *, int))func,
                         arg, arg1, 0, 0);
 }
 
 struct rxevent *
-rxevent_PostNow2(struct clock *when, struct clock *now, 
-                 void (*func) (struct rxevent *, void *, void *, int), 
+rxevent_PostNow2(struct clock *when, struct clock *now,
+                 void (*func) (struct rxevent *, void *, void *, int),
                 void *arg, void *arg1, int arg2)
 {
     return _rxevent_Post(when, now, func, arg, arg1, arg2, 1);
@@ -402,7 +403,8 @@ rxevent_Cancel_1(struct rxevent *ev, struct rx_call *call,
     if (rx_Log_event) {
        struct clock now;
        clock_GetTime(&now);
-       fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %lp, %lp)\n",
+       fprintf(rx_Log_event, "%d.%d: rxevent_Cancel_1(%d.%d, %"
+               AFS_PTR_FMT ", %p" AFS_PTR_FMT ")\n",
                (int)now.sec, (int)now.usec, (int)ev->eventTime.sec,
                (int)ev->eventTime.usec, ev->func.newfunc,
                ev->arg);