From: Marco van Wieringen Date: Sat, 4 Jun 2011 21:47:08 +0000 (+0200) Subject: Remove class member shadowing. X-Git-Tag: Release-7.0.0~912 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8f55c44055f22baf8908b7ac828499bd6629aed2;p=bacula%2Fbacula Remove class member shadowing. "breg.c", line 259: Warning: regs hides BREGEXP::regs. "breg.c", line 299: Warning: regs hides BREGEXP::regs. --- diff --git a/bacula/src/lib/breg.c b/bacula/src/lib/breg.c index 44667520d9..65ea155f5c 100644 --- a/bacula/src/lib/breg.c +++ b/bacula/src/lib/breg.c @@ -256,19 +256,19 @@ char *BREGEXP::return_fname(const char *fname, int len) return result; } -int BREGEXP::compute_dest_len(const char *fname, regmatch_t regs[]) +int BREGEXP::compute_dest_len(const char *fname, regmatch_t pmatch[]) { int len=0; char *p; char *psubst = subst; int no; - if (!fname || !regs) { + if (!fname || !pmatch) { return 0; } /* match failed ? */ - if (regs[0].rm_so < 0) { + if (pmatch[0].rm_so < 0) { return 0; } @@ -280,8 +280,8 @@ int BREGEXP::compute_dest_len(const char *fname, regmatch_t regs[]) /* we check if the back reference exists */ /* references can not match if we are using (..)? */ - if (regs[no].rm_so >= 0 && regs[no].rm_eo >= 0) { - len += regs[no].rm_eo - regs[no].rm_so; + if (pmatch[no].rm_so >= 0 && pmatch[no].rm_eo >= 0) { + len += pmatch[no].rm_eo - pmatch[no].rm_so; } } else { @@ -290,13 +290,13 @@ int BREGEXP::compute_dest_len(const char *fname, regmatch_t regs[]) } /* $0 is replaced by subst */ - len -= regs[0].rm_eo - regs[0].rm_so; + len -= pmatch[0].rm_eo - pmatch[0].rm_so; len += strlen(fname) + 1; return len; } -char *BREGEXP::edit_subst(const char *fname, regmatch_t regs[]) +char *BREGEXP::edit_subst(const char *fname, regmatch_t pmatch[]) { int i; char *p; @@ -305,10 +305,10 @@ char *BREGEXP::edit_subst(const char *fname, regmatch_t regs[]) int len; /* il faut recopier fname dans dest - * on recopie le debut fname -> regs->start[0] + * on recopie le debut fname -> pmatch->start[0] */ - for (i = 0; i < regs[0].rm_so ; i++) { + for (i = 0; i < pmatch[0].rm_so ; i++) { result[i] = fname[i]; } @@ -320,9 +320,9 @@ char *BREGEXP::edit_subst(const char *fname, regmatch_t regs[]) no = *psubst++ - '0'; /* have a back reference ? */ - if (regs[no].rm_so >= 0 && regs[no].rm_eo >= 0) { - len = regs[no].rm_eo - regs[no].rm_so; - bstrncpy(result + i, fname + regs[no].rm_so, len + 1); + if (pmatch[no].rm_so >= 0 && pmatch[no].rm_eo >= 0) { + len = pmatch[no].rm_eo - pmatch[no].rm_so; + bstrncpy(result + i, fname + pmatch[no].rm_so, len + 1); i += len ; } @@ -332,7 +332,7 @@ char *BREGEXP::edit_subst(const char *fname, regmatch_t regs[]) } /* we copy what is out of the match */ - strcpy(result + i, fname + regs[0].rm_eo); + strcpy(result + i, fname + pmatch[0].rm_eo); return result; } diff --git a/bacula/src/lib/breg.h b/bacula/src/lib/breg.h index d7d3acfe6b..1a7d412371 100644 --- a/bacula/src/lib/breg.h +++ b/bacula/src/lib/breg.h @@ -75,8 +75,8 @@ public: char *eor; /* end of regexp in expr */ char *return_fname(const char *fname, int len); /* return fname as result */ - char *edit_subst(const char *fname, regmatch_t regs[]); - int compute_dest_len(const char *fname, regmatch_t regs[]); + char *edit_subst(const char *fname, regmatch_t pmatch[]); + int compute_dest_len(const char *fname, regmatch_t pmatch[]); bool extract_regexp(const char *motif); };