From cbdf31d9fff7be2bd99142a7c6ee7b04b96942fc Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 17 May 2012 12:26:37 +0100 Subject: [PATCH] dbservers: 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: I5a7c800e2836e7401f5f8bccf1aa2a1b223100b7 Reviewed-on: http://gerrit.openafs.org/7463 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/kauth/admin_tools.c | 2 +- src/kauth/kaaux.c | 4 ++-- src/kauth/kadatabase.c | 3 +-- src/kauth/kkids.c | 4 ++-- src/kauth/klogin.c | 2 +- src/kauth/test/test_interim_ktc.c | 8 ++++---- src/ptserver/map.c | 6 +++--- src/ptserver/pt_util.c | 6 +++--- src/ptserver/ptclient.c | 5 ++--- src/ptserver/ptprocs.c | 9 ++++----- src/ptserver/pts.c | 10 +++++----- src/ptserver/ptuser.c | 6 +++--- src/ptserver/ptutils.c | 2 +- src/ptserver/readgroup.c | 2 +- src/ptserver/readpwd.c | 2 +- src/ptserver/testpt.c | 6 +++--- src/ubik/disk.c | 3 +-- src/ubik/ubik.c | 7 +++---- src/ubik/ubikclient.c | 2 +- src/vlserver/cnvldb.c | 4 ++-- src/vlserver/vlclient.c | 11 ++++------- src/vlserver/vlprocs.c | 18 +++++++++--------- src/vlserver/vlutils.c | 6 +++--- 23 files changed, 60 insertions(+), 68 deletions(-) diff --git a/src/kauth/admin_tools.c b/src/kauth/admin_tools.c index a4a4ce6..f518eb2 100644 --- a/src/kauth/admin_tools.c +++ b/src/kauth/admin_tools.c @@ -1522,7 +1522,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock) afs_com_err(whoami, code, "prompting for %s", p + 1); return code; } - ip = (struct cmd_item *)malloc(sizeof(struct cmd_item)); + ip = malloc(sizeof(struct cmd_item)); ip->data = strdup(password); ip->next = 0; as->parms[i].items = ip; diff --git a/src/kauth/kaaux.c b/src/kauth/kaaux.c index 7f809ac..eea1402 100644 --- a/src/kauth/kaaux.c +++ b/src/kauth/kaaux.c @@ -35,7 +35,7 @@ xdr_ka_CBS(XDR * x, struct ka_CBS *abbs) if (len < 0 || len > MAXBS) return FALSE; if (!abbs->SeqBody) - abbs->SeqBody = (char *)malloc(len); + abbs->SeqBody = malloc(len); abbs->SeqLen = len; xdr_opaque(x, abbs->SeqBody, len); return TRUE; @@ -62,7 +62,7 @@ xdr_ka_BBS(XDR * x, struct ka_BBS *abbs) || (len > MAXBS) || (len > maxLen)) return FALSE; if (!abbs->SeqBody) - abbs->SeqBody = (char *)malloc(maxLen); + abbs->SeqBody = malloc(maxLen); abbs->MaxSeqLen = maxLen; abbs->SeqLen = len; if (!xdr_opaque(x, abbs->SeqBody, len)) diff --git a/src/kauth/kadatabase.c b/src/kauth/kadatabase.c index 5d59ba2..9d77106 100644 --- a/src/kauth/kadatabase.c +++ b/src/kauth/kadatabase.c @@ -99,8 +99,7 @@ init_kadatabase(int initFlags) Lock_Init(&keycache_lock); maxCachedKeys = 10; - keyCache = - (struct cachedKey *)malloc(maxCachedKeys * sizeof(struct cachedKey)); + keyCache = malloc(maxCachedKeys * sizeof(struct cachedKey)); keyCacheVersion = 0; if (initFlags & 4) { maxKeyLifetime = 90; diff --git a/src/kauth/kkids.c b/src/kauth/kkids.c index fb2f5b0..3439f63 100644 --- a/src/kauth/kkids.c +++ b/src/kauth/kkids.c @@ -238,7 +238,7 @@ ParseAcl(char *astr) sscanf(astr, "%d", &nminus); SkipLine(astr); - ta = (struct Acl *)malloc(sizeof(struct Acl)); + ta = malloc(sizeof(struct Acl)); ta->nplus = nplus; last = 0; @@ -246,7 +246,7 @@ ParseAcl(char *astr) for (i = 0; i < nplus; i++) { sscanf(astr, "%100s %d", tname, &trights); SkipLine(astr); - tl = (struct AclEntry *)malloc(sizeof(struct AclEntry)); + tl = malloc(sizeof(struct AclEntry)); if (!first) first = tl; strcpy(tl->name, tname); diff --git a/src/kauth/klogin.c b/src/kauth/klogin.c index 1300a22..c2975e6 100644 --- a/src/kauth/klogin.c +++ b/src/kauth/klogin.c @@ -392,7 +392,7 @@ main(int argc, char **argv) i = 0; while (environ[i] != NULL) i++; - envnew = (char **)malloc(sizeof(char *) * (i + 1)); + envnew = malloc(sizeof(char *) * (i + 1)); for (; i >= 0; i--) envnew[i] = environ[i]; environ = envnew; diff --git a/src/kauth/test/test_interim_ktc.c b/src/kauth/test/test_interim_ktc.c index f850ed9..58cf061 100644 --- a/src/kauth/test/test_interim_ktc.c +++ b/src/kauth/test/test_interim_ktc.c @@ -404,7 +404,7 @@ ParseAcl(astr) sscanf(astr, "%d", &nminus); astr = SkipLine(astr); - ta = (struct Acl *)malloc(sizeof(struct Acl)); + ta = malloc(sizeof(struct Acl)); ta->nplus = nplus; ta->nminus = nminus; @@ -413,7 +413,7 @@ ParseAcl(astr) for (i = 0; i < nplus; i++) { sscanf(astr, "%100s %d", tname, &trights); astr = SkipLine(astr); - tl = (struct AclEntry *)malloc(sizeof(struct AclEntry)); + tl = malloc(sizeof(struct AclEntry)); if (!first) first = tl; strcpy(tl->name, tname); @@ -430,7 +430,7 @@ ParseAcl(astr) for (i = 0; i < nminus; i++) { sscanf(astr, "%100s %d", tname, &trights); astr = SkipLine(astr); - tl = (struct AclEntry *)malloc(sizeof(struct AclEntry)); + tl = malloc(sizeof(struct AclEntry)); if (!first) first = tl; strcpy(tl->name, tname); @@ -516,7 +516,7 @@ AddTester(pathname) } al->nplus -= PruneList(&al->pluslist); - tlist = (struct AclEntry *)malloc(sizeof(struct AclEntry)); + tlist = malloc(sizeof(struct AclEntry)); tlist->rights = 9; strcpy(tlist->name, tester); tlist->next = al->pluslist; diff --git a/src/ptserver/map.c b/src/ptserver/map.c index ec94a10..07f6604 100644 --- a/src/ptserver/map.c +++ b/src/ptserver/map.c @@ -146,7 +146,7 @@ add_map(struct map *parm, int node) if (map->m_page == page) break; if (!map) { - map = (struct bitmap *)malloc(sizeof *map); + map = malloc(sizeof *map); if (!map) { #ifdef PRINT_MAP_ERROR printf("No memory!\n"); @@ -378,7 +378,7 @@ copy_map(struct map *parm) #endif map = MAP(parm); for (mpp = &result; (*mpp = 0), map; map = map->m_next) { - *mpp = (struct bitmap *)malloc(sizeof **mpp); + *mpp = malloc(sizeof **mpp); if (!*mpp) { #ifdef MAP_DEBUG if (Mflag) @@ -701,7 +701,7 @@ read_map(int (*f) (void *), char *arg) if (map->m_page == page) break; if (!map) { - map = (struct bitmap *)malloc(sizeof *map); + map = malloc(sizeof *map); if (!map) { #ifdef PRINT_MAP_ERROR printf("No memory!\n"); diff --git a/src/ptserver/pt_util.c b/src/ptserver/pt_util.c index 2c52e42..58288ef 100644 --- a/src/ptserver/pt_util.c +++ b/src/ptserver/pt_util.c @@ -296,7 +296,7 @@ CommandProc(struct cmd_syndesc *a_as, void *arock) code = CreateEntry(0, name, &id, 1 /*idflag */ , flags & PRGRP, oid, cid); if (code == PRBADNAM) { - u = (struct usr_list *)malloc(sizeof(struct usr_list)); + u = malloc(sizeof(struct usr_list)); u->next = usr_head; u->uid = id; strcpy(u->name, name); @@ -395,7 +395,7 @@ add_group(long id) i = grp_count++ % 1024; if (i == 0) { - g = (struct grp_list *)malloc(sizeof(struct grp_list)); + g = malloc(sizeof(struct grp_list)); g->next = grp_head; grp_head = g; } @@ -562,7 +562,7 @@ checkin(struct prentry *pre) last = he; he = he->next; } - he = (struct hash_entry *)malloc(sizeof(struct hash_entry)); + he = malloc(sizeof(struct hash_entry)); if (he == 0) { fprintf(stderr, "pt_util: No Memory for internal hash table.\n"); exit(1); diff --git a/src/ptserver/ptclient.c b/src/ptserver/ptclient.c index 2ed47ed..9457032 100644 --- a/src/ptserver/ptclient.c +++ b/src/ptserver/ptclient.c @@ -325,7 +325,7 @@ main(int argc, char **argv) if (CodeOk(code)) afs_com_err(whoami, code, "on %s %d %d", op, id, gid); } else if (!strcmp(op, "iton")) { - lid.idlist_val = (afs_int32 *) malloc(20 * sizeof(afs_int32)); + lid.idlist_val = malloc(20 * sizeof(afs_int32)); ptr = lid.idlist_val; lid.idlist_len = 0; foo = line; @@ -354,8 +354,7 @@ main(int argc, char **argv) lid.idlist_val = 0; lid.idlist_len = 0; } else if (!strcmp(op, "ntoi")) { - lnames.namelist_val = - (prname *) malloc(PR_MAXLIST * PR_MAXNAMELEN); + lnames.namelist_val = malloc(PR_MAXLIST * PR_MAXNAMELEN); lnames.namelist_len = 0; foo = line; skip(&foo); diff --git a/src/ptserver/ptprocs.c b/src/ptserver/ptprocs.c index 55ed490..4a1aafd 100644 --- a/src/ptserver/ptprocs.c +++ b/src/ptserver/ptprocs.c @@ -544,7 +544,7 @@ nameToID(struct rx_call *call, namelist *aname, idlist *aid) if (size < 0) return PRTOOMANY; - aid->idlist_val = (afs_int32 *) malloc(size * sizeof(afs_int32)); + aid->idlist_val = malloc(size * sizeof(afs_int32)); if (!aid->idlist_val) return PRNOMEM; @@ -631,7 +631,7 @@ idToName(struct rx_call *call, idlist *aid, namelist *aname) return 0; if (size < 0) return PRTOOMANY; - aname->namelist_val = (prname *) malloc(size * PR_MAXNAMELEN); + aname->namelist_val = malloc(size * PR_MAXNAMELEN); aname->namelist_len = 0; if (aname->namelist_val == 0) return PRNOMEM; @@ -1476,9 +1476,8 @@ put_prentries(struct prentry *tentry, prentries *bulkentries) if (bulkentries->prentries_val == 0) { bulkentries->prentries_len = 0; - bulkentries->prentries_val = - (struct prlistentries *)malloc(PR_MAXENTRIES * - sizeof(struct prentry)); + bulkentries->prentries_val = malloc(PR_MAXENTRIES * + sizeof(struct prentry)); if (!bulkentries->prentries_val) { return (PRNOMEM); } diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index f38daac..b00282a 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -84,7 +84,7 @@ pts_Source(struct cmd_syndesc *as, void *arock) perror(as->parms[0].items->data); return errno; } - sp = (struct sourcestack *)malloc(sizeof *sp); + sp = malloc(sizeof *sp); if (!sp) { return errno ? errno : ENOMEM; } else { @@ -403,7 +403,7 @@ GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, struct namelist *lnames n = 0; /* count names */ for (i = as->parms[0].items; i; i = i->next) n++; - nl->namelist_val = (prname *) malloc(n * PR_MAXNAMELEN); + nl->namelist_val = malloc(n * PR_MAXNAMELEN); nl->namelist_len = n; n = 0; for (i = as->parms[0].items; i; i = i->next) @@ -431,7 +431,7 @@ GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, struct namelist *lnames n = 0; for (i = as->parms[1].items; i; i = i->next) n++; - lids->idlist_val = (afs_int32 *) malloc(n * sizeof(afs_int32)); + lids->idlist_val = malloc(n * sizeof(afs_int32)); lids->idlist_len = n; n = 0; for (i = as->parms[1].items; i; i = i->next) { @@ -494,7 +494,7 @@ GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, lnames->namelist_len = 0; } for (i = as->parms[0].items; i; i = i->next) { - tnames.namelist_val = (prname *) malloc(PR_MAXNAMELEN); + tnames.namelist_val = malloc(PR_MAXNAMELEN); strncpy(tnames.namelist_val[0], i->data, PR_MAXNAMELEN); tnames.namelist_len = 1; tids.idlist_len = 0; @@ -724,7 +724,7 @@ CheckEntry(struct cmd_syndesc *as, void *arock) return PRBADARG; lids.idlist_len = 2; - lids.idlist_val = (afs_int32 *) malloc(sizeof(afs_int32) * 2); + lids.idlist_val = malloc(sizeof(afs_int32) * 2); lnames.namelist_len = 0; lnames.namelist_val = 0; diff --git a/src/ptserver/ptuser.c b/src/ptserver/ptuser.c index 230ba07..6c84e26 100644 --- a/src/ptserver/ptuser.c +++ b/src/ptserver/ptuser.c @@ -114,7 +114,7 @@ FindId(struct idhash *idhash, afs_int32 id) } /* Insert this id but return not found. */ - newChain = (struct idchain *)malloc(sizeof(struct idchain)); + newChain = malloc(sizeof(struct idchain)); if (!newChain) { return ENOMEM; } else { @@ -149,7 +149,7 @@ CreateIdList(struct idhash *idhash, idlist * alist, afs_int32 select) } alist->idlist_len = entries; - alist->idlist_val = (afs_int32 *) malloc(sizeof(afs_int32) * entries); + alist->idlist_val = malloc(sizeof(afs_int32) * entries); if (!alist->idlist_val) { return ENOMEM; } @@ -695,7 +695,7 @@ pr_IDListExpandedMembers(afs_int32 aid, namelist * lnames) if (code) { return code; } - stack = (afs_int32 *) malloc(sizeof(afs_int32) * maxstack); + stack = malloc(sizeof(afs_int32) * maxstack); if (!stack) { code = ENOMEM; goto done; diff --git a/src/ptserver/ptutils.c b/src/ptserver/ptutils.c index 594cdc4..5a1b740 100644 --- a/src/ptserver/ptutils.c +++ b/src/ptserver/ptutils.c @@ -1212,7 +1212,7 @@ AddToPRList(prlist *alist, int *sizeP, afs_int32 id) if (alist->prlist_val) { tmp = realloc(alist->prlist_val, count * sizeof(afs_int32)); } else { - tmp = (char *)malloc(count * sizeof(afs_int32)); + tmp = malloc(count * sizeof(afs_int32)); } if (!tmp) return (PRNOMEM); diff --git a/src/ptserver/readgroup.c b/src/ptserver/readgroup.c index a4904f9..183e05b 100644 --- a/src/ptserver/readgroup.c +++ b/src/ptserver/readgroup.c @@ -86,7 +86,7 @@ main(int argc, char **argv) verbose = 1; else { if (!strcmp(argv[i], "-c")) { - cellname = (char *)malloc(100); + cellname = malloc(100); strncpy(cellname, argv[++i], 100); } else strncpy(buf, argv[i], 150); diff --git a/src/ptserver/readpwd.c b/src/ptserver/readpwd.c index 51bd156..0713d5d 100644 --- a/src/ptserver/readpwd.c +++ b/src/ptserver/readpwd.c @@ -65,7 +65,7 @@ main(afs_int32 argc, char **argv) verbose = 1; else { if (!strcmp(argv[i], "-c")) { - cellname = (char *)malloc(100); + cellname = malloc(100); strncpy(cellname, argv[++i], 100); } else strncpy(buf, argv[i], 150); diff --git a/src/ptserver/testpt.c b/src/ptserver/testpt.c index 636ae5b..503149d 100644 --- a/src/ptserver/testpt.c +++ b/src/ptserver/testpt.c @@ -98,7 +98,7 @@ ListUsedIds(struct cmd_syndesc *as, void *arock) printf("Checking for %d %sused ids starting at %d.\n", number, (unused ? "un" : ""), startId); #define NUM 100 - lids.idlist_val = (afs_int32 *) malloc(sizeof(afs_int32) * NUM); + lids.idlist_val = malloc(sizeof(afs_int32) * NUM); lnames.namelist_len = 0; lnames.namelist_val = 0; while (number) { @@ -499,7 +499,7 @@ TestManyMembers(struct cmd_syndesc *as, void *arock) nCleaned = 0; ownerUser = lastGroup = 0; - groupOwners = (afs_int32 *) malloc(number * sizeof(afs_int32)); + groupOwners = malloc(number * sizeof(afs_int32)); nUsers = nGroups = nAdds = nRems = nUDels = nGDels = 0; while ((nFilled < number) || (nCleaned < number)) { @@ -558,7 +558,7 @@ TestManyMembers(struct cmd_syndesc *as, void *arock) /* check the membership list of all users for correctness */ printf("Starting check of memberships\n"); - glist = (afs_int32 *) malloc(number * sizeof(afs_int32)); + glist = malloc(number * sizeof(afs_int32)); for (u = 0; u < number; u++) { afs_int32 ui = users[u]; if (ui) { diff --git a/src/ubik/disk.c b/src/ubik/disk.c index ec8f479..86d43dd 100644 --- a/src/ubik/disk.c +++ b/src/ubik/disk.c @@ -420,8 +420,7 @@ GetTrunc(void) { struct ubik_trunc *tt; if (!freeTruncList) { - freeTruncList = - (struct ubik_trunc *)malloc(sizeof(struct ubik_trunc)); + freeTruncList = malloc(sizeof(struct ubik_trunc)); freeTruncList->next = (struct ubik_trunc *)0; } tt = freeTruncList; diff --git a/src/ubik/ubik.c b/src/ubik/ubik.c index 5895103..3199174 100644 --- a/src/ubik/ubik.c +++ b/src/ubik/ubik.c @@ -403,7 +403,7 @@ ubik_ServerInitCommon(afs_uint32 myHost, short myPort, initialize_U_error_table(); - tdb = (struct ubik_dbase *)malloc(sizeof(struct ubik_dbase)); + tdb = malloc(sizeof(struct ubik_dbase)); tdb->pathName = strdup(pathName); tdb->activeTrans = (struct ubik_trans *)0; memset(&tdb->version, 0, sizeof(struct ubik_version)); @@ -1049,10 +1049,9 @@ ubik_Write(struct ubik_trans *transPtr, void *vbuffer, if (!transPtr->iovec_info.iovec_wrt_val) { transPtr->iovec_info.iovec_wrt_len = 0; transPtr->iovec_info.iovec_wrt_val = - (struct ubik_iovec *)malloc(IOVEC_MAXWRT * - sizeof(struct ubik_iovec)); + malloc(IOVEC_MAXWRT * sizeof(struct ubik_iovec)); transPtr->iovec_data.iovec_buf_len = 0; - transPtr->iovec_data.iovec_buf_val = (char *)malloc(IOVEC_MAXBUF); + transPtr->iovec_data.iovec_buf_val = malloc(IOVEC_MAXBUF); if (!transPtr->iovec_info.iovec_wrt_val || !transPtr->iovec_data.iovec_buf_val) { if (transPtr->iovec_info.iovec_wrt_val) diff --git a/src/ubik/ubikclient.c b/src/ubik/ubikclient.c index 3e59c4a..1d23378 100644 --- a/src/ubik/ubikclient.c +++ b/src/ubik/ubikclient.c @@ -217,7 +217,7 @@ ubik_ClientInit(struct rx_connection **serverconns, return UMUTEXDESTROY; #endif } else { - tc = (struct ubik_client *)malloc(sizeof(struct ubik_client)); + tc = malloc(sizeof(struct ubik_client)); } if (tc == NULL) return UNOMEM; diff --git a/src/vlserver/cnvldb.c b/src/vlserver/cnvldb.c index 85cde3e..2217975 100644 --- a/src/vlserver/cnvldb.c +++ b/src/vlserver/cnvldb.c @@ -385,7 +385,7 @@ read_mhentries(afs_uint32 mh_addr, int oldfd) perror("seek MH block"); exit(1); } - base[0] = (struct extentaddr *)malloc(VL_ADDREXTBLK_SIZE); + base[0] = malloc(VL_ADDREXTBLK_SIZE); if (!base[0]) { perror("malloc1"); exit(1); @@ -430,7 +430,7 @@ read_mhentries(afs_uint32 mh_addr, int oldfd) perror("seek MH block"); exit(1); } - base[j] = (struct extentaddr *)malloc(VL_ADDREXTBLK_SIZE); + base[j] = malloc(VL_ADDREXTBLK_SIZE); if (!base[j]) { perror("malloc1"); exit(1); diff --git a/src/vlserver/vlclient.c b/src/vlserver/vlclient.c index ee6b554..4167d6e 100644 --- a/src/vlserver/vlclient.c +++ b/src/vlserver/vlclient.c @@ -286,8 +286,7 @@ handleit(struct cmd_syndesc *as, void *arock) afs_int32 index, count, num = 0, num1 = 0, next_index; struct Vlent *vl1; - VL = SVL = - (struct Vlent *)malloc(ALLOCNT * sizeof(struct Vlent)); + VL = SVL = malloc(ALLOCNT * sizeof(struct Vlent)); if (VL == NULL) { printf("Can't allocate memory...\n"); exit(1); @@ -335,8 +334,7 @@ handleit(struct cmd_syndesc *as, void *arock) 0, num31 = 0, num4 = 0, num41 = 0, next_index; struct vldbentry tentry; - VL = SVL = - (struct Vlent *)malloc(ALLOCNT * sizeof(struct Vlent)); + VL = SVL = malloc(ALLOCNT * sizeof(struct Vlent)); if (VL == NULL) { printf("Can't allocate memory...\n"); exit(1); @@ -408,8 +406,7 @@ handleit(struct cmd_syndesc *as, void *arock) 0; struct vldbentry tentry; - VL = SVL = - (struct Vlent *)malloc(ALLOCNT * sizeof(struct Vlent)); + VL = SVL = malloc(ALLOCNT * sizeof(struct Vlent)); if (VL == NULL) { printf("Can't allocate memory...\n"); exit(1); @@ -924,7 +921,7 @@ handleit(struct cmd_syndesc *as, void *arock) printf("Illegal # entries = %d\n", nargs); continue; } - addrp = (afs_uint32 *) malloc(20 * 4); + addrp = malloc(20 * 4); addrs.bulkaddrs_val = addrp; addrs.bulkaddrs_len = nargs; while (nargs > 0) { diff --git a/src/vlserver/vlprocs.c b/src/vlserver/vlprocs.c index c053329..c6e3c09 100644 --- a/src/vlserver/vlprocs.c +++ b/src/vlserver/vlprocs.c @@ -1263,7 +1263,7 @@ SVL_ListAttributes(struct rx_call *rxcall, return code; allocCount = VLDBALLOCCOUNT; Vldbentry = VldbentryFirst = vldbentries->bulkentries_val = - (vldbentry *) malloc(allocCount * sizeof(vldbentry)); + malloc(allocCount * sizeof(vldbentry)); if (Vldbentry == NULL) { code = VL_NOMEM; goto abort; @@ -1393,7 +1393,7 @@ SVL_ListAttributesN(struct rx_call *rxcall, return code; allocCount = VLDBALLOCCOUNT; Vldbentry = VldbentryFirst = vldbentries->nbulkentries_val = - (nvldbentry *) malloc(allocCount * sizeof(nvldbentry)); + malloc(allocCount * sizeof(nvldbentry)); if (Vldbentry == NULL) { code = VL_NOMEM; goto abort; @@ -1543,7 +1543,7 @@ SVL_ListAttributesN2(struct rx_call *rxcall, return code; Vldbentry = VldbentryFirst = vldbentries->nbulkentries_val = - (nvldbentry *) malloc(maxCount * sizeof(nvldbentry)); + malloc(maxCount * sizeof(nvldbentry)); if (Vldbentry == NULL) { countAbort(this_op); ubik_AbortTrans(ctx.trans); @@ -1812,7 +1812,7 @@ SVL_LinkedList(struct rx_call *rxcall, goto abort; } - vllist = (single_vldbentry *) malloc(sizeof(single_vldbentry)); + vllist = malloc(sizeof(single_vldbentry)); if (vllist == NULL) { code = VL_NOMEM; goto abort; @@ -1885,7 +1885,7 @@ SVL_LinkedList(struct rx_call *rxcall, continue; } - vllist = (single_vldbentry *) malloc(sizeof(single_vldbentry)); + vllist = malloc(sizeof(single_vldbentry)); if (vllist == NULL) { code = VL_NOMEM; goto abort; @@ -1948,7 +1948,7 @@ SVL_LinkedListN(struct rx_call *rxcall, goto abort; } - vllist = (single_nvldbentry *) malloc(sizeof(single_nvldbentry)); + vllist = malloc(sizeof(single_nvldbentry)); if (vllist == NULL) { code = VL_NOMEM; goto abort; @@ -2021,7 +2021,7 @@ SVL_LinkedListN(struct rx_call *rxcall, continue; } - vllist = (single_nvldbentry *) malloc(sizeof(single_nvldbentry)); + vllist = malloc(sizeof(single_nvldbentry)); if (vllist == NULL) { code = VL_NOMEM; goto abort; @@ -2107,7 +2107,7 @@ SVL_GetAddrs(struct rx_call *rxcall, VLog(5, ("GetAddrs\n")); addrsp->bulkaddrs_val = taddrp = - (afs_uint32 *) malloc(sizeof(afs_int32) * (MAXSERVERID + 1)); + malloc(sizeof(afs_int32) * (MAXSERVERID + 1)); nservers = *nentries = addrsp->bulkaddrs_len = 0; if (!taddrp) { @@ -2596,7 +2596,7 @@ SVL_GetAddrsU(struct rx_call *rxcall, goto abort; } addrsp->bulkaddrs_val = taddrp = - (afs_uint32 *) malloc(sizeof(afs_int32) * (MAXSERVERID + 1)); + malloc(sizeof(afs_int32) * (MAXSERVERID + 1)); nservers = *nentries = addrsp->bulkaddrs_len = 0; if (!taddrp) { code = VL_NOMEM; diff --git a/src/vlserver/vlutils.c b/src/vlserver/vlutils.c index 06f7efd..e34b134 100644 --- a/src/vlserver/vlutils.c +++ b/src/vlserver/vlutils.c @@ -221,7 +221,7 @@ readExtents(struct ubik_trans *trans) /* Read the first extension block */ if (!rd_ex_addr[0]) { - rd_ex_addr[0] = (struct extentaddr *)malloc(VL_ADDREXTBLK_SIZE); + rd_ex_addr[0] = malloc(VL_ADDREXTBLK_SIZE); if (!rd_ex_addr[0]) ERROR_EXIT(VL_NOMEM); } @@ -252,7 +252,7 @@ readExtents(struct ubik_trans *trans) /* Read the continuation block */ if (!rd_ex_addr[i]) { - rd_ex_addr[i] = (struct extentaddr *)malloc(VL_ADDREXTBLK_SIZE); + rd_ex_addr[i] = malloc(VL_ADDREXTBLK_SIZE); if (!rd_ex_addr[i]) ERROR_EXIT(VL_NOMEM); } @@ -402,7 +402,7 @@ GetExtentBlock(struct vl_ctx *ctx, register afs_int32 base) if (!ctx->ex_addr[0] || !ctx->ex_addr[0]->ex_contaddrs[base]) { /* Create a new extension block */ if (!ctx->ex_addr[base]) { - ctx->ex_addr[base] = (struct extentaddr *)malloc(VL_ADDREXTBLK_SIZE); + ctx->ex_addr[base] = malloc(VL_ADDREXTBLK_SIZE); if (!ctx->ex_addr[base]) ERROR_EXIT(VL_NOMEM); } -- 1.9.4