Print this page
8485 Remove set but unused variables in usr/src/cmd

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/refer/hunt7.c
          +++ new/usr/src/cmd/refer/hunt7.c
   1    1  /*
        2 + * Copyright 2017 Gary Mills
   2    3   * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
   3    4   * Use is subject to license terms.
   4    5   */
   5    6  
   6    7  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
   7    8  /*        All Rights Reserved   */
   8    9  
   9   10  /*
  10   11   * Copyright (c) 1980 Regents of the University of California.
  11   12   * All rights reserved. The Berkeley software License Agreement
  12   13   * specifies the terms and conditions for redistribution.
  13   14   */
  14   15  
  15      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  16      -
  17   16  #include <stdio.h>
  18   17  #include <locale.h>
  19   18  #include <assert.h>
  20   19  #define SAME 0
  21   20  #define FGCT 10
  22   21  #define FGSIZE 150
  23   22  
  24   23  int keepold = 1;        /* keep old things for fgrep search */
  25   24  char fgspace[FGSIZE];
  26   25  char *fgp = fgspace;
↓ open down ↓ 3 lines elided ↑ open up ↑
  30   29  extern char *mindex();
  31   30  
  32   31  long
  33   32  findline(char *in, char **out, int outlen, long indexdate)
  34   33  {
  35   34          static char name[100] = "";
  36   35          char *p, **ftp;
  37   36          extern long gdate();
  38   37          static FILE *fa = NULL;
  39   38          long lp, llen;
  40      -        int len, k, nofil;
       39 +        int k, nofil;
  41   40  
  42   41  #if D1
  43   42          fprintf(stderr, "findline: %s\n", in);
  44   43  #endif
  45   44          if (mindex(in, '!'))
  46   45                  return (0);
  47   46  
  48   47          nofil = in[0] == 0;
  49   48          for (p = in; *p && *p != ':' && *p != ';'; p++)
  50   49                  ;
↓ open down ↓ 58 lines elided ↑ open up ↑
 109  108                  else
 110  109                          fprintf(stderr, "old %s new %s same fa %o\n",
 111  110                              name, in, fa);
 112  111  #endif
 113  112          if (fa != NULL) {
 114  113                  fseek(fa, lp, 0);
 115  114                  *out = (char *)malloc(llen + 1);
 116  115                  if (*out == NULL) {
 117  116                          return (0);
 118  117                  }
 119      -                len = fread(*out, 1, llen, fa);
      118 +                (void) fread(*out, 1, llen, fa);
 120  119                  *(*out + llen) = 0;
 121  120  #ifdef D1
 122  121                  fprintf(stderr, "length as read is %d\n", len);
 123  122  #endif
 124  123          }
 125  124          return (llen);
 126  125  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX