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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/refer/glue4.c
          +++ new/usr/src/cmd/refer/glue4.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   16  
  17      -
  18   17  #include <stdio.h>
  19   18  #include <ctype.h>
  20   19  
  21   20  extern char gfile[];
  22   21  
  23   22  void
  24   23  grepcall(char *in, char *out, char *arg)
  25   24  {
  26   25          char line[200], *s, argig[100], *cv[50];
  27   26          char *inp, inb[500];
  28   27          FILE *qf, *gf;
  29      -        int c, oldc = 0, alph = 0, nv = 0;
       28 +        int c, alph = 0, nv = 0;
  30   29          int sv0, sv1;
  31   30          strcpy(argig, arg);
  32   31          strcat(argig, ".ig");
  33   32          strcpy(inp = inb, in);
  34   33          if (gfile[0] == 0)
  35   34                  sprintf(gfile, "/tmp/rj%dg", getpid());
  36   35  #if D1
  37   36          fprintf(stderr, "in grepcall, gfile %s in %o out %o\n",
  38   37              gfile, in, out);
  39   38  #endif
  40   39          for (cv[nv++] = "fgrep"; c = *inp; inp++) {
  41   40                  if (c == ' ')
  42   41                          c = *inp = 0;
  43   42                  else if (isupper(c))
  44   43                          *inp = tolower(c);
  45   44                  alph = (c == 0) ? 0 : alph+1;
  46   45                  if (alph == 1)
  47   46                          cv[nv++] = inp;
  48   47                  if (alph > 6)
  49   48                          *inp = 0;
  50      -                oldc = c;
  51   49          }
  52   50  #if D1
  53   51          fprintf(stderr, "%d args set up\n", nv);
  54   52  #endif
  55   53          {
  56   54                  sv0 = dup(0);
  57   55                  close(0);
  58   56                  if (open(argig, 0) != 0)
  59   57                          err("Can't read fgrep index %s", argig);
  60   58                  sv1 = dup(1);
↓ open down ↓ 59 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX