tmp = (char *)malloc(sizeof(dbadr) * size);
} else {
size = list->allocSize + 10;
- tmp = (char *)realloc(list->elements, sizeof(dbadr) * size);
+ tmp = realloc(list->elements, sizeof(dbadr) * size);
}
if (!tmp)
return BUDB_NOMEM;
(afs_int32 *) malloc(sizeof(afs_int32));
else
dumps->budb_dumpsList_val =
- (afs_int32 *) realloc(dumps->budb_dumpsList_val,
- (dumps->budb_dumpsList_len +
- 1) * sizeof(afs_int32));
+ realloc(dumps->budb_dumpsList_val,
+ (dumps->budb_dumpsList_len + 1)
+ * sizeof(afs_int32));
if (!dumps->budb_dumpsList_val)
ABORT(BUDB_NOMEM);
sizeof(afs_int32));
} else {
dumps->budb_dumpsList_val =
- (afs_int32 *) realloc(dumps->
- budb_dumpsList_val,
- count *
- sizeof(afs_int32));
+ realloc(dumps->budb_dumpsList_val,
+ count * sizeof(afs_int32));
flags->budb_dumpsList_val =
- (afs_int32 *) realloc(flags->
- budb_dumpsList_val,
- count *
- sizeof(afs_int32));
+ realloc(flags->budb_dumpsList_val,
+ count * sizeof(afs_int32));
}
if (!dumps->budb_dumpsList_val
|| !dumps->budb_dumpsList_val)
error_codes = (char **)malloc(sizeof(char *));
*error_codes = (char *)NULL;
}
- error_codes =
- (char **)realloc((char *)error_codes, (current + 2) * sizeof(char *));
+ error_codes = realloc(error_codes, (current + 2) * sizeof(char *));
error_codes[current++] = strdup(name);
error_codes[current] = (char *)NULL;
}
error_codes = (char **)malloc(sizeof(char *));
*error_codes = (char *)NULL;
}
- error_codes =
- (char **)realloc((char *)error_codes, (current + 2) * sizeof(char *));
+ error_codes = realloc(error_codes, (current + 2) * sizeof(char *));
error_codes[current++] = strdup(name);
error_codes[current] = (char *)NULL;
}
yy_size_t size;
#endif
{
- /* The cast to (char *) in the following accommodates both
- * implementations that use char* generic pointers, and those
- * that use void* generic pointers. It works with the latter
- * because both ANSI C and C++ allow castless assignment from
- * any pointer type to void*, and deal with argument conversions
- * as though doing an assignment.
- */
- return (void *) realloc( (char *) ptr, size );
+ return realloc( (char *) ptr, size );
}
#ifdef YY_USE_PROTOS
*/
len = strlen(xp->n_nptr) + 1;
while (len >= left) {
- export_strings = (char *)realloc(*strp, sz += SYMBUFSIZE);
+ export_strings = realloc(*strp, sz += SYMBUFSIZE);
if (!export_strings)
error("no memory for EXPORT string table");
*strp = export_strings;
return;
}
/* i == maxCachedKeys */
- keyCache =
- (struct cachedKey *)realloc(keyCache,
- (maxCachedKeys *=
- 2) * sizeof(struct cachedKey));
+ keyCache = realloc(keyCache, (maxCachedKeys *=2)
+ * sizeof(struct cachedKey));
if (keyCache == 0) {
es_Report("Can't realloc keyCache! out of memory?");
exit(123);
return;
}
}
- environ = (char **)realloc(environ, sizeof(char *) * (index + 2));
+ environ = realloc(environ, sizeof(char *) * (index + 2));
if (environ == NULL) {
fprintf(stderr, "login: malloc out of memory\n");
exit(1);
(serverHandle, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH,
&logLen, logData, &tst)) {
if (logLen > INITIAL_LOG_LEN) {
- logData = (char *)realloc(logData, (logLen + (logLen / 10)));
+ logData = realloc(logData, (logLen + (logLen / 10)));
if (logData == NULL) {
tst = ADMNOMEM;
goto fail_bos_Salvage;
}
if (ecount > lwp_cpptr->eventlistsize) {
- lwp_cpptr->eventlist =
- (void **)realloc(lwp_cpptr->eventlist,
- ecount * sizeof(void *));
+ lwp_cpptr->eventlist = realloc(lwp_cpptr->eventlist,
+ ecount * sizeof(void *));
lwp_cpptr->eventlistsize = ecount;
}
for (i = 0; i < ecount; i++)
if (ecount > lwp_cpptr->eventlistsize) {
void **save_eventlist = lwp_cpptr->eventlist;
- lwp_cpptr->eventlist = (char **)realloc(lwp_cpptr->eventlist,
- ecount*sizeof(char *));
+ lwp_cpptr->eventlist = realloc(lwp_cpptr->eventlist,
+ ecount*sizeof(char *));
if (lwp_cpptr->eventlist == NULL) {
lwp_cpptr->eventlist = save_eventlist;
Dispatcher();
if (n == maxstack) { /* need more stack space */
afs_int32 *tmp;
maxstack += n;
- tmp =
- (afs_int32 *) realloc(stack,
- maxstack * sizeof(afs_int32));
+ tmp = realloc(stack, maxstack * sizeof(afs_int32));
if (!tmp) {
code = ENOMEM;
xdr_free((xdrproc_t) xdr_prlist, &alist);
if (alist->prlist_len >= *sizeP) {
count = alist->prlist_len + 100;
if (alist->prlist_val) {
- tmp =
- (char *)realloc(alist->prlist_val, count * sizeof(afs_int32));
+ tmp = realloc(alist->prlist_val, count * sizeof(afs_int32));
} else {
tmp = (char *)malloc(count * sizeof(afs_int32));
}
iops_debug[index] =
(iops_debug_t *) malloc(avail * sizeof(iops_debug_t));
else
- iops_debug[index] =
- (iops_debug_t *) realloc(*iops, avail * sizeof(iops_debug_t));
+ iops_debug[index] = realloc(*iops, avail * sizeof(iops_debug_t));
if (!iops_debug[index]) {
printf("check_iops: Can't %salloc %lu bytes for index %d\n",
(avail == IOPS_DEBUG_MALLOC_STEP) ? "m" : "re",
case vSymlink:
if (v->size > symlink_size) {
if (symlink_buf)
- symlink_buf = (char *)realloc(symlink_buf, v->size + 1);
+ symlink_buf = realloc(symlink_buf, v->size + 1);
else
symlink_buf = (char *)malloc(v->size + 1);
symlink_size = symlink_buf ? v->size : 0;
nl = strlen(name);
if (path) {
- path = (char *)realloc(path, nl + pl + 2);
+ path = realloc(path, nl + pl + 2);
if (!path) {
if (phi->p->cb_error)
(phi->p->cb_error) (ENOMEM, 1, phi->p->err_refcon,
}
/* iff we found a null, i < BUFSIZE and buf[i] holds the NUL */
if (result)
- result = (unsigned char *)realloc(result, l + i + 1);
+ result = realloc(result, l + i + 1);
else
result = (unsigned char *)malloc(i + 1);
if (!result)
while (fgets(line, MAXLINE, fp)) {
if (nksyms >= availksyms) {
availksyms += KSYM_ALLOC_STEP;
- ksyms =
- (symlist_t *) realloc(ksyms, availksyms * sizeof(symlist_t));
+ ksyms = realloc(ksyms, availksyms * sizeof(symlist_t));
if (!ksyms) {
printf("Failed to realloc %d symbols.\n", availksyms);
exit(1);
(struct server **)malloc(NserversAllocated *
sizeof(struct server *));
} else {
- serversFound =
- (struct server **)realloc((char *)serversFound,
- NserversAllocated *
- sizeof(struct server *));
+ serversFound = realloc(serversFound,
+ NserversAllocated *
+ sizeof(struct server *));
}
if (!serversFound) {
printf("Can't allocate %lu bytes for list of found servers.\n",
&& (allocCount > vldbentries->bulkentries_len)) {
vldbentries->bulkentries_val =
- (vldbentry *) realloc(vldbentries->bulkentries_val,
- vldbentries->bulkentries_len *
- sizeof(vldbentry));
+ realloc(vldbentries->bulkentries_val,
+ vldbentries->bulkentries_len * sizeof(vldbentry));
if (vldbentries->bulkentries_val == NULL) {
code = VL_NOMEM;
goto abort;
&& (allocCount > vldbentries->nbulkentries_len)) {
vldbentries->nbulkentries_val =
- (nvldbentry *) realloc(vldbentries->nbulkentries_val,
- vldbentries->nbulkentries_len *
- sizeof(nvldbentry));
+ realloc(vldbentries->nbulkentries_val,
+ vldbentries->nbulkentries_len * sizeof(nvldbentry));
if (vldbentries->nbulkentries_val == NULL) {
code = VL_NOMEM;
goto abort;
* then grow in increments of VLDBALLOCINCR.
*/
allo = (*alloccnt > VLDBALLOCLIMIT) ? VLDBALLOCINCR : *alloccnt;
- reall =
- (vldbentry *) realloc(*VldbentryFirst,
- (*alloccnt + allo) * sizeof(vldbentry));
+ reall = realloc(*VldbentryFirst,
+ (*alloccnt + allo) * sizeof(vldbentry));
if (reall == NULL)
return VL_NOMEM;
* then grow in increments of VLDBALLOCINCR.
*/
allo = (*alloccnt > VLDBALLOCLIMIT) ? VLDBALLOCINCR : *alloccnt;
- reall =
- (nvldbentry *) realloc(*VldbentryFirst,
- (*alloccnt + allo) * sizeof(nvldbentry));
+ reall = realloc(*VldbentryFirst,
+ (*alloccnt + allo) * sizeof(nvldbentry));
if (reall == NULL)
return VL_NOMEM;
renames = (xfs_Rename_t *)
malloc(n_avail * sizeof(xfs_Rename_t));
else
- renames = (xfs_Rename_t *)
- realloc((char *)renames,
- n_avail * sizeof(xfs_Rename_t));
+ renames = realloc(renames,
+ n_avail * sizeof(xfs_Rename_t));
if (!renames) {
Log("Can't %salloc %lu bytes for rename list.\n",
(n_avail == N_RENAME_STEP) ? "m" : "re",
(dirEntry->numEntries)++;
assert(dirEntry->vnodeName =
- (VnodeName *) realloc(dirEntry->vnodeName,
- dirEntry->numEntries * sizeof(VnodeName)));
+ realloc(dirEntry->vnodeName,
+ dirEntry->numEntries * sizeof(VnodeName)));
dirEntry->vnodeName[dirEntry->numEntries - 1].vnode = vnode;
dirEntry->vnodeName[dirEntry->numEntries - 1].vunique = unique;
dirEntry->vnodeName[dirEntry->numEntries - 1].name = strdup(fileName);
Log("warning: there is likely a bug in the volume update scanner\n");
return;
}
- UpdateList =
- (VolumeId *) realloc(UpdateList,
- sizeof(VolumeId) * updateSize);
+ UpdateList = realloc(UpdateList,
+ sizeof(VolumeId) * updateSize);
}
}
osi_Assert(UpdateList != NULL);
partList =
(partInfo *) malloc(nAvail * sizeof(partInfo));
else
- partList =
- (partInfo *) realloc((char *)partList,
- nAvail * sizeof(partInfo));
+ partList = realloc(partList,
+ nAvail * sizeof(partInfo));
if (!partList) {
printf
("Failed to %salloc %d bytes for partition list.\n",
TRELE(tt);
return E2BIG;
}
- *aname = (char *)realloc(*aname, len);
+ *aname = realloc(*aname, len);
strcpy(*aname, td->name);
TClearRxCall(tt);
if (TRELE(tt))
if ((allocSize - volumeInfo->volEntries_len) < 5) {
/*running out of space, allocate more space */
allocSize = (allocSize * 3) / 2;
- pntr =
- (volintInfo *) realloc((char *)volumeInfo->volEntries_val,
- allocSize * sizeof(volintInfo));
+ pntr = realloc(volumeInfo->volEntries_val,
+ allocSize * sizeof(volintInfo));
if (pntr == NULL) {
closedir(dirp);
return VOLSERNO_MEMORY;
transInfo->transDebugEntries_len += 1;
if ((allocSize - transInfo->transDebugEntries_len) < 5) { /*alloc some more space */
allocSize = (allocSize * 3) / 2;
- pntr =
- (transDebugInfo *) realloc((char *)transInfo->
- transDebugEntries_val,
- allocSize *
- sizeof(transDebugInfo));
+ pntr = realloc(transInfo->transDebugEntries_val,
+ allocSize * sizeof(transDebugInfo));
transInfo->transDebugEntries_val = pntr;
pntr =
transInfo->transDebugEntries_val +
} else {
/* Grow the tarray to keep the extra entries */
parraysize = (centries * sizeof(struct nvldbentry));
- ttarray =
- (struct nvldbentry *)realloc(tarray,
- tarraysize + parraysize);
+ ttarray = realloc(tarray, tarraysize + parraysize);
if (!ttarray) {
fprintf(STDERR,
"Could not allocate enough space for the VLDB entries\n");