MUTEX_EXIT(&freeSQEList_lock);
} else { /* otherwise allocate a new one and return that */
MUTEX_EXIT(&freeSQEList_lock);
- sq = (struct rx_serverQueueEntry *)
- rxi_Alloc(sizeof(struct rx_serverQueueEntry));
+ sq = rxi_Alloc(sizeof(struct rx_serverQueueEntry));
MUTEX_INIT(&sq->lock, "server Queue lock", MUTEX_DEFAULT, 0);
CV_INIT(&sq->cv, "server Queue lock", CV_DEFAULT, 0);
}
MUTEX_EXIT(&freeSQEList_lock);
} else { /* otherwise allocate a new one and return that */
MUTEX_EXIT(&freeSQEList_lock);
- sq = (struct rx_serverQueueEntry *)
- rxi_Alloc(sizeof(struct rx_serverQueueEntry));
+ sq = rxi_Alloc(sizeof(struct rx_serverQueueEntry));
MUTEX_INIT(&sq->lock, "server Queue lock", MUTEX_DEFAULT, 0);
CV_INIT(&sq->cv, "server Queue lock", CV_DEFAULT, 0);
}
rxi_ResetCall(call, 1);
} else {
- call = (struct rx_call *)rxi_Alloc(sizeof(struct rx_call));
+ call = rxi_Alloc(sizeof(struct rx_call));
#ifdef RXDEBUG_PACKET
call->allNextp = rx_allCallsp;
rx_allCallsp = call;
}
afs_int32 rxi_Alloccnt = 0, rxi_Allocsize = 0;
-char *
+void *
rxi_Alloc(size_t size)
{
char *p;
sizeof(rx_interface_stat_t) +
totalFunc * sizeof(rx_function_entry_v1_t);
- rpc_stat = (rx_interface_stat_p) rxi_Alloc(space);
+ rpc_stat = rxi_Alloc(space);
if (rpc_stat == NULL) {
rc = 1;
goto fail;
if (space > (size_t) 0) {
*allocSize = space;
- ptr = *stats = (afs_uint32 *) rxi_Alloc(space);
+ ptr = *stats = rxi_Alloc(space);
if (ptr != NULL) {
rx_interface_stat_p rpc_stat, nrpc_stat;
if (space > (size_t) 0) {
*allocSize = space;
- ptr = *stats = (afs_uint32 *) rxi_Alloc(space);
+ ptr = *stats = rxi_Alloc(space);
if (ptr != NULL) {
rx_interface_stat_p rpc_stat, nrpc_stat;
* 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)
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
#define rxi_KeepAliveOff(call) rxevent_Cancel((call)->keepAliveEvent, call, RX_CALL_REFCOUNT_ALIVE)
#define rxi_NatKeepAliveOff(conn) rxevent_Cancel((conn)->natKeepAliveEvent, (struct rx_call*)0, 0)
-#define rxi_AllocSecurityObject() (struct rx_securityClass *) rxi_Alloc(sizeof(struct rx_securityClass))
+#define rxi_AllocSecurityObject() rxi_Alloc(sizeof(struct rx_securityClass))
#define rxi_FreeSecurityObject(obj) rxi_Free(obj, sizeof(struct rx_securityClass))
-#define rxi_AllocService() (struct rx_service *) rxi_Alloc(sizeof(struct rx_service))
+#define rxi_AllocService() rxi_Alloc(sizeof(struct rx_service))
#define rxi_FreeService(obj) \
do { \
MUTEX_DESTROY(&(obj)->svc_data_lock); \
rxi_Free((obj), sizeof(struct rx_service)); \
} while (0)
-#define rxi_AllocPeer() (struct rx_peer *) rxi_Alloc(sizeof(struct rx_peer))
+#define rxi_AllocPeer() rxi_Alloc(sizeof(struct rx_peer))
#define rxi_FreePeer(peer) rxi_Free(peer, sizeof(struct rx_peer))
-#define rxi_AllocConnection() (struct rx_connection *) rxi_Alloc(sizeof(struct rx_connection))
+#define rxi_AllocConnection() rxi_Alloc(sizeof(struct rx_connection))
#define rxi_FreeConnection(conn) (rxi_Free(conn, sizeof(struct rx_connection)))
EXT afs_int32 rx_stats_active GLOBALSINIT(1); /* boolean - rx statistics gathering */
extern void rxi_FreeCall(struct rx_call *call);
#endif /* RX_ENABLE_LOCKS */
-extern char *rxi_Alloc(size_t size);
+extern void *rxi_Alloc(size_t size);
extern void rxi_Free(void *addr, size_t size);
extern void rxi_SetPeerMtu(struct rx_peer *peer, afs_uint32 host,
afs_uint32 port, int mtu);
int size, psize;
size = sizeof(struct rx_securityClass);
- tsc = (struct rx_securityClass *)rxi_Alloc(size);
+ tsc = rxi_Alloc(size);
memset((void *)tsc, 0, size);
tsc->refCount = 1; /* caller gets one for free */
tsc->ops = &rxkad_client_ops;
psize = PDATA_SIZE(ticketLen);
- tcp = (struct rxkad_cprivate *)rxi_Alloc(psize);
+ tcp = rxi_Alloc(psize);
memset((void *)tcp, 0, psize);
tsc->privateData = (char *)tcp;
tcp->type |= rxkad_client;
if (rx_IsServerConn(aconn)) {
int size = sizeof(struct rxkad_sconn);
- aconn->securityData = (char *)rxi_Alloc(size);
+ aconn->securityData = rxi_Alloc(size);
memset(aconn->securityData, 0, size); /* initialize it conveniently */
} else { /* client */
struct rxkad_cprivate *tcp;
struct rxkad_cconn *tccp;
int size = sizeof(struct rxkad_cconn);
- tccp = (struct rxkad_cconn *)rxi_Alloc(size);
+ tccp = rxi_Alloc(size);
aconn->securityData = (char *)tccp;
memset(aconn->securityData, 0, size); /* initialize it conveniently */
tcp = (struct rxkad_cprivate *)aobj->privateData;