afsmonitor & gtx: Don't cast returns from malloc()
[openafs.git] / src / afsmonitor / afsmon-win.c
index e54d17f..d99ed5c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
 
 #include <stdio.h>
 #include <signal.h>
 #include <math.h>
-#include <cmd.h>
-#ifdef HAVE_STRING_H
+#include <afs/cmd.h>
 #include <string.h>
-#endif
 #undef IN
 #include <time.h>
 
-#include <gtxwindows.h>                /*Generic window package */
-#include <gtxobjects.h>                /*Object definitions */
+#include <afs/gtxwindows.h>            /*Generic window package */
+#include <afs/gtxobjects.h>            /*Object definitions */
+#include <afs/gtxkeymap.h>
 #if 0
-#include <gtxtextcb.h>         /*Text object circular buffer interface */
-#include <gtxtextobj.h>                /*Text object interface */
+#include <afs/gtxtextcb.h>             /*Text object circular buffer interface */
+#include <afs/gtxtextobj.h>            /*Text object interface */
 #endif
-#include <gtxlightobj.h>       /*Light object interface */
-#include <gtxcurseswin.h>      /*Curses window package */
-#include <gtxdumbwin.h>                /*Dumb terminal window package */
-#include <gtxX11win.h>         /*X11 window package */
-#include <gtxframe.h>          /*Frame package */
+#include <afs/gtxlightobj.h>   /*Light object interface */
+#include <afs/gtxcurseswin.h>  /*Curses window package */
+#include <afs/gtxdumbwin.h>            /*Dumb terminal window package */
+#include <afs/gtxX11win.h>             /*X11 window package */
+#include <afs/gtxframe.h>              /*Frame package */
 
 #include <afs/xstat_fs.h>
 #include <afs/xstat_cm.h>
@@ -327,16 +324,9 @@ struct onode **cmLabels_o[3];
  *------------------------------------------------------------------------*/
 
 static struct onode *
-initLightObject(a_name, a_x, a_y, a_width, a_win)
-     char *a_name;
-     int a_x;
-     int a_y;
-     int a_width;
-     struct gwin *a_win;
-
+initLightObject(char *a_name, int a_x, int a_y, int a_width,
+               struct gwin *a_win)
 {                              /*initLightObject */
-
-    static char rn[] = "initLightObject";      /*Routine name */
     struct onode *newlightp;   /*Ptr to new light onode */
     struct gator_light_crparams light_crparams;        /*Light creation params */
     char *truncname;           /*Truncated name, if needed */
@@ -429,13 +419,8 @@ initLightObject(a_name, a_x, a_y, a_width, a_win)
  *------------------------------------------------------------------------*/
 
 int
-justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc)
-     char *a_srcbuff;
-     char *a_dstbuff;
-     int a_dstwidth;
-     int a_justification;
-     int a_rightTrunc;
-
+justify_light(char *a_srcbuff, char *a_dstbuff, int a_dstwidth,
+             int a_justification, int a_rightTrunc)
 {                              /*justify_light */
 
     static char rn[] = "justify_light";        /*Routine name */
@@ -462,7 +447,7 @@ justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc)
      * we automatically shorten up.
      */
     if (a_dstwidth > GATOR_LABEL_CHARS) {
-       /* 
+       /*
         * if (afsmon_debug) {
         * fprintf(debugFD,
         * "[%s] Dest width (%d) > gtx buflen (%d), shrinking dest width\n",
@@ -552,12 +537,12 @@ justify_light(a_srcbuff, a_dstbuff, a_dstwidth, a_justification, a_rightTrunc)
  *
  * Description:
  *     Call the exit routine. This function is mapped
- *     to the keys Q and \ 3 in all the frames and is called by the 
+ *     to the keys Q and \ 3 in all the frames and is called by the
  *     gtx input server.
  *----------------------------------------------------------------------*/
 
 int
-afsmonExit_gtx()
+afsmonExit_gtx(void *d1, void *d2)
 {
     static char rn[] = "afsmonExit_gtx";
 
@@ -567,6 +552,7 @@ afsmonExit_gtx()
     }
 
     afsmon_Exit(0);
+    return 0; /* not reached */
 }
 
 
@@ -586,12 +572,11 @@ afsmonExit_gtx()
  *----------------------------------------------------------------------*/
 
 int
-ovw_refresh(a_pageNum, a_updateType)
-     int a_pageNum;            /* page to refresh overview display */
-     int a_updateType;         /* OVW_UPDATE_FS = update fs column only,
+ovw_refresh(int a_pageNum,     /* page to refresh overview display */
+           int a_updateType)   /* OVW_UPDATE_FS = update fs column only,
                                 * OVW_UPDATE_CM = update cm column only,
-                                * OVW_UPDATE_BOTH = update fs & cm columns. Note that 
-                                * we do not want to update a column until the 
+                                * OVW_UPDATE_BOTH = update fs & cm columns. Note that
+                                * we do not want to update a column until the
                                 * corresponding probe cycle has completed */
 {                              /* ovw_refresh */
 
@@ -603,8 +588,6 @@ ovw_refresh(a_pageNum, a_updateType)
     struct cm_Display_Data *cmDataP;   /* ptr to CM display data array */
     int fsIdx;                 /* for counting # of CM hosts */
     int cmIdx;                 /* for counting # of CM hosts */
-    int next_page = 0;         /* is there a next ovw page ? */
-    int prev_page = 0;         /* is there a previous ovw page */
     char cmdLine[80];          /* buffer for command line */
     char printBuf[256];                /* buffer to print to screen */
     int i;
@@ -617,7 +600,7 @@ ovw_refresh(a_pageNum, a_updateType)
        fflush(debugFD);
     }
 
-    /* if the data is not yet available  ie., not one probe cycle has 
+    /* if the data is not yet available  ie., not one probe cycle has
      * completed, do nothing */
 
     if ((a_updateType & OVW_UPDATE_FS) && !fs_Data_Available)
@@ -714,9 +697,6 @@ ovw_refresh(a_pageNum, a_updateType)
 
     strcat(cmdLine, "]? ");
 
-
-
-
     /* display the command line */
     tmp_lightobj = (struct gator_lightobj *)ovw_cmd_o->o_data;
     sprintf(printBuf, "%s", cmdLine);
@@ -733,8 +713,6 @@ ovw_refresh(a_pageNum, a_updateType)
                  RIGHT_JUSTIFY, 1);
     gator_light_set(ovw_probeNum_o, 1);
 
-
-
     /* update the file server names column if we are asked to */
 
     if (numFS && (a_updateType & OVW_UPDATE_FS)) {
@@ -903,7 +881,7 @@ ovw_refresh(a_pageNum, a_updateType)
  *             Switch from the overview screen to the FS screen
  *----------------------------------------------------------------------*/
 int
-Switch_ovw_2_fs()
+Switch_ovw_2_fs(void *d1, void *d2)
 {
     static char rn[] = "Switch_ovw_2_fs";
 
@@ -925,7 +903,7 @@ Switch_ovw_2_fs()
  *             Switch from the overview screen to the CM screen
  *----------------------------------------------------------------------*/
 int
-Switch_ovw_2_cm()
+Switch_ovw_2_cm(void *d1, void *d2)
 {
     static char rn[] = "Switch_ovw_2_cm";
 
@@ -947,7 +925,7 @@ Switch_ovw_2_cm()
  *             Switch to the next page in overview screen
  *----------------------------------------------------------------------*/
 int
-Switch_ovw_next()
+Switch_ovw_next(void *d1, void *d2)
 {
     static char rn[] = "Switch_ovw_next";
 
@@ -971,7 +949,7 @@ Switch_ovw_next()
  *             Switch to the last page in the overview screen
  *----------------------------------------------------------------------*/
 int
-Switch_ovw_last()
+Switch_ovw_last(void *d1, void *d2)
 {
     static char rn[] = "Switch_ovw_last";
 
@@ -995,7 +973,7 @@ Switch_ovw_last()
  *             Switch to the previous page in the overview screen
  *----------------------------------------------------------------------*/
 int
-Switch_ovw_prev()
+Switch_ovw_prev(void *d1, void *d2)
 {
     static char rn[] = "Switch_ovw_prev";
 
@@ -1018,7 +996,7 @@ Switch_ovw_prev()
  *             Switch to the first page in the overview screen
  *----------------------------------------------------------------------*/
 int
-Switch_ovw_first()
+Switch_ovw_first(void *d1, void *d2)
 {
     static char rn[] = "Switch_ovw_first";
 
@@ -1051,14 +1029,13 @@ Switch_ovw_first()
  *----------------------------------------------------------------------*/
 
 int
-create_ovwFrame_objects()
+create_ovwFrame_objects(void)
 {                              /* create_ovwFrame_objects */
 
     static char rn[] = "create_ovwFrame_objects";
     int hostLines;             /* number of lines of host names to display */
     struct onode **ovw_fsNames_o_Ptr;  /* index to list of fs names onodes */
     struct onode **ovw_cmNames_o_Ptr;  /* index to list of cm names onodes */
-    int code;
     int i;
 
     if (afsmon_debug) {
@@ -1088,8 +1065,8 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create initMsg_o onode\n", rn);
        afsmon_Exit(250);
     }
-    code = gtxframe_AddToList(ovwFrame, initMsg_o);
-    code = gator_light_set(initMsg_o, HIGHLIGHT);
+    gtxframe_AddToList(ovwFrame, initMsg_o);
+    gator_light_set(initMsg_o, HIGHLIGHT);
     initMsg_on = 1;
 
 
@@ -1101,8 +1078,8 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create command onode\n", rn);
        afsmon_Exit(265);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_cmd_o);
-    code = gator_light_set(ovw_cmd_o, HIGHLIGHT);
+    gtxframe_AddToList(ovwFrame, ovw_cmd_o);
+    gator_light_set(ovw_cmd_o, HIGHLIGHT);
 
     /* create the program name object */
 
@@ -1111,8 +1088,8 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create programName onode\n", rn);
        afsmon_Exit(255);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_progName_o);
-    code = gator_light_set(ovw_progName_o, HIGHLIGHT);
+    gtxframe_AddToList(ovwFrame, ovw_progName_o);
+    gator_light_set(ovw_progName_o, HIGHLIGHT);
 
     /* create the page number object */
 
@@ -1123,8 +1100,8 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
        afsmon_Exit(260);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_pageNum_o);
-    code = gator_light_set(ovw_pageNum_o, HIGHLIGHT);
+    gtxframe_AddToList(ovwFrame, ovw_pageNum_o);
+    gator_light_set(ovw_pageNum_o, HIGHLIGHT);
 
     /* create the probe number object */
     ovw_probeNum_o =
@@ -1134,8 +1111,8 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create probe number onode\n", rn);
        afsmon_Exit(270);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_probeNum_o);
-    code = gator_light_set(ovw_probeNum_o, HIGHLIGHT);
+    gtxframe_AddToList(ovwFrame, ovw_probeNum_o);
+    gator_light_set(ovw_probeNum_o, HIGHLIGHT);
 
     /* create the numFS monitored object */
     ovw_numFS_o = initLightObject("", 0, 2, FC_NUMHOSTS_O_WIDTH, afsmon_win);
@@ -1143,7 +1120,7 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create numFS onode\n", rn);
        afsmon_Exit(275);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_numFS_o);
+    gtxframe_AddToList(ovwFrame, ovw_numFS_o);
 
     /* create the numCM monitored object */
     ovw_numCM_o =
@@ -1152,7 +1129,7 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create numCM_o onode\n", rn);
        afsmon_Exit(280);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_numCM_o);
+    gtxframe_AddToList(ovwFrame, ovw_numCM_o);
 
     /* create the number-of-FS-alerts object */
     ovw_FSalerts_o =
@@ -1161,7 +1138,7 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create FSalerts_o onode\n", rn);
        afsmon_Exit(285);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_FSalerts_o);
+    gtxframe_AddToList(ovwFrame, ovw_FSalerts_o);
 
     /* create the number-of-CM-alerts object */
     ovw_CMalerts_o =
@@ -1170,15 +1147,13 @@ create_ovwFrame_objects()
        sprintf(errMsg, "[ %s ] Failed to create CMalerts_o onode\n", rn);
        afsmon_Exit(290);
     }
-    code = gtxframe_AddToList(ovwFrame, ovw_CMalerts_o);
+    gtxframe_AddToList(ovwFrame, ovw_CMalerts_o);
 
     /* create file-server-name and cache-manager-names objects */
     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);
@@ -1202,16 +1177,14 @@ create_ovwFrame_objects()
         * fflush(debugFD);
         * }
         */
-       code = gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr);
+       gtxframe_AddToList(ovwFrame, *ovw_fsNames_o_Ptr);
        ovw_fsNames_o_Ptr++;
 
     }
 
 
     /* 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);
@@ -1228,7 +1201,7 @@ create_ovwFrame_objects()
            sprintf(errMsg, "[ %s ] Failed to create a CM name onode\n", rn);
            afsmon_Exit(310);
        }
-       code = gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr);
+       gtxframe_AddToList(ovwFrame, *ovw_cmNames_o_Ptr);
        ovw_cmNames_o_Ptr++;
     }
 
@@ -1299,23 +1272,21 @@ create_ovwFrame_objects()
  *----------------------------------------------------------------------*/
 
 int
-resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
-               a_curr_LCol, a_cols_perPage, a_Data_Available)
-     char *a_buffer;           /* buffer to copy command line */
-     int a_currFrame;          /* current frame ovw, fs or cm? */
-     int a_currPage;           /* current page number */
-     int a_numPages;           /* number of pages of data */
-     int a_numCols;            /* number of columns of data to display */
-     int a_curr_LCol;          /* current number of leftmost column */
-     int a_cols_perPage;       /* number of columns per page */
-
+resolve_CmdLine(char *a_buffer,            /* buffer to copy command line */
+               int a_currFrame,    /* current frame ovw, fs or cm? */
+               int a_currPage,     /* current page number */
+               int a_numPages,     /* number of pages of data */
+               int a_numCols,      /* number of columns of data to display */
+               int a_curr_LCol,    /* current number of leftmost column */
+               int a_cols_perPage, /* number of columns per page */
+               int a_Data_Available)
 {                              /* resolve_CmdLine */
     static char rn[] = "resolve_CmdLine";
     int pageType;
 
     if (afsmon_debug) {
        fprintf(debugFD,
-               "[ %s ] Called, a_buffer= %d, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n",
+               "[ %s ] Called, a_buffer= %p, a_currFrame= %d, a_currPage= %d, a_numPages= %d, a_numCols= %d, a_curr_LCol= %d, a_cols_perPage= %d\n",
                rn, a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
                a_curr_LCol, a_cols_perPage);
        fflush(debugFD);
@@ -1381,9 +1352,9 @@ resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
  *     The data in the file server & cache manager frames are displayed
  *     in two objects, one below the other. If the data is too long to
  *     fit in the first object it will overflow into the next. This is
- *     to conserve real estate on the screen. This function copies the 
+ *     to conserve real estate on the screen. This function copies the
  *     contents of the source buffer adjusted to the two objects if the
- *     probe had succeded. Otherwise it enters "--" in the first object 
+ *     probe had succeded. Otherwise it enters "--" in the first object
  *     blanks out the second. If the object needs to be highlightned
  *     (due to a threshold crossing) it is done.
  *
@@ -1391,16 +1362,12 @@ resolve_CmdLine(a_buffer, a_currFrame, a_currPage, a_numPages, a_numCols,
  *     0 always
  *----------------------------------------------------------------------*/
 int
-display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just,
-                    a_highlight)
-
-     char *a_srcBuf;           /* source buffer */
-     struct onode *a_firstObj_o;       /* first object */
-     struct onode *a_secondObj_o;      /* second object */
-     int a_probeOK;            /* probe OK ? */
-     int a_just;               /* justification */
-     int a_highlight;          /* highlight object  ? */
-
+display_Server_datum(char *a_srcBuf,             /* source buffer */
+                    struct onode *a_firstObj_o,  /* first object */
+                    struct onode *a_secondObj_o, /* second object */
+                    int a_probeOK,               /* probe OK ? */
+                    int a_just,                  /* justification */
+                    int a_highlight)             /* highlight object  ? */
 {                              /* display_Server_datum */
 
     static char rn[] = "display_Server_datum";
@@ -1413,7 +1380,7 @@ display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just,
     if (afsmon_debug) {
        if (a_highlight)
            fprintf(debugFD,
-                   "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %d, a_secondObj_o= %d, a_probeOK= %d, a_just= %d, a_highlight= %d\n",
+                   "[ %s ] Called, a_srcBuf= %s, a_firstObj_o= %p, a_secondObj_o= %p, a_probeOK= %d, a_just= %d, a_highlight= %d\n",
                    rn, a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK,
                    a_just, a_highlight);
        fflush(debugFD);
@@ -1501,14 +1468,11 @@ display_Server_datum(a_srcBuf, a_firstObj_o, a_secondObj_o, a_probeOK, a_just,
  *----------------------------------------------------------------------*/
 
 int
-display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
-     char *a_srcBuf;
-     struct onode *a_firstObj_o;       /* first object */
-     struct onode *a_secondObj_o;      /* second object */
-     struct onode *a_thirdObj_o;       /* third object */
-
+display_Server_label(char *a_srcBuf,
+                    struct onode *a_firstObj_o,        /* first object */
+                    struct onode *a_secondObj_o,       /* second object */
+                    struct onode *a_thirdObj_o)        /* third object */
 {                              /* display_Server_label */
-
     static char rn[] = "display_Server_label";
     char part[3][20];          /* buffer for three parts of label */
     char *strPtr;
@@ -1555,7 +1519,7 @@ display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
        part[i][j] = '\0';
     }
 
-    /* 
+    /*
      * if (afsmon_debug) {
      * fprintf(debugFD,"[ %s ] LABELS %s -> %s %s %s\n",
      * rn, a_srcBuf, part[0], part[1], part[2]);
@@ -1581,7 +1545,7 @@ display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
            }
        }
     }
-
+    return 0;
 }                              /* display_Server_label */
 
 
@@ -1593,12 +1557,12 @@ display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
  *
  * Description:
  *     Refresh the File Servers screen with the given page number starting
- *     at the given left-column number. The appropriate contents of 
- *     prev_fsData are displayed. 
+ *     at the given left-column number. The appropriate contents of
+ *     prev_fsData are displayed.
  *     First the status labels at the four corners of the screen are
  *     updated. Next the column labels are updated and then each row
  *     of statistics.
- *     
+ *
  * Returns:
  *     Success: 0
  *     Failure: Exits afsmoitor on a severe error.
@@ -1606,10 +1570,8 @@ display_Server_label(a_srcBuf, a_firstObj_o, a_secondObj_o, a_thirdObj_o)
 
 
 int
-fs_refresh(a_pageNum, a_LcolNum)
-     int a_pageNum;            /* page to display */
-     int a_LcolNum;            /* starting (leftmost) column number */
-
+fs_refresh(int a_pageNum,      /* page to display */
+          int a_LcolNum)       /* starting (leftmost) column number */
 {                              /* fs_refresh */
 
     static char rn[] = "fs_refresh";   /* routine name */
@@ -1629,7 +1591,7 @@ fs_refresh(a_pageNum, a_LcolNum)
     int code;
     int fsIdx;
     int labelIdx;
-    int dataIndex;             /* index to the data[] field of 
+    int dataIndex;             /* index to the data[] field of
                                 * struct fs_Display_Data */
 
     if (afsmon_debug) {
@@ -1639,7 +1601,7 @@ fs_refresh(a_pageNum, a_LcolNum)
     }
 
 
-    /* if the data is not yet available, ie., not one probe cycle has 
+    /* if the data is not yet available, ie., not one probe cycle has
      * completed, do nothing */
 
     if (!fs_Data_Available)
@@ -1690,12 +1652,12 @@ fs_refresh(a_pageNum, a_LcolNum)
     /* command line */
 
     /* figure out what we need to show in the prompt & set the page type */
-    /* the fs_pageType variable is in turn used by the keyboard handler 
+    /* the fs_pageType variable is in turn used by the keyboard handler
      * routines to call fs_refresh() with the correct parameters */
 
     fs_pageType = resolve_CmdLine(cmdLine, 1 /* fs frame */ , a_pageNum,
                                  fs_numPages, fs_numCols, a_LcolNum,
-                                 fs_cols_perPage);
+                                 fs_cols_perPage, 0);
 
     /* display the command line */
     tmp_lightobj = (struct gator_lightobj *)fs_cmd_o->o_data;
@@ -1798,7 +1760,7 @@ fs_refresh(a_pageNum, a_LcolNum)
 
            /* display the hostname , first names only please! */
 
-           sprintf(printBuf, fsDataP->hostName);
+           sprintf(printBuf, "%s", fsDataP->hostName);
            for (j = 0; j < strlen(printBuf); j++) {
                if (printBuf[j] == '.') {
                    printBuf[j] = '\0';
@@ -1822,7 +1784,7 @@ fs_refresh(a_pageNum, a_LcolNum)
             * overflow flag is set and highlight if so. if the probe had failed
             * enter "--" is all columns */
 
-           /* each host has two rows of slots for datums. get the pointers to 
+           /* each host has two rows of slots for datums. get the pointers to
             * both the arrays */
 
            firstSlot_o_Ptr = tmp_fs_lines_P->data_o[0];
@@ -1925,7 +1887,7 @@ fs_refresh(a_pageNum, a_LcolNum)
  *     Switch from the File Server screen to the Overview Screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_2_ovw()
+Switch_fs_2_ovw(void *d1, void *d2)
 {
     /* bind the overview frame to the window */
     gtxframe_SetFrame(afsmon_win, ovwFrame);
@@ -1936,10 +1898,10 @@ Switch_fs_2_ovw()
  * Switch_fs_2_cm()
  *
  * Description:
- *     Switch from the File Server screen to the Cache Managers screen. 
+ *     Switch from the File Server screen to the Cache Managers screen.
  *----------------------------------------------------------------------*/
 int
-Switch_fs_2_cm()
+Switch_fs_2_cm(void *d1, void *d2)
 {
     if (fs_pageType & CMD_CM) {
        /* bind the overview Cache Managers to the window */
@@ -1952,13 +1914,11 @@ Switch_fs_2_cm()
  * Switch_fs_next()
  *
  * Description:
- *     Switch to next page of file server screen 
+ *     Switch to next page of file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_next()
+Switch_fs_next(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_next";
-
     if (fs_pageType & CMD_NEXT) {
        /* we have a next page, refresh with next page number */
        fs_refresh(fs_currPage + 1, fs_curr_LCol);
@@ -1971,14 +1931,11 @@ Switch_fs_next()
  * Switch_fs_last()
  *
  * Description:
- *     Switch to last page of file server screen 
+ *     Switch to last page of file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_last()
+Switch_fs_last(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_last";
-
-
     if (fs_pageType & CMD_NEXT) {
        /* we have a next page, refresh with the last page number */
        fs_refresh(fs_numPages, fs_curr_LCol);
@@ -1991,13 +1948,11 @@ Switch_fs_last()
  * Switch_fs_prev()
  *
  * Description:
- *     Switch to previous page of file server screen 
+ *     Switch to previous page of file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_prev()
+Switch_fs_prev(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_prev";
-
     if (fs_pageType & CMD_PREV) {
        /* we have a previous page, refresh with the rpevious page number */
        fs_refresh(fs_currPage - 1, fs_curr_LCol);
@@ -2009,13 +1964,11 @@ Switch_fs_prev()
  * Switch_fs_first()
  *
  * Description:
- *     Switch to first page of file server screen 
+ *     Switch to first page of file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_first()
+Switch_fs_first(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_first";
-
     if (fs_pageType & CMD_PREV) {
        /* we have a previous page, got to first page */
        fs_refresh(1, fs_curr_LCol);
@@ -2027,13 +1980,11 @@ Switch_fs_first()
  * Switch_fs_left()
  *
  * Description:
- *     Scroll left on the file server screen 
+ *     Scroll left on the file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_left()
+Switch_fs_left(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_left";
-
     if (fs_pageType & CMD_LEFT) {
        /* we have columns on left, refresh with new column number */
        fs_refresh(fs_currPage, fs_curr_LCol - fs_cols_perPage);
@@ -2046,13 +1997,11 @@ Switch_fs_left()
  * Switch_fs_leftmost()
  *
  * Description:
- *     Scroll to first column on  the file server screen 
+ *     Scroll to first column on  the file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_leftmost()
+Switch_fs_leftmost(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_leftmost";
-
     if (fs_pageType & CMD_LEFT) {
        /* we have columns on left, go to the first */
        fs_refresh(fs_currPage, 0);
@@ -2064,13 +2013,11 @@ Switch_fs_leftmost()
  * Switch_fs_right()
  *
  * Description:
- *     Scroll right on the file server screen 
+ *     Scroll right on the file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_right()
+Switch_fs_right(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_right";
-
     if (fs_pageType & CMD_RIGHT) {
        /* we have columns on right, refresh with new column number */
        fs_refresh(fs_currPage, fs_curr_LCol + fs_cols_perPage);
@@ -2082,15 +2029,13 @@ Switch_fs_right()
  * Switch_fs_rightmost()
  *
  * Description:
- *     Scroll to last column on the file server screen 
+ *     Scroll to last column on the file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_fs_rightmost()
+Switch_fs_rightmost(void *d1, void *d2)
 {
-    static char rn[] = "Switch_fs_rightmost";
     int curr_LCol;
 
-
     if (fs_pageType & CMD_RIGHT) {
        /* we have columns on right, go to the last column */
        if (fs_numCols % fs_cols_perPage)
@@ -2122,7 +2067,7 @@ Switch_fs_rightmost()
  *----------------------------------------------------------------------*/
 
 int
-create_FSframe_objects()
+create_FSframe_objects(void)
 {                              /* create_FSframe_objects */
     static char rn[] = "create_FSframe_objects";
     struct ServerInfo_line *fs_lines_Ptr;
@@ -2130,7 +2075,6 @@ create_FSframe_objects()
     struct onode **fsLabels_o_Ptr;
     int x_pos;
     int y_pos;
-    int code;
     int i;
     int j;
     int numBytes;
@@ -2150,13 +2094,13 @@ create_FSframe_objects()
        sprintf(errMsg, "[ %s ] Failed to create fs command onode\n", rn);
        afsmon_Exit(340);
     }
-    code = gtxframe_AddToList(fsFrame, fs_cmd_o);
-    code = gator_light_set(fs_cmd_o, HIGHLIGHT);
+    gtxframe_AddToList(fsFrame, fs_cmd_o);
+    gator_light_set(fs_cmd_o, HIGHLIGHT);
 
     /* we already have the dimensions for the frame - same as the ovw frame */
     /* use the ovw program name object for the fs screen too */
 
-    code = gtxframe_AddToList(fsFrame, ovw_progName_o);
+    gtxframe_AddToList(fsFrame, ovw_progName_o);
 
 
     /* create the page number object */
@@ -2168,8 +2112,8 @@ create_FSframe_objects()
        sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
        afsmon_Exit(335);
     }
-    code = gtxframe_AddToList(fsFrame, fs_pageNum_o);
-    code = gator_light_set(fs_pageNum_o, HIGHLIGHT);
+    gtxframe_AddToList(fsFrame, fs_pageNum_o);
+    gator_light_set(fs_pageNum_o, HIGHLIGHT);
 
     /* create the probe number object */
     fs_probeNum_o =
@@ -2180,8 +2124,8 @@ create_FSframe_objects()
        sprintf(errMsg, "[ %s ] Failed to create fs probeNum onode\n", rn);
        afsmon_Exit(345);
     }
-    code = gtxframe_AddToList(fsFrame, fs_probeNum_o);
-    code = gator_light_set(fs_probeNum_o, HIGHLIGHT);
+    gtxframe_AddToList(fsFrame, fs_probeNum_o);
+    gator_light_set(fs_probeNum_o, HIGHLIGHT);
 
 
     /* create the numFS monitored object */
@@ -2194,7 +2138,7 @@ create_FSframe_objects()
                "[ %s ] Failed to create numFS onode for the fs frame\n", rn);
        afsmon_Exit(350);
     }
-    code = gtxframe_AddToList(fsFrame, fs_numFS_o);
+    gtxframe_AddToList(fsFrame, fs_numFS_o);
 
     /* create the "more columns to left" indicator */
     fs_leftArrows_o =
@@ -2205,7 +2149,7 @@ create_FSframe_objects()
                rn);
        afsmon_Exit(355);
     }
-    code = gtxframe_AddToList(fsFrame, fs_leftArrows_o);
+    gtxframe_AddToList(fsFrame, fs_leftArrows_o);
 
     /* create the "more columns to right" indicator */
     fs_rightArrows_o =
@@ -2217,7 +2161,7 @@ create_FSframe_objects()
                rn);
        afsmon_Exit(360);
     }
-    code = gtxframe_AddToList(fsFrame, fs_rightArrows_o);
+    gtxframe_AddToList(fsFrame, fs_rightArrows_o);
 
 
 
@@ -2241,7 +2185,7 @@ create_FSframe_objects()
      * 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,
@@ -2249,14 +2193,14 @@ create_FSframe_objects()
        afsmon_Exit(365);
     }
 
-    /* for each line of server statistics allocate memory to store two arrays 
+    /* for each line of server statistics allocate memory to store two arrays
      * of data onodes */
 
     fs_lines_Ptr = fs_lines;
     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",
@@ -2280,7 +2224,7 @@ create_FSframe_objects()
            sprintf(errMsg, "[ %s ] Failed to create an FS name onode\n", rn);
            afsmon_Exit(375);
        }
-       code = gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o);
+       gtxframe_AddToList(fsFrame, fs_lines_Ptr->host_o);
 
        /* if (afsmon_debug) {
         * fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n",
@@ -2311,7 +2255,7 @@ create_FSframe_objects()
                            "[ %s ] Failed to create an FS data onode\n", rn);
                    afsmon_Exit(380);
                }
-               code = gtxframe_AddToList(fsFrame, *fs_data_o_Ptr);
+               gtxframe_AddToList(fsFrame, *fs_data_o_Ptr);
 
                fs_data_o_Ptr++;
            }                   /* for each column */
@@ -2328,8 +2272,7 @@ create_FSframe_objects()
      * 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",
@@ -2350,7 +2293,7 @@ create_FSframe_objects()
                        rn);
                afsmon_Exit(390);
            }
-           code = gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr);
+           gtxframe_AddToList(fsFrame, *fsLabels_o_Ptr);
            fsLabels_o_Ptr++;
        }
 
@@ -2372,7 +2315,7 @@ create_FSframe_objects()
     keymap_BindToString(fsFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL);
     keymap_BindToString(fsFrame->keymap, "\ 3", afsmonExit_gtx, NULL, NULL);
 
-    /* o = overview, c = cm, n = next, p = prev, l = left, r = right 
+    /* o = overview, c = cm, n = next, p = prev, l = left, r = right
      * N = last page, P = first page, L = leftmost col, R = rightmost col */
 
     keymap_BindToString(fsFrame->keymap, "o", Switch_fs_2_ovw, NULL, NULL);
@@ -2396,22 +2339,20 @@ create_FSframe_objects()
  *
  * Description:
  *     Refresh the Cache Managers screen with the given page number starting
- *     at the given left-column number. The appropriate contents of 
- *     prev_cmData are displayed. 
+ *     at the given left-column number. The appropriate contents of
+ *     prev_cmData are displayed.
  *     First the status labels at the four corners of the screen are
  *     updated. Next the column labels are updated and then each row
  *     of statistics.
- *     
+ *
  * Returns:
  *     Success: 0
  *     Failure: Exits afsmoitor on a severe error.
  *----------------------------------------------------------------------*/
 
 int
-cm_refresh(a_pageNum, a_LcolNum)
-     int a_pageNum;            /* page to display */
-     int a_LcolNum;            /* starting (leftmost) column number */
-
+cm_refresh(int a_pageNum,              /* page to display */
+          int a_LcolNum)               /* starting (leftmost) column number */
 {                              /* cm_refresh */
 
     static char rn[] = "cm_refresh";   /* routine name */
@@ -2431,7 +2372,7 @@ cm_refresh(a_pageNum, a_LcolNum)
     int code;
     int cmIdx;
     int labelIdx;
-    int dataIndex;             /* index to the data[] field of 
+    int dataIndex;             /* index to the data[] field of
                                 * struct cm_Display_Data */
 
     if (afsmon_debug) {
@@ -2441,7 +2382,7 @@ cm_refresh(a_pageNum, a_LcolNum)
     }
 
 
-    /* if the data is not yet available, ie., not one probe cycle has 
+    /* if the data is not yet available, ie., not one probe cycle has
      * completed, do nothing */
 
     if (!cm_Data_Available)
@@ -2492,12 +2433,12 @@ cm_refresh(a_pageNum, a_LcolNum)
     /* command line */
 
     /* figure out what we need to show in the prompt & set the page type */
-    /* the cm_pageType variable is in turn used by the keyboard handler 
+    /* the cm_pageType variable is in turn used by the keyboard handler
      * routines to call cm_refresh() with the correct parameters */
 
     cm_pageType = resolve_CmdLine(cmdLine, 2 /* cm frame */ , a_pageNum,
                                  cm_numPages, cm_numCols, a_LcolNum,
-                                 cm_cols_perPage);
+                                 cm_cols_perPage, 0);
 
     /* display the command line */
     tmp_lightobj = (struct gator_lightobj *)cm_cmd_o->o_data;
@@ -2600,7 +2541,7 @@ cm_refresh(a_pageNum, a_LcolNum)
 
            /* display the hostname , first names only please! */
 
-           sprintf(printBuf, cmDataP->hostName);
+           sprintf(printBuf, "%s", cmDataP->hostName);
            for (j = 0; j < strlen(printBuf); j++) {
                if (printBuf[j] == '.') {
                    printBuf[j] = '\0';
@@ -2624,7 +2565,7 @@ cm_refresh(a_pageNum, a_LcolNum)
             * overflow flag is set and highlight if so. if the probe had failed
             * enter "--" is all columns */
 
-           /* each host has two rows of slots for datums. get the pointers to 
+           /* each host has two rows of slots for datums. get the pointers to
             * both the arrays */
 
            firstSlot_o_Ptr = tmp_cm_lines_P->data_o[0];
@@ -2726,7 +2667,7 @@ cm_refresh(a_pageNum, a_LcolNum)
  *     Switch from the Cache Manager screen to the Overview Screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_2_ovw()
+Switch_cm_2_ovw(void *d1, void *d2)
 {
     /* bind the overview frame to the window */
     gtxframe_SetFrame(afsmon_win, ovwFrame);
@@ -2737,10 +2678,10 @@ Switch_cm_2_ovw()
  * Switch_cm_2_fs()
  *
  * Description:
- *     Switch from the Cache Manager screen to the File Servers screen 
+ *     Switch from the Cache Manager screen to the File Servers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_2_fs()
+Switch_cm_2_fs(void *d1, void *d2)
 {
     if (cm_pageType & CMD_FS) {
        /* bind the file servers frame to the window */
@@ -2753,13 +2694,11 @@ Switch_cm_2_fs()
  * Switch_cm_next()
  *
  * Description:
- *     Switch to next page of cache managers screen 
+ *     Switch to next page of cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_next()
+Switch_cm_next(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_next";
-
     if (cm_pageType & CMD_NEXT) {
        /* we have a next page, refresh with next page number */
        cm_refresh(cm_currPage + 1, cm_curr_LCol);
@@ -2772,14 +2711,11 @@ Switch_cm_next()
  * Switch_cm_last()
  *
  * Description:
- *     Switch to last page of file server screen 
+ *     Switch to last page of file server screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_last()
+Switch_cm_last(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_last";
-
-
     if (cm_pageType & CMD_NEXT) {
        /* we have a next page, refresh with last page number */
        cm_refresh(cm_numPages, cm_curr_LCol);
@@ -2792,13 +2728,11 @@ Switch_cm_last()
  * Switch_cm_prev()
  *
  * Description:
- *     Switch to previous page of cache managers screen 
+ *     Switch to previous page of cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_prev()
+Switch_cm_prev(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_prev";
-
     if (cm_pageType & CMD_PREV) {
        /* we have a previous page, refresh to previous page */
        cm_refresh(cm_currPage - 1, cm_curr_LCol);
@@ -2810,13 +2744,11 @@ Switch_cm_prev()
  * Switch_cm_first()
  *
  * Description:
- *     Switch to first page of cache managers screen 
+ *     Switch to first page of cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_first()
+Switch_cm_first(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_first";
-
     if (cm_pageType & CMD_PREV) {
        /* we have a previous page, refresh to first page */
        cm_refresh(1, cm_curr_LCol);
@@ -2828,13 +2760,11 @@ Switch_cm_first()
  * Switch_cm_left()
  *
  * Description:
- *     Scroll left on the cache managers screen 
+ *     Scroll left on the cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_left()
+Switch_cm_left(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_left";
-
     if (cm_pageType & CMD_LEFT) {
        /* we have columns on left, refresh with new column number */
        cm_refresh(cm_currPage, cm_curr_LCol - cm_cols_perPage);
@@ -2847,13 +2777,11 @@ Switch_cm_left()
  * Switch_cm_leftmost()
  *
  * Description:
- *     Scroll to first column on  the cache managers screen 
+ *     Scroll to first column on  the cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_leftmost()
+Switch_cm_leftmost(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_leftmost";
-
     if (cm_pageType & CMD_LEFT) {
        /* we have columns on left, go to the first column */
        cm_refresh(cm_currPage, 0);
@@ -2865,13 +2793,11 @@ Switch_cm_leftmost()
  * Switch_cm_right()
  *
  * Description:
- *     Scroll right on the cache managers screen 
+ *     Scroll right on the cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_right()
+Switch_cm_right(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_right";
-
     if (cm_pageType & CMD_RIGHT) {
        /* we have columns on right, refresh with new column number */
        cm_refresh(cm_currPage, cm_curr_LCol + cm_cols_perPage);
@@ -2883,15 +2809,13 @@ Switch_cm_right()
  * Switch_cm_rightmost()
  *
  * Description:
- *     Scroll to last column on the cache managers screen 
+ *     Scroll to last column on the cache managers screen
  *----------------------------------------------------------------------*/
 int
-Switch_cm_rightmost()
+Switch_cm_rightmost(void *d1, void *d2)
 {
-    static char rn[] = "Switch_cm_rightmost";
     int curr_LCol;
 
-
     if (cm_pageType & CMD_RIGHT) {
        /* we have columns on right, go to the last column */
        if (cm_numCols % cm_cols_perPage)
@@ -2922,7 +2846,7 @@ Switch_cm_rightmost()
  *----------------------------------------------------------------------*/
 
 int
-create_CMframe_objects()
+create_CMframe_objects(void)
 {                              /* create_CMframe_objects */
     static char rn[] = "create_CMframe_objects";
     struct ServerInfo_line *cm_lines_Ptr;
@@ -2930,7 +2854,6 @@ create_CMframe_objects()
     struct onode **cmLabels_o_Ptr;
     int x_pos;
     int y_pos;
-    int code;
     int i;
     int j;
     int numBytes;
@@ -2951,14 +2874,14 @@ create_CMframe_objects()
        sprintf(errMsg, "[ %s ] Failed to create cm command onode\n", rn);
        afsmon_Exit(420);
     }
-    code = gtxframe_AddToList(cmFrame, cm_cmd_o);
-    code = gator_light_set(cm_cmd_o, HIGHLIGHT);
+    gtxframe_AddToList(cmFrame, cm_cmd_o);
+    gator_light_set(cm_cmd_o, HIGHLIGHT);
 
 
     /* we already have the dimensions for the frame - same as the ovw frame */
     /* use the ovw program name object for the cm screen too */
 
-    code = gtxframe_AddToList(cmFrame, ovw_progName_o);
+    gtxframe_AddToList(cmFrame, ovw_progName_o);
 
 
     /* create the page number object */
@@ -2970,8 +2893,8 @@ create_CMframe_objects()
        sprintf(errMsg, "[ %s ] Failed to create pageNumber onode\n", rn);
        afsmon_Exit(415);
     }
-    code = gtxframe_AddToList(cmFrame, cm_pageNum_o);
-    code = gator_light_set(cm_pageNum_o, HIGHLIGHT);
+    gtxframe_AddToList(cmFrame, cm_pageNum_o);
+    gator_light_set(cm_pageNum_o, HIGHLIGHT);
 
     /* create the probe number object */
     cm_probeNum_o =
@@ -2982,8 +2905,8 @@ create_CMframe_objects()
        sprintf(errMsg, "[ %s ] Failed to create cm probeNum onode\n", rn);
        afsmon_Exit(425);
     }
-    code = gtxframe_AddToList(cmFrame, cm_probeNum_o);
-    code = gator_light_set(cm_probeNum_o, HIGHLIGHT);
+    gtxframe_AddToList(cmFrame, cm_probeNum_o);
+    gator_light_set(cm_probeNum_o, HIGHLIGHT);
 
 
     /* create the numCM monitored object */
@@ -2996,7 +2919,7 @@ create_CMframe_objects()
                "[ %s ] Failed to create numCM onode for the cm frame\n", rn);
        afsmon_Exit(430);
     }
-    code = gtxframe_AddToList(cmFrame, cm_numCM_o);
+    gtxframe_AddToList(cmFrame, cm_numCM_o);
 
     /* create the "more columns to left" indicator */
     cm_leftArrows_o =
@@ -3007,7 +2930,7 @@ create_CMframe_objects()
                rn);
        afsmon_Exit(435);
     }
-    code = gtxframe_AddToList(cmFrame, cm_leftArrows_o);
+    gtxframe_AddToList(cmFrame, cm_leftArrows_o);
 
     /* create the "more columns to right" indicator */
     cm_rightArrows_o =
@@ -3019,7 +2942,7 @@ create_CMframe_objects()
                rn);
        afsmon_Exit(440);
     }
-    code = gtxframe_AddToList(cmFrame, cm_rightArrows_o);
+    gtxframe_AddToList(cmFrame, cm_rightArrows_o);
 
 
 
@@ -3043,7 +2966,7 @@ create_CMframe_objects()
      * 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,
@@ -3051,14 +2974,14 @@ create_CMframe_objects()
        afsmon_Exit(445);
     }
 
-    /* for each line of server statistics allocate memory to store two arrays 
+    /* for each line of server statistics allocate memory to store two arrays
      * of data onodes */
 
     cm_lines_Ptr = cm_lines;
     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",
@@ -3082,7 +3005,7 @@ create_CMframe_objects()
            sprintf(errMsg, "[ %s ] Failed to create an CM name onode\n", rn);
            afsmon_Exit(455);
        }
-       code = gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o);
+       gtxframe_AddToList(cmFrame, cm_lines_Ptr->host_o);
 
        /* if (afsmon_debug) {
         * fprintf(debugFD,"[ %s ] Addr of host_o = %d for line %d\n",
@@ -3113,7 +3036,7 @@ create_CMframe_objects()
                            "[ %s ] Failed to create an CM data onode\n", rn);
                    afsmon_Exit(460);
                }
-               code = gtxframe_AddToList(cmFrame, *cm_data_o_Ptr);
+               gtxframe_AddToList(cmFrame, *cm_data_o_Ptr);
 
                cm_data_o_Ptr++;
            }                   /* for each column */
@@ -3130,8 +3053,7 @@ create_CMframe_objects()
      * 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",
@@ -3152,17 +3074,12 @@ create_CMframe_objects()
                        rn);
                afsmon_Exit(470);
            }
-           code = gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr);
+           gtxframe_AddToList(cmFrame, *cmLabels_o_Ptr);
            cmLabels_o_Ptr++;
        }
 
     }
 
-
-
-
-
-
     /* initialize the column & page counters */
 
     cm_currPage = 1;
@@ -3178,7 +3095,7 @@ create_CMframe_objects()
     keymap_BindToString(cmFrame->keymap, "Q", afsmonExit_gtx, NULL, NULL);
     keymap_BindToString(cmFrame->keymap, "\ 3", afsmonExit_gtx, NULL, NULL);
 
-    /* o = overview, c = cm, n = next, p = prev, l = left, r = right 
+    /* o = overview, c = cm, n = next, p = prev, l = left, r = right
      * N = last page, P = first page, L = leftmost col, R = rightmost col */
 
     keymap_BindToString(cmFrame->keymap, "o", Switch_cm_2_ovw, NULL, NULL);
@@ -3206,7 +3123,7 @@ create_CMframe_objects()
  *     for the overview, File Servers & Cache Managers screens.
  *----------------------------------------------------------------------*/
 int
-gtx_initialize()
+gtx_initialize(void)
 {                              /* gtx_initialize */
     static char rn[] = "gtx_initialize";       /* routine name */
     int code;