libadmin & uss: Don't cast returns from malloc()

malloc() returns a (void *) on all of our current platforms. So,
don't bother casting the return value before assigning it - it's
unecessary noise.

Change-Id: I9a3387c07c6ee02efbaa1ec0035fcea8691f171c
Reviewed-on: http://gerrit.openafs.org/7462
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
This commit is contained in:
Simon Wilkinson 2012-05-17 12:21:57 +01:00 committed by Derrick Brashear
parent 0df1f0023a
commit 4d96d0d5e4
18 changed files with 71 additions and 94 deletions

View File

@ -226,8 +226,7 @@ util_DatabaseServerGetBegin(const char *cellName, void **iterationIdP,
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
database_server_get_p serv = calloc(1, sizeof(database_server_get_t));
char copyCell[MAXCELLCHARS];
@ -1335,9 +1334,8 @@ util_RPCStatsGetBegin(struct rx_connection *conn,
{
int rc = 0;
afs_status_t tst = 0;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
rpc_stat_get_p stat = (rpc_stat_get_p) malloc(sizeof(rpc_stat_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
rpc_stat_get_p stat = malloc(sizeof(rpc_stat_get_t));
if (conn == NULL) {
tst = ADMRXCONNNULL;
@ -1870,13 +1868,13 @@ util_CMGetServerPrefsBegin(struct rx_connection *conn, void **iterationIdP,
goto fail_util_CMGetServerPrefsBegin;
}
iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
iter = malloc(sizeof(afs_admin_iterator_t));
if (iter == NULL) {
tst = ADMNOMEM;
goto fail_util_CMGetServerPrefsBegin;
}
pref = (cm_srvr_pref_get_p) malloc(sizeof(cm_srvr_pref_get_t));
pref = malloc(sizeof(cm_srvr_pref_get_t));
if (pref == NULL) {
free(iter);
tst = ADMNOMEM;
@ -2097,13 +2095,13 @@ util_CMListCellsBegin(struct rx_connection *conn, void **iterationIdP,
goto fail_util_CMListCellsBegin;
}
iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
iter = malloc(sizeof(afs_admin_iterator_t));
if (iter == NULL) {
tst = ADMNOMEM;
goto fail_util_CMListCellsBegin;
}
cell = (cm_list_cell_get_p) malloc(sizeof(cm_list_cell_get_t));
cell = malloc(sizeof(cm_list_cell_get_t));
if (cell == NULL) {
free(iter);
tst = ADMNOMEM;
@ -2701,7 +2699,7 @@ util_RXDebugConnectionsBegin(rxdebugHandle_p handle, int allconns,
goto fail_util_RXDebugConnectionsBegin;
}
iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
iter = malloc(sizeof(afs_admin_iterator_t));
if (iter == NULL) {
tst = ADMNOMEM;
goto fail_util_RXDebugConnectionsBegin;
@ -2720,7 +2718,7 @@ util_RXDebugConnectionsBegin(rxdebugHandle_p handle, int allconns,
goto fail_util_RXDebugConnectionsBegin;
}
t = (rxdebug_conn_get_p) malloc(sizeof(rxdebug_conn_get_t));
t = malloc(sizeof(rxdebug_conn_get_t));
if (t == NULL) {
free(iter);
tst = ADMNOMEM;
@ -2964,7 +2962,7 @@ util_RXDebugPeersBegin(rxdebugHandle_p handle, void **iterationIdP,
goto fail_util_RXDebugPeersBegin;
}
iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
iter = malloc(sizeof(afs_admin_iterator_t));
if (iter == NULL) {
tst = ADMNOMEM;
goto fail_util_RXDebugPeersBegin;
@ -2983,7 +2981,7 @@ util_RXDebugPeersBegin(rxdebugHandle_p handle, void **iterationIdP,
goto fail_util_RXDebugPeersBegin;
}
t = (rxdebug_peer_get_p) malloc(sizeof(rxdebug_peer_get_t));
t = malloc(sizeof(rxdebug_peer_get_t));
if (t == NULL) {
free(iter);
tst = ADMNOMEM;

View File

@ -161,7 +161,7 @@ bos_ServerOpen(const void *cellHandle, const char *serverName,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
bos_server_p bos_server = (bos_server_p) malloc(sizeof(bos_server_t));
bos_server_p bos_server = malloc(sizeof(bos_server_t));
int serverAddress;
/*
@ -771,10 +771,8 @@ bos_ProcessNameGetBegin(const void *serverHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
process_name_get_p proc =
(process_name_get_p) malloc(sizeof(process_name_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
process_name_get_p proc = malloc(sizeof(process_name_get_t));
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessNameGetBegin;
@ -1095,9 +1093,8 @@ bos_ProcessParameterGetBegin(const void *serverHandle,
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
param_get_p param = (param_get_p) malloc(sizeof(param_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
param_get_p param = malloc(sizeof(param_get_t));
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_ProcessParameterGetBegin;
@ -1760,9 +1757,8 @@ bos_AdminGetBegin(const void *serverHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
admin_get_p admin = (admin_get_p) malloc(sizeof(admin_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
admin_get_p admin = malloc(sizeof(admin_get_t));
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_AdminGetBegin;
@ -2077,9 +2073,8 @@ bos_KeyGetBegin(const void *serverHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
key_get_p key = (key_get_p) malloc(sizeof(key_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
key_get_p key = malloc(sizeof(key_get_t));
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_KeyGetBegin;
@ -2484,9 +2479,8 @@ bos_HostGetBegin(const void *serverHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
bos_server_p b_handle = (bos_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
host_get_p host = (host_get_p) malloc(sizeof(host_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
host_get_p host = malloc(sizeof(host_get_t));
if (!isValidServerHandle(b_handle, &tst)) {
goto fail_bos_HostGetBegin;
@ -3523,7 +3517,7 @@ bos_Salvage(const void *cellHandle, const void *serverHandle,
if (log != NULL) {
logData = (char *)malloc(INITIAL_LOG_LEN);
logData = malloc(INITIAL_LOG_LEN);
if (!logData) {
tst = ADMNOMEM;
goto fail_bos_Salvage;

View File

@ -291,7 +291,7 @@ cfg_CellServDbEnumerate(const char *fsDbHost, /* fileserver or database host */
}
bufSize++; /* end multistring */
*cellDbHosts = (char *)malloc(bufSize);
*cellDbHosts = malloc(bufSize);
if (*cellDbHosts == NULL) {
tst = ADMNOMEM;
@ -428,7 +428,7 @@ CellServDbUpdate(int updateOp, void *hostHandle, const char *sysControlHost,
/* create control block */
ctrlBlockp = (cfg_csdb_update_ctrl_t *) malloc(sizeof(*ctrlBlockp));
ctrlBlockp = malloc(sizeof(*ctrlBlockp));
if (ctrlBlockp == NULL) {
tst = ADMNOMEM;
@ -493,8 +493,7 @@ CellServDbUpdate(int updateOp, void *hostHandle, const char *sysControlHost,
short nameBlockDone = 0;
while (!nameBlockDone) {
nameBlockp = ((cfg_csdb_update_name_t *)
malloc(sizeof(*nameBlockp)));
nameBlockp = malloc(sizeof(*nameBlockp));
if (nameBlockp == NULL) {
tst = ADMNOMEM;
@ -650,8 +649,8 @@ UpdateWorkerThread(void *argp)
/* alloc memory for status information (including host name) */
while ((statusp = (cfg_cellServDbStatus_t *)
malloc(sizeof(*statusp) + AFS_MAX_SERVER_NAME_LEN)) ==
while ((statusp =
malloc(sizeof(*statusp) + AFS_MAX_SERVER_NAME_LEN)) ==
NULL) {
/* avoid tight loop while waiting for status storage */
cfgutil_Sleep(1);
@ -818,7 +817,7 @@ NameBlockGetBegin(cfg_host_p cfg_host, const char *sysControlHost,
afs_status_t tst2, tst = 0;
cfg_csdb_nameblock_iteration_t *nbIterp;
nbIterp = (cfg_csdb_nameblock_iteration_t *) malloc(sizeof(*nbIterp));
nbIterp = malloc(sizeof(*nbIterp));
if (nbIterp == NULL) {
tst = ADMNOMEM;
@ -997,7 +996,7 @@ ServerNameGetBegin(cfg_host_p cfg_host, short dbOnly, void **iterationIdP,
afs_status_t tst2, tst = 0;
cfg_server_iteration_t *serverIterp;
serverIterp = (cfg_server_iteration_t *) malloc(sizeof(*serverIterp));
serverIterp = malloc(sizeof(*serverIterp));
if (serverIterp == NULL) {
tst = ADMNOMEM;

View File

@ -256,7 +256,7 @@ cfg_HostOpen(void *cellHandle, /* cell handle */
if (tst == 0) {
char *localHostName;
if ((cfg_host = (cfg_host_p) malloc(sizeof(cfg_host_t))) == NULL) {
if ((cfg_host = malloc(sizeof(cfg_host_t))) == NULL) {
tst = ADMNOMEM;
} else if ((localHostName = strdup(fullHostName)) == NULL) {
free(cfg_host);
@ -894,7 +894,7 @@ cfg_HostPartitionTableEnumerate(void *hostHandle, /* host config handle */
vpentryCountMax * (sizeof(cfg_partitionEntry_t) +
sizeof(struct vptab));
if ((metaTablep = (void *)malloc(metaTableSize)) == NULL) {
if ((metaTablep = malloc(metaTableSize)) == NULL) {
tst = ADMNOMEM;
} else {
int i;

View File

@ -480,8 +480,7 @@ cfgutil_HostAddressFetchAll(const char *hostName, int *addrCount,
for (i = 0; hentryp->h_addr_list[i] != NULL; i++);
aCount = i;
if ((aList =
(afs_int32 *) malloc(aCount * sizeof(afs_int32))) == NULL) {
if ((aList = malloc(aCount * sizeof(afs_int32))) == NULL) {
tst = ADMNOMEM;
} else {
for (i = 0; i < aCount; i++) {

View File

@ -1181,7 +1181,7 @@ cfg_UpdateServerStart(void *hostHandle, /* host config handle */
if (argsLen <= AFSDIR_PATH_MAX) {
args = argsBuf;
} else {
args = (char *)malloc(argsLen);
args = malloc(argsLen);
}
if (args == NULL) {
@ -1444,7 +1444,7 @@ cfg_UpdateClientStart(void *hostHandle, /* host config handle */
if (argsLen <= AFSDIR_PATH_MAX) {
args = argsBuf;
} else {
args = (char *)malloc(argsLen);
args = malloc(argsLen);
}
if (args == NULL) {
@ -1775,7 +1775,7 @@ SimpleProcessStart(void *bosHandle, const char *instance,
if (cmdLen <= AFSDIR_PATH_MAX) {
cmd = cmdBuf;
} else {
cmd = (char *)malloc(cmdLen);
cmd = malloc(cmdLen);
}
if (cmd == NULL) {

View File

@ -1822,8 +1822,7 @@ afsclient_AFSServerGetBegin(const void *cellHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
server_get_p serv = calloc(1, sizeof(server_get_t));
server_get_p serv_cache = NULL;
const char *cellName = NULL;
@ -2654,7 +2653,7 @@ afsclient_RXDebugOpen(const char *serverName, afs_stat_source_t type,
goto fail_afsclient_RXDebugOpen;
}
handle = (rxdebugHandle_p) malloc(sizeof(rxdebugHandle_t));
handle = malloc(sizeof(rxdebugHandle_t));
if (!handle) {
close(sock);
tst = ADMNOMEM;
@ -2739,7 +2738,7 @@ afsclient_RXDebugOpenPort(const char *serverName, int serverPort,
goto fail_afsclient_RXDebugOpenPort;
}
handle = (rxdebugHandle_p) malloc(sizeof(rxdebugHandle_t));
handle = malloc(sizeof(rxdebugHandle_t));
if (!handle) {
close(sock);
tst = ADMNOMEM;

View File

@ -361,7 +361,7 @@ kas_ServerOpen(const void *cellHandle, const char **serverList,
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
int server_count = 0, server_addr;
struct afsconf_cell server_info;
kas_server_p k_handle = (kas_server_p) malloc(sizeof(kas_server_t));
kas_server_p k_handle = malloc(sizeof(kas_server_t));
/*
* Validate input parameters
@ -916,10 +916,8 @@ kas_PrincipalGetBegin(const void *cellHandle, const void *serverHandle,
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
kas_server_p k_handle = (kas_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
principal_get_p principal =
(principal_get_p) malloc(sizeof(principal_get_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
principal_get_p principal = malloc(sizeof(principal_get_t));
/*
* Validate arguments

View File

@ -1151,7 +1151,7 @@ MemberListBegin(const void *cellHandle, const char *name, afs_status_t error1,
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
afs_int32 groupId = 0;
afs_int32 exceeded = 0;
pts_group_member_list_iterator_p iter = (pts_group_member_list_iterator_p)
pts_group_member_list_iterator_p iter =
malloc(sizeof(pts_group_member_list_iterator_t));
int iter_allocated = 0;
int ids_allocated = 0;
@ -2706,10 +2706,8 @@ pts_OwnedGroupListBegin(const void *cellHandle, const char *userName,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
owned_group_list_p list =
(owned_group_list_p) malloc(sizeof(owned_group_list_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
owned_group_list_p list = malloc(sizeof(owned_group_list_t));
/*
* Validate arguments
@ -3043,9 +3041,8 @@ pts_UserListBegin(const void *cellHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
pts_list_p list = (pts_list_p) malloc(sizeof(pts_list_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
pts_list_p list = malloc(sizeof(pts_list_t));
/*
* Validate arguments
@ -3227,9 +3224,8 @@ pts_GroupListBegin(const void *cellHandle, void **iterationIdP,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
pts_list_p list = (pts_list_p) malloc(sizeof(pts_list_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
pts_list_p list = malloc(sizeof(pts_list_t));
/*
* Validate arguments

View File

@ -104,7 +104,7 @@ LocalParseLine(char *aline, struct token **alist)
if (inToken) {
inToken = 0; /* end of this token */
*tptr++ = 0;
ttok = (struct token *)malloc(sizeof(struct token));
ttok = malloc(sizeof(struct token));
ttok->next = NULL;
ttok->key = strdup(tbuffer);
if (last) {

View File

@ -687,8 +687,7 @@ vos_PartitionGetBegin(const void *cellHandle, const void *serverHandle,
int rc = 0;
afs_status_t tst = 0;
file_server_p f_server = (file_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
partition_get_p part = calloc(1, sizeof(partition_get_t));
/*
@ -875,7 +874,7 @@ vos_ServerOpen(const void *cellHandle, const char *serverName,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
file_server_p f_server = (file_server_p) malloc(sizeof(file_server_t));
file_server_p f_server = malloc(sizeof(file_server_t));
int server_address;
struct rx_securityClass *sc[3];
int scIndex;
@ -1333,8 +1332,7 @@ vos_FileServerGetBegin(const void *cellHandle, vos_MessageCallBack_t callBack,
int rc = 0;
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
server_get_p serv = calloc(1, sizeof(server_get_t));
struct VLCallBack unused;
@ -1672,8 +1670,7 @@ vos_ServerTransactionStatusGetBegin(const void *cellHandle,
int rc = 0;
afs_status_t tst = 0;
file_server_p f_server = (file_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
transaction_get_p tran = calloc(1, sizeof(transaction_get_t));
@ -2121,8 +2118,7 @@ vos_VLDBGetBegin(const void *cellHandle, const void *serverHandle,
afs_status_t tst = 0;
afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
file_server_p f_server = (file_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
vldb_entry_get_p entry = calloc(1, sizeof(vldb_entry_get_t));
struct VldbListByAttributes attr;
@ -3801,8 +3797,7 @@ vos_VolumeGetBegin(const void *cellHandle, const void *serverHandle,
int rc = 0;
afs_status_t tst = 0;
file_server_p f_server = (file_server_p) serverHandle;
afs_admin_iterator_p iter =
(afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
volume_get_p entry = calloc(1, sizeof(volume_get_t));
/*

View File

@ -278,7 +278,7 @@ VLDB_ListAttributes(afs_cell_handle_p cellHandle,
*entriesp = arrayEntries.bulkentries_len;
blkentriesp->nbulkentries_val =
(nvldbentry *) malloc(*entriesp * sizeof(*blkentriesp));
malloc(*entriesp * sizeof(*blkentriesp));
if (blkentriesp->nbulkentries_val != NULL) {
for (i = 0; i < *entriesp; i++) {
OldVLDB_to_NewVLDB((struct vldbentry *)&arrayEntries.

View File

@ -1995,7 +1995,7 @@ t structure!! */
}
#endif
nbytes = blockSize;
buffer = (char *)malloc(blockSize);
buffer = malloc(blockSize);
if (!buffer) {
return ADMNOMEM;
}
@ -2190,7 +2190,7 @@ t structure!! */
blockSize = 4096;
}
#endif
buffer = (char *)malloc(blockSize);
buffer = malloc(blockSize);
if (!buffer) {
return ADMNOMEM;
}
@ -3951,7 +3951,7 @@ GroupEntries(struct rx_connection *server, volintInfo * pntr, afs_int32 count,
error = VOLSERBADOP;
}
} else { /*create a fresh entry */
qPtr = (struct aqueue *)malloc(sizeof(struct aqueue));
qPtr = malloc(sizeof(struct aqueue));
if (pntr->type == RWVOL) {
qPtr->isValid[RWVOL] = 1;
qPtr->isValid[BACKVOL] = 0;

View File

@ -1805,8 +1805,8 @@ main(int argc, char *argv[])
strcpy(uss_whoami, argv[0]);
yyin = (FILE *) NULL;
uss_fs_InBuff = (char *)malloc(USS_FS_MAX_SIZE); /*Cache Manager input buff */
uss_fs_OutBuff = (char *)malloc(USS_FS_MAX_SIZE); /*Cache Manager output buff */
uss_fs_InBuff = malloc(USS_FS_MAX_SIZE); /*Cache Manager input buff */
uss_fs_OutBuff = malloc(USS_FS_MAX_SIZE); /*Cache Manager output buff */
if (!uss_fs_InBuff || !uss_fs_OutBuff) {
fprintf(stderr, "%s: Can't malloc in/out buffers\n", uss_whoami);
exit(-1);

View File

@ -250,7 +250,7 @@ ChangeList(struct Acl *a_al, afs_int32 a_plus, char *a_name,
/*
* Otherwise, we make a new item and plug in the new data.
*/
tlist = (struct AclEntry *)malloc(sizeof(struct AclEntry));
tlist = malloc(sizeof(struct AclEntry));
strcpy(tlist->name, a_name);
tlist->rights = a_rights;
if (a_plus) {
@ -371,7 +371,7 @@ EmptyAcl(void)
struct Acl *tp;
tp = (struct Acl *)malloc(sizeof(struct Acl));
tp = malloc(sizeof(struct Acl));
tp->nplus = tp->nminus = 0;
tp->pluslist = tp->minuslist = 0;
return (tp);
@ -420,7 +420,7 @@ ParseAcl(char *a_str)
/*
* Allocate and initialize the first entry.
*/
ta = (struct Acl *)malloc(sizeof(struct Acl));
ta = malloc(sizeof(struct Acl));
ta->nplus = nplus;
ta->nminus = nminus;
@ -432,7 +432,7 @@ ParseAcl(char *a_str)
for (i = 0; i < nplus; i++) {
sscanf(a_str, "%100s %d", tname, &trights);
a_str = SkipLine(a_str);
tl = (struct AclEntry *)malloc(sizeof(struct AclEntry));
tl = malloc(sizeof(struct AclEntry));
if (!first)
first = tl;
strcpy(tl->name, tname);
@ -452,7 +452,7 @@ ParseAcl(char *a_str)
for (i = 0; i < nminus; i++) {
sscanf(a_str, "%100s %d", tname, &trights);
a_str = SkipLine(a_str);
tl = (struct AclEntry *)malloc(sizeof(struct AclEntry));
tl = malloc(sizeof(struct AclEntry));
if (!first)
first = tl;
strcpy(tl->name, tname);

View File

@ -559,8 +559,7 @@ uss_fs_UnlogToken(char *celln)
cnt++;
} while (!code);
count = cnt - 1;
tokenInfoP =
(struct tokenInfo *)malloc((sizeof(struct tokenInfo) * count));
tokenInfoP = malloc((sizeof(struct tokenInfo) * count));
for (code = index = index2 = 0; (!code) && (index < count); index++) {
tp = tokenInfoP + index;
code = ktc_ListTokens(index2, &index2, &tp->service);

View File

@ -144,7 +144,7 @@ uss_procs_BuildDir(char *a_path, char *a_mode, char *a_owner, char *a_access)
* Use our linked list to remember this directory's true ACL setting so
* we may set it correctly at the tail end of the account creation.
*/
new_dir = (struct uss_subdir *)malloc(sizeof(struct uss_subdir));
new_dir = malloc(sizeof(struct uss_subdir));
new_dir->previous = uss_currentDir;
new_dir->path = strdup(a_path);
new_dir->finalACL = strdup(a_access);

View File

@ -726,7 +726,7 @@ uss_vol_CreateVol(char *a_volname, char *a_server, char *a_partition,
* the code if we're doing a dry run.
*/
if (VolExistFlag) {
if ((Oldmpoint = (char *)malloc(strlen(a_mpoint) + 50)) == NULL) {
if ((Oldmpoint = malloc(strlen(a_mpoint) + 50)) == NULL) {
fprintf(stderr, "%s: No more memory!\n", uss_whoami);
return (1);
}
@ -822,7 +822,7 @@ uss_vol_CreateVol(char *a_volname, char *a_server, char *a_partition,
* properly, as well as all ACLs of future subdirectories,as the very last
* thing we do to the new account.
*/
new_dir = (struct uss_subdir *)malloc(sizeof(struct uss_subdir));
new_dir = malloc(sizeof(struct uss_subdir));
new_dir->previous = uss_currentDir;
new_dir->path = strdup(a_mpoint);
new_dir->finalACL = strdup(a_acl);