struct CEBlock *block;
int i;
- block = (struct CEBlock *)malloc(sizeof(struct CEBlock));
+ block = malloc(sizeof(struct CEBlock));
if (!block) {
ViceLog(0, ("Failed malloc in GetCEBlock\n"));
ShutDownAndCore(PANIC);
return;
}
- block = (struct HTBlock *)malloc(sizeof(struct HTBlock));
+ block = malloc(sizeof(struct HTBlock));
if (!block) {
ViceLog(0, ("Failed malloc in GetHTBlock\n"));
ShutDownAndCore(PANIC);
H_UNLOCK;
return;
}
- list = (struct host **)malloc(hostCount * sizeof(struct host *));
+ list = malloc(hostCount * sizeof(struct host *));
if (!list) {
ViceLogThenPanic(0, ("Failed malloc in h_Enumerate (list)\n"));
}
}
/* insert into beginning of list for this bucket */
- chain = (struct h_UuidHashChain *)malloc(sizeof(struct h_UuidHashChain));
+ chain = malloc(sizeof(struct h_UuidHashChain));
if (!chain) {
ViceLogThenPanic(0, ("Failed malloc in h_AddHostToUuidHashTable_r\n"));
}
char hoststr[16];
/* insert into beginning of list for this bucket */
- chain = (struct h_AddrHashChain *)malloc(sizeof(struct h_AddrHashChain));
+ chain = malloc(sizeof(struct h_AddrHashChain));
if (!chain) {
ViceLogThenPanic(0, ("Failed malloc in h_AddHostToAddrHashTable_r\n"));
}
ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2),
ntohs(port)));
- interface = (struct Interface *)
- malloc(sizeof(struct Interface) + (sizeof(struct AddrPort) * number));
+ interface = malloc(sizeof(struct Interface)
+ + (sizeof(struct AddrPort) * number));
if (!interface) {
ViceLogThenPanic(0, ("Failed malloc in addInterfaceAddr_r\n"));
}
H_LOCK;
if ((code == RXGEN_OPCODE) ||
((code == 0) && (afs_uuid_equal(&interf.uuid, &nulluuid)))) {
- identP = (struct Identity *)malloc(sizeof(struct Identity));
+ identP = malloc(sizeof(struct Identity));
if (!identP) {
ViceLogThenPanic(0, ("Failed malloc in h_GetHost_r\n"));
}
}
} else if (code == 0) {
interfValid = 1;
- identP = (struct Identity *)malloc(sizeof(struct Identity));
+ identP = malloc(sizeof(struct Identity));
if (!identP) {
ViceLogThenPanic(0, ("Failed malloc in h_GetHost_r\n"));
}
if ((code == RXGEN_OPCODE) ||
((code == 0) && (afs_uuid_equal(&interf.uuid, &nulluuid)))) {
if (!identP)
- identP =
- (struct Identity *)malloc(sizeof(struct Identity));
+ identP = malloc(sizeof(struct Identity));
else
pident = 1;
code = 0;
} else if (code == 0) {
if (!identP)
- identP =
- (struct Identity *)malloc(sizeof(struct Identity));
+ identP = malloc(sizeof(struct Identity));
else
pident = 1;
idlist lids;
lids.idlist_len = 1;
- lids.idlist_val = (afs_int32 *) malloc(1 * sizeof(afs_int32));
+ lids.idlist_val = malloc(1 * sizeof(afs_int32));
if (!lids.idlist_val) {
ViceLogThenPanic(0, ("Failed malloc in h_UserName\n"));
}
if (host->interface) {
if_len = sizeof(struct Interface) +
((host->interface->numberOfInterfaces-1) * sizeof(struct AddrPort));
- ifp = (struct Interface *) malloc(if_len);
+ ifp = malloc(if_len);
osi_Assert(ifp != NULL);
memcpy(ifp, host->interface, if_len);
hdr.interfaces = host->interface->numberOfInterfaces;
if (host->hcps.prlist_val) {
hdr.hcps = host->hcps.prlist_len;
hcps_len = hdr.hcps * sizeof(afs_int32);
- hcps = (afs_int32 *) malloc(hcps_len);
+ hcps = malloc(hcps_len);
osi_Assert(hcps != NULL);
memcpy(hcps, host->hcps.prlist_val, hcps_len);
iov[iovcnt].iov_base = (char *) hcps;
if (hdr.interfaces) {
ifp_len = sizeof(struct Interface) +
((hdr.interfaces-1) * sizeof(struct AddrPort));
- ifp = (struct Interface *) malloc(ifp_len);
+ ifp = malloc(ifp_len);
osi_Assert(ifp != NULL);
iov[iovcnt].iov_base = (char *) ifp;
iov[iovcnt].iov_len = ifp_len;
}
if (hdr.hcps) {
hcps_len = hdr.hcps * sizeof(afs_int32);
- hcps = (afs_int32 *) malloc(hcps_len);
+ hcps = malloc(hcps_len);
osi_Assert(hcps != NULL);
iov[iovcnt].iov_base = (char *) hcps;
iov[iovcnt].iov_len = hcps_len;
if (!hdr.hcps && hdsk.hcps_valid) {
/* valid, zero-length host cps ; does this ever happen? */
- hcps = (afs_int32 *) malloc(sizeof(afs_int32));
+ hcps = malloc(sizeof(afs_int32));
osi_Assert(hcps != NULL);
}
* Allocate and initialize an interface structure for this host.
*/
if (found) {
- interface = (struct Interface *)
- malloc(sizeof(struct Interface) +
- (sizeof(struct AddrPort) * (count - 1)));
+ interface = malloc(sizeof(struct Interface) +
+ (sizeof(struct AddrPort) * (count - 1)));
if (!interface) {
ViceLogThenPanic(0, ("Failed malloc in initInterfaceAddr_r 1\n"));
}
interface->numberOfInterfaces = count;
} else {
- interface = (struct Interface *)
- malloc(sizeof(struct Interface) + (sizeof(struct AddrPort) * count));
+ interface = malloc(sizeof(struct Interface) +
+ (sizeof(struct AddrPort) * count));
if (!interface) {
ViceLogThenPanic(0, ("Failed malloc in initInterfaceAddr_r 2\n"));
}