]> granicus.if.org Git - procps-ng/commitdiff
top: eliminate a couple of warnings of -Wunused-result
authorJim Warner <james.warner@comcast.net>
Sat, 2 Jun 2018 05:00:00 +0000 (00:00 -0500)
committerCraig Small <csmall@enc.com.au>
Sat, 9 Jun 2018 11:35:20 +0000 (21:35 +1000)
Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c

index 09496d0e7751af91d1bd6cc679fdd4c189b26427..7e44e5433cbaddcbf5239fc0b12f78e02595bcfa 100644 (file)
--- a/top/top.c
+++ b/top/top.c
@@ -3238,8 +3238,7 @@ static const char *config_file (FILE *fp, const char *name, float *delay) {
    const char *p = NULL;
 
    p = fmtmk(N_fmt(RC_bad_files_fmt), name);
-   if (fgets(fbuf, sizeof(fbuf), fp))       // ignore eyecatcher
-      ;                                     // avoid -Wunused-result
+   (void)fgets(fbuf, sizeof(fbuf), fp);     // ignore eyecatcher
    if (6 != fscanf(fp
       , "Id:%c, Mode_altscr=%d, Mode_irixps=%d, Delay_time=%d.%d, Curwin=%d\n"
       , &Rc.id, &Rc.mode_altscr, &Rc.mode_irixps, &tmp_whole, &tmp_fract, &i)) {
@@ -3329,9 +3328,8 @@ static const char *config_file (FILE *fp, const char *name, float *delay) {
    } // end: for (GROUPSMAX)
 
    // any new addition(s) last, for older rcfiles compatibility...
-   if (fscanf(fp, "Fixed_widest=%d, Summ_mscale=%d, Task_mscale=%d, Zero_suppress=%d\n"
-      , &Rc.fixed_widest, &Rc.summ_mscale, &Rc.task_mscale, &Rc.zero_suppress))
-         ;                                  // avoid -Wunused-result
+   (void)fscanf(fp, "Fixed_widest=%d, Summ_mscale=%d, Task_mscale=%d, Zero_suppress=%d\n"
+      , &Rc.fixed_widest, &Rc.summ_mscale, &Rc.task_mscale, &Rc.zero_suppress);
    if (Rc.fixed_widest < -1 || Rc.fixed_widest > SCREENMAX)
       Rc.fixed_widest = 0;
    if (Rc.summ_mscale < 0   || Rc.summ_mscale > SK_Eb)