afsmonitor & gtx: Don't cast returns from malloc()
[openafs.git] / src / afsmonitor / afsmon-win.c
index 550d313..d99ed5c 100644 (file)
@@ -1153,9 +1153,7 @@ create_ovwFrame_objects(void)
     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);
@@ -1186,9 +1184,7 @@ create_ovwFrame_objects(void)
 
 
     /* 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);
@@ -2189,7 +2185,7 @@ create_FSframe_objects(void)
      * 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,
@@ -2204,7 +2200,7 @@ create_FSframe_objects(void)
     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",
@@ -2276,8 +2272,7 @@ create_FSframe_objects(void)
      * 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",
@@ -2971,7 +2966,7 @@ create_CMframe_objects(void)
      * 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,
@@ -2986,7 +2981,7 @@ create_CMframe_objects(void)
     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",
@@ -3058,8 +3053,7 @@ create_CMframe_objects(void)
      * 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",