Print this page
make: fix GCC warnings

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/lib/vroot/vroot.cc
          +++ new/usr/src/cmd/make/lib/vroot/vroot.cc
↓ open down ↓ 31 lines elided ↑ open up ↑
  32   32  
  33   33  #include <string.h>
  34   34  #include <sys/param.h>
  35   35  #include <sys/file.h>
  36   36  
  37   37  #include <avo/intl.h>   /* for NOCATGETS */
  38   38  
  39   39  typedef struct {
  40   40          short           init;
  41   41          pathpt          vector;
  42      -        char            *env_var;
       42 +        const char      *env_var;
  43   43  } vroot_patht;
  44   44  
  45   45  typedef struct {
  46   46          vroot_patht     vroot;
  47   47          vroot_patht     path;
  48   48          char            full_path[MAXPATHLEN+1];
  49   49          char            *vroot_start;
  50   50          char            *path_start;
  51   51          char            *filename_start;
  52   52          int             scan_vroot_first;
  53   53          int             cpp_style_path;
  54   54  } vroot_datat, *vroot_datapt;
  55   55  
  56   56  static vroot_datat      vroot_data= {
  57   57          { 0, NULL, NOCATGETS("VIRTUAL_ROOT")},
  58   58          { 0, NULL, NOCATGETS("PATH")},
  59   59          "", NULL, NULL, NULL, 0, 1};
  60   60  
  61   61  void
  62      -add_dir_to_path(register char *path, register pathpt *pointer, register int position)
       62 +add_dir_to_path(const char *path, register pathpt *pointer, register int position)
  63   63  {
  64   64          register int            size= 0;
  65   65          register int            length;
  66   66          register char           *name;
  67   67          register pathcellpt     p;
  68   68          pathpt                  new_path;
  69   69  
  70   70          if (*pointer != NULL) {
  71   71                  for (p= &((*pointer)[0]); p->path != NULL; p++, size++);
  72   72                  if (position < 0)
↓ open down ↓ 27 lines elided ↑ open up ↑
 100  100                          if (p= strchr(string, ':')) *p= 0;
 101  101                          if ((remove_slash == 1) && !strcmp(string, "/"))
 102  102                                  add_dir_to_path("", &result, -1);
 103  103                          else
 104  104                                  add_dir_to_path(string, &result, -1);
 105  105                          if (p) *p= ':';
 106  106                          else return(result);};
 107  107          return((pathpt)NULL);
 108  108  }
 109  109  
 110      -char *
      110 +const char *
 111  111  get_vroot_name(void)
 112  112  {
 113  113          return(vroot_data.vroot.env_var);
 114  114  }
 115  115  
 116      -char *
      116 +const char *
 117  117  get_path_name(void)
 118  118  {
 119  119          return(vroot_data.path.env_var);
 120  120  }
 121  121  
 122  122  void
 123  123  flush_path_cache(void)
 124  124  {
 125  125          vroot_data.path.init= 0;
 126  126  }
↓ open down ↓ 214 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX