]> granicus.if.org Git - procps-ng/commitdiff
top: relocate a prototype to prevent compiler warning
authorJim Warner <james.warner@comcast.net>
Sat, 11 Feb 2012 08:02:02 +0000 (02:02 -0600)
committerCraig Small <csmall@enc.com.au>
Mon, 27 Feb 2012 21:45:44 +0000 (08:45 +1100)
Until the 'locate/search' provisions were added,
top avoided the need for any function prototypes
through careful source file organization.  But
the addition of the find_string function required
a prototpe for task_show, lest a massive file
reorganization be undertaken.

This commit moves the actual protype out of top.h
and places it adjacent to the caller in order to
avoid a warning when top_nls.c is compiled.

References:
commit 270e8e7eeb66b47569940f537cdad4ab46cd36be
commit d6e6a9aa38092e55f976a398899635105dd89893

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h

index 2bdae65f36004641d61ca02e5c20e308f554b4e3..c448a6423f8feb5c0c0069a75b1f58d3adef49b9 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -2723,6 +2723,12 @@ static void file_writerc (void) {
 } // end: file_writerc
 
 
+
+   /* This is currently the one true prototype require by top.
+      It is placed here, instead of top.h, so as to avoid a compiler
+      warning when top_nls.c is compiled. */
+static void task_show (const WIN_t *q, const proc_t *p, char *ptr);
+
 static void find_string (int ch) {
  #define reDUX (found) ? N_txt(WORD_another_txt) : ""
    static char str[SCREENMAX];
index a275110924a84f70f20796d8bd9a95651ae66271..7461f32a34ab63742421f7d6bd3f1d7df319a75f 100644 (file)
--- a/top/top.h
+++ b/top/top.h
@@ -531,8 +531,8 @@ typedef struct WIN_t {
 
 /*######  Some Prototypes (ha!)  #########################################*/
 
-   /* These 'prototypes' are here mostly for documentation purposes --    */
-   /* for now, the only essential one is task_show needed by find_string */
+   /* These 'prototypes' are here exclusively for documentation purposes. */
+   /* ( see the find_string function for the one true required protoype ) */
 /*------  Sort callbacks  ------------------------------------------------*/
 /*        for each possible field, in the form of:                        */
 /*atic int           sort_P_XXX (const proc_t **P, const proc_t **Q);     */
@@ -618,7 +618,7 @@ typedef struct WIN_t {
 //atic void          do_key (int ch);
 //atic void          summary_hlp (CPU_t *cpu, const char *pfx);
 //atic void          summary_show (void);
-static void          task_show (const WIN_t *q, const proc_t *p, char *ptr);
+//atic void          task_show (const WIN_t *q, const proc_t *p, char *ptr);
 //atic int           window_show (WIN_t *q, int wmax);
 /*------  Entry point plus two  ------------------------------------------*/
 //atic void          frame_hlp (int wix, int max);