Branch: Tag:

2014-08-28

2014-08-28 13:30:34 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed warnings about static.

The keyword "static" has been marked deprecated in Pike 8.0.

Thanks to Chris Angelico <rosuav@gmail.com> for the report.

189:    };       class AttrState(string attr, string|int setto) { -  static string _sprintf(int type) { +  protected string _sprintf(int type) {    return type=='O' && sprintf("AttrState(%O, %O)\n", attr, setto);    }    };       class MatchAttr(string name, int is_macro, array(AttrState) states) { -  static string _sprintf(int type) { +  protected string _sprintf(int type) {    return type=='O' && sprintf("MatchAttr(%O, %d, %O)\n",    name, is_macro, states);    }    };    -  static array(MatchAttr) attrs = ({}); -  static mapping(string:MatchAttr) macros = ([]); +  protected array(MatchAttr) attrs = ({}); +  protected mapping(string:MatchAttr) macros = ([]);    -  static int invalid_attr_name(string name) +  protected int invalid_attr_name(string name)    {    int n;    if(name == "" || name[0] == '-')
213:    return n != sizeof(name);    }    -  static AttrState parse_attr(string src) +  protected AttrState parse_attr(string src)    {    string equals = 0;    string|int setto;
228:    return AttrState(src, setto);    }    -  static MatchAttr parse_attr_line(string line, int macro_ok) +  protected MatchAttr parse_attr_line(string line, int macro_ok)    {    int is_macro=0;    string name;
247:    return MatchAttr(name, is_macro, reverse(map(line/" "-({""}), parse_attr)));    }    -  static void handle_attr_line(string line, int macro_ok) +  protected void handle_attr_line(string line, int macro_ok)    {    MatchAttr a = parse_attr_line(line, macro_ok);    if(a) attrs += ({ a });    }    -  static void create(string data) +  protected void create(string data)    {    foreach(data/"\n", string line)    handle_attr_line(line, 1);
264:    attrs = filter(attrs, lambda(MatchAttr a) { return !a->is_macro; });    }    -  static int path_matches(string path, string pattern) +  protected int path_matches(string path, string pattern)    {    if(search(pattern, "/")<0)    return glob(pattern, (path/"/")[-1]);
273:    return glob(pattern, path);    }    -  static void macroexpand_one(string attrname, array(MatchAttr) attrs, +  protected void macroexpand_one(string attrname, array(MatchAttr) attrs,    mapping(string:string|int) all_attr)    {    if(all_attr[attrname] != ATTR_TRUE)
282:    if(ma) fill_one(ma, attrs, all_attr);    }    -  static void fill_one(MatchAttr attr, array(MatchAttr) attrs, +  protected void fill_one(MatchAttr attr, array(MatchAttr) attrs,    mapping(string:string|int) all_attr)    {    foreach(attr->states, AttrState s) {
293:    }    }    -  static void fill(string path, array(MatchAttr) attrs, +  protected void fill(string path, array(MatchAttr) attrs,    mapping(string:string|int) all_attr)    {    foreach(attrs, MatchAttr a)
324:    return r;    }    -  static string _sprintf(int type) { +  protected string _sprintf(int type) {    return type=='O' && sprintf("GitAttributes(%O)\n", attrs);    }   }
335:      class CommitHookUtils   { -  static array(string) files_to_commit; +  protected array(string) files_to_commit;    GitAttributes attrs;       private string git_dir;
460:   {    inherit CommitHookUtils;    -  static string sha; +  protected string sha;       string get_file(string filename, int|void allow_empty)    {
556:    ACCESS_FULL = 2, // rebase/delete branch, move/delete tag, etc.    };    -  static mapping(string:AccessLevel) groups = ([ +  protected mapping(string:AccessLevel) groups = ([    "scratch": ACCESS_FULL,    ]);    -  static array(string) commits_to_check = ({}); +  protected array(string) commits_to_check = ({});    -  static void parse_groups(string user) +  protected void parse_groups(string user)    {    string git_dir = get_git_dir();   
785:      class NiceIdentFilter   { -  static string replace_id(string f, function(string:string) replace) { +  protected string replace_id(string f, function(string:string) replace) {    int p=0;    while((p=search(f, DOLLAR"Id", p)) >= 0) {    int p2 = search(f, DOLLAR, p+3), p3 = search(f, "\n", p+3);
804:    return f;    }    -  static string clean_ident(string i) +  protected string clean_ident(string i)    {    if(has_prefix(i, DOLLAR"Id:") && sizeof(i/" ")==13)    return unexpanded_id;    }    -  static string smudge_ident(string i) +  protected string smudge_ident(string i)    {    return DOLLAR"Id: some nice ident perhaps, but based on what? "DOLLAR;    }