ovw_numHosts_perPage = maxY - OVW_NUM_FIXED_LINES;
/* allocate memory for a list of onode pointers for file server names */
- ovw_fsNames_o =
- (struct onode **)malloc(sizeof(struct onode *) *
- ovw_numHosts_perPage);
+ ovw_fsNames_o = malloc(sizeof(struct onode *) * ovw_numHosts_perPage);
if (ovw_fsNames_o == NULL) {
sprintf(errMsg, "[ %s ] Failed to allocate memory for FS onodes\n",
rn);
/* allocate memory for a list of onode pointers for cache manager names */
- ovw_cmNames_o =
- (struct onode **)malloc(sizeof(struct onode *) *
- ovw_numHosts_perPage);
+ ovw_cmNames_o = malloc(sizeof(struct onode *) * ovw_numHosts_perPage);
if (ovw_cmNames_o == NULL) {
sprintf(errMsg, "[ %s ] Failed to allocate memory for CM onodes\n",
rn);
* the file server statistics */
numBytes = fs_numHosts_perPage * sizeof(struct ServerInfo_line);
- fs_lines = (struct ServerInfo_line *)malloc(numBytes);
+ fs_lines = malloc(numBytes);
if (fs_lines == (struct ServerInfo_line *)0) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for FS data lines\n", rn,
for (i = 0; i < fs_numHosts_perPage; i++) {
for (arrIdx = 0; arrIdx < 2; arrIdx++) {
numBytes = fs_cols_perPage * sizeof(struct onode *);
- fs_lines_Ptr->data_o[arrIdx] = (struct onode **)malloc(numBytes);
+ fs_lines_Ptr->data_o[arrIdx] = malloc(numBytes);
if (fs_lines_Ptr->data_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for FS data onodes\n",
* labels */
for (arrIdx = 0; arrIdx < 3; arrIdx++) {
- fsLabels_o[arrIdx] =
- (struct onode **)malloc(sizeof(struct onode *) * fs_cols_perPage);
+ fsLabels_o[arrIdx] = malloc(sizeof(struct onode *) * fs_cols_perPage);
if (fsLabels_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate memory for FS label onodes\n",
* the file server statistics */
numBytes = cm_numHosts_perPage * sizeof(struct ServerInfo_line);
- cm_lines = (struct ServerInfo_line *)malloc(numBytes);
+ cm_lines = malloc(numBytes);
if (cm_lines == (struct ServerInfo_line *)0) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for CM data lines\n", rn,
for (i = 0; i < cm_numHosts_perPage; i++) {
for (arrIdx = 0; arrIdx < 2; arrIdx++) {
numBytes = cm_cols_perPage * sizeof(struct onode *);
- cm_lines_Ptr->data_o[arrIdx] = (struct onode **)malloc(numBytes);
+ cm_lines_Ptr->data_o[arrIdx] = malloc(numBytes);
if (cm_lines_Ptr->data_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate %d bytes for CM data onodes\n",
* labels */
for (arrIdx = 0; arrIdx < 3; arrIdx++) {
- cmLabels_o[arrIdx] =
- (struct onode **)malloc(sizeof(struct onode *) * cm_cols_perPage);
+ cmLabels_o[arrIdx] = malloc(sizeof(struct onode *) * cm_cols_perPage);
if (cmLabels_o[arrIdx] == NULL) {
sprintf(errMsg,
"[ %s ] Failed to allocate memory for CM label onodes\n",
if (*a_hostName == '\0')
return (-1);
- curr_item = (struct afsmon_hostEntry *)
- malloc(sizeof(struct afsmon_hostEntry));
+ curr_item = malloc(sizeof(struct afsmon_hostEntry));
if (curr_item == (struct afsmon_hostEntry *)0) {
fprintf(stderr, "Failed to allocate space for FS nameList\n");
return (-1);
if (*a_hostName == '\0')
return (-1);
- curr_item = (struct afsmon_hostEntry *)
- malloc(sizeof(struct afsmon_hostEntry));
+ curr_item = malloc(sizeof(struct afsmon_hostEntry));
if (curr_item == (struct afsmon_hostEntry *)0) {
fprintf(stderr, "Failed to allocate space for CM nameList\n");
return (-1);
}
if (curr_host->numThresh) {
numBytes = curr_host->numThresh * sizeof(struct Threshold);
- curr_host->thresh = (struct Threshold *)malloc(numBytes);
+ curr_host->thresh = malloc(numBytes);
if (curr_host->thresh == NULL) {
fprintf(stderr, "[ %s ] Memory Allocation error 1", rn);
afsmon_Exit(25);
}
if (curr_host->numThresh) {
numBytes = curr_host->numThresh * sizeof(struct Threshold);
- curr_host->thresh = (struct Threshold *)malloc(numBytes);
+ curr_host->thresh = malloc(numBytes);
if (curr_host->thresh == NULL) {
fprintf(stderr, "[ %s ] Memory Allocation error 2", rn);
afsmon_Exit(35);
/* >>> need to allocate rx connection info structure here <<< */
new_cmPR->data.AFSCB_CollData_val =
- (afs_int32 *) malloc(XSTAT_CM_FULLPERF_RESULTS_LEN
- * sizeof(afs_int32));
+ malloc(XSTAT_CM_FULLPERF_RESULTS_LEN
+ *sizeof(afs_int32));
if (new_cmPR->data.AFSCB_CollData_val == NULL) {
free(new_cmlist_item);
free(new_cmPR->connP);
if (numFS) {
numBytes = numFS * sizeof(struct fs_Display_Data);
- curr_fsData = (struct fs_Display_Data *)malloc(numBytes);
+ curr_fsData = malloc(numBytes);
if (curr_fsData == (struct fs_Display_Data *)0) {
fprintf(stderr, "[ %s ] Memory allocation failure\n", rn);
return (-1);
memset(curr_fsData, 0, numBytes);
numBytes = numFS * sizeof(struct fs_Display_Data);
- prev_fsData = (struct fs_Display_Data *)malloc(numBytes);
+ prev_fsData = malloc(numBytes);
if (prev_fsData == (struct fs_Display_Data *)0) {
fprintf(stderr, "[ %s ] Memory allocation failure\n", rn);
return (-5);
if (numCM) {
numBytes = numCM * sizeof(struct cm_Display_Data);
- curr_cmData = (struct cm_Display_Data *)malloc(numBytes);
+ curr_cmData = malloc(numBytes);
if (curr_cmData == (struct cm_Display_Data *)0) {
fprintf(stderr, "[ %s ] Memory allocation failure\n", rn);
return (-10);
memset(curr_cmData, 0, numBytes);
numBytes = numCM * sizeof(struct cm_Display_Data);
- prev_cmData = (struct cm_Display_Data *)malloc(numBytes);
+ prev_cmData = malloc(numBytes);
if (prev_cmData == (struct cm_Display_Data *)0) {
fprintf(stderr, "[ %s ] Memory allocation failure\n", rn);
return (-15);
/* Allocate an array of sockets for each fileserver we monitor */
FSsktbytes = numFS * sizeof(struct sockaddr_in);
- FSSktArray = (struct sockaddr_in *)malloc(FSsktbytes);
+ FSSktArray = malloc(FSsktbytes);
if (FSSktArray == (struct sockaddr_in *)0) {
fprintf(stderr,
"[ %s ] cannot malloc %d sockaddr_ins for fileservers\n",
/* Allocate an array of sockets for each cache manager we monitor */
CMsktbytes = numCM * sizeof(struct sockaddr_in);
- CMSktArray = (struct sockaddr_in *)malloc(CMsktbytes);
+ CMSktArray = malloc(CMsktbytes);
if (CMSktArray == (struct sockaddr_in *)0) {
fprintf(stderr,
"[ %s ] cannot malloc %d sockaddr_ins for CM entries\n",
fprintf(stderr,
"[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for curses window private space in base window\n",
mn, rn, sizeof(struct gator_cursesgwin));
- c_data =
- (struct gator_cursesgwin *)malloc(sizeof(struct gator_cursesgwin));
+ c_data = malloc(sizeof(struct gator_cursesgwin));
if (c_data == (struct gator_cursesgwin *)0) {
fprintf(stderr,
"[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for curses window private space in base window\n",
fprintf(stderr,
"[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for new gwin structure\n", mn,
rn, sizeof(struct gwin));
- newgwin = (struct gwin *)malloc(sizeof(struct gwin));
+ newgwin = malloc(sizeof(struct gwin));
if (newgwin == NULL) {
fprintf(stderr,
"[%s:%s] Can't malloc() %" AFS_SIZET_FMT " bytes for new gwin structure: Errno is %d\n",
fprintf(stderr,
"[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for curses window private space\n",
mn, rn, sizeof(struct gator_cursesgwin));
- c_data =
- (struct gator_cursesgwin *)malloc(sizeof(struct gator_cursesgwin));
+ c_data = malloc(sizeof(struct gator_cursesgwin));
if (c_data == (struct gator_cursesgwin *)0) {
fprintf(stderr,
"[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for curses window private space\n",
if (aframe->defaultLine)
free(aframe->defaultLine);
aframe->promptLine = gtx_CopyString(aprompt);
- tp = aframe->defaultLine = (char *)malloc(1024);
+ tp = aframe->defaultLine = malloc(1024);
if (tp == NULL)
return (-1);
if (adefault)
strparms.x = 0;
strparms.y = sizeparms.maxy - 1;
strparms.highlight = 1;
- tp = strparms.s = (char *)malloc(1024);
+ tp = strparms.s = malloc(1024);
strcpy(tp, aframe->promptLine);
strcat(tp, aframe->defaultLine);
WOP_DRAWSTRING(aframe->window, &strparms);
return ((struct gtx_frame *)0);
}
- newkeystate = (struct keymap_state *)
- malloc(sizeof(struct keymap_state));
+ newkeystate = malloc(sizeof(struct keymap_state));
if (newkeystate == (struct keymap_state *)0) {
/*
* Get rid of the frame AND the keymap before exiting.
* OK, it's not alreadyt there. Create a new list object, fill it
* in, and splice it on.
*/
- tlist = (struct gtxframe_dlist *)malloc(sizeof(struct gtxframe_dlist));
+ tlist = malloc(sizeof(struct gtxframe_dlist));
if (tlist == (struct gtxframe_dlist *)0)
return (-1);
tlist->data = (char *)aobj;
* Allocate the private data area, including the lower-level
* structure, then fill it in.
*/
- light_data =
- (struct gator_lightobj *)malloc(sizeof(struct gator_lightobj));
+ light_data = malloc(sizeof(struct gator_lightobj));
if (light_data == (struct gator_lightobj *)0) {
fprintf(stderr,
"[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for light object private data region, errno is %d\n",
return (errno);
}
- light_strparams =
- (struct gwin_strparams *)malloc(sizeof(struct gwin_strparams));
+ light_strparams = malloc(sizeof(struct gwin_strparams));
if (light_strparams == (struct gwin_strparams *)0) {
fprintf(stderr,
"[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for light object label in private data region, errno is %d\n",
fprintf(stderr,
"[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for new onode structure\n", mn,
rn, sizeof(struct onode));
- new_onode = (struct onode *)malloc(sizeof(struct onode));
+ new_onode = malloc(sizeof(struct onode));
if (new_onode == NULL) {
fprintf(stderr,
"[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for new onode structure; errno is %d\n",
return ((struct gator_textcb_hdr *)0);
} else if (gator_textcb_debug)
fprintf(stderr, "[%s] Text buffer allocated at %p\n", rn, newBuff);
- blankLine = (char *)malloc(a_maxCharsPerEntry + 1);
+ blankLine = malloc(a_maxCharsPerEntry + 1);
if (blankLine == NULL) {
fprintf(stderr,
"[%s] Can't allocate %d bytes for blank line buffer; errno is %d\n",
fprintf(stderr,
"[%s] Allocating %d bytes for the %d text entry array items\n",
rn, bytesToAllocate, a_maxEntriesStored);
- newEntries = (struct gator_textcb_entry *)malloc(bytesToAllocate);
+ newEntries = malloc(bytesToAllocate);
if (newEntries == (struct gator_textcb_entry *)0) {
fprintf(stderr,
"[%s] Can't allocate %d bytes for the %d-member text entry array; errno is %d\n",
fprintf(stderr,
"[%s] Allocating %d bytes for the text circular buffer header\n",
rn, bytesToAllocate);
- newHdr = (struct gator_textcb_hdr *)malloc(bytesToAllocate);
+ newHdr = malloc(bytesToAllocate);
if (newHdr == (struct gator_textcb_hdr *)0) {
fprintf(stderr,
"[%s] Can't allocate %d bytes for text circular buffer header; errno is %d\n",
fprintf(stderr,
"[%s:%s] Allocating %" AFS_SIZET_FMT " bytes for text object private data region\n",
mn, rn, sizeof(struct gator_textobj));
- text_data = (struct gator_textobj *)malloc(sizeof(struct gator_textobj));
+ text_data = malloc(sizeof(struct gator_textobj));
if (text_data == (struct gator_textobj *)0) {
fprintf(stderr,
"[%s:%s] Can't allocate %" AFS_SIZET_FMT " bytes for text object private data region, errno is %d\n",