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

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/lp/lib/papi/ppd.c
          +++ new/usr/src/cmd/lp/lib/papi/ppd.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
       22 + * Copyright 2017 Gary Mills
  22   23   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  27      -
  28   27  /*
  29   28   * This file contains an extremely rudimentary implementation of PPD file
  30   29   * parsing support.  The parsing done here converts the contents of a PPD
  31   30   * file into a set of PAPI attributes that applications can use to build
  32   31   * print panels.
  33   32   */
  34   33  
  35   34  #include <stdio.h>
  36   35  #include <ctype.h>
  37   36  #include <string.h>
↓ open down ↓ 45 lines elided ↑ open up ↑
  83   82  
  84   83  papi_status_t
  85   84  PPDFileToAttributesList(papi_attribute_t ***attributes, char *filename)
  86   85  {
  87   86          papi_status_t status = PAPI_OK;
  88   87          FILE *fp;
  89   88          char line[256];
  90   89          char capability[256];
  91   90          char def[256];
  92   91          char supported[256];
  93      -        char *current_group_name = NULL;
  94   92  
  95   93          int ui = 0;
  96   94  
  97   95          if ((fp = fopen(filename, "r")) == NULL)
  98   96                  return (PAPI_NOT_POSSIBLE);
  99   97  
 100   98          while ((status == PAPI_OK) &&
 101   99                          (fgets(line, sizeof (line), fp) != NULL)) {
 102  100                  char *key = NULL, *value = NULL, *text = NULL;
 103  101  
↓ open down ↓ 9 lines elided ↑ open up ↑
 113  111  
 114  112                  process_line(line, &key, &value, &text);
 115  113  
 116  114                  if ((strcasecmp(key, "PageSize") == 0) ||
 117  115                      (strcasecmp(key, "InputSlot") == 0))
 118  116                          key = "media";
 119  117  
 120  118                  if (strcasecmp(key, "OpenGroup") == 0) {
 121  119                          if (value == NULL)
 122  120                                  value = "unknown";
 123      -                        current_group_name = strdup(value);
 124  121                  } else if (strcasecmp(key, "OpenUI") == 0) {
 125  122                          if ((strcasecmp(value, "PageSize") == 0) ||
 126  123                              (strcasecmp(value, "InputSlot") == 0))
 127  124                                  value = "media";
 128  125                          snprintf(capability, sizeof (capability), "%s", value);
 129  126                          snprintf(def, sizeof (def),
 130  127                                          "%s-default", value);
 131  128                          snprintf(supported, sizeof (supported),
 132  129                                          "%s-supported", value);
 133  130                          ui = 1;
↓ open down ↓ 31 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX