* regex.c (calculate_must_string, slow_search, re_search): Silence

warnings regarding char * vs. unsigned char * mismatch;
  submitted by Lyle Johnson <lyle.johnson@gmail.com>
  in [ruby-core:10416].

* ext/bigdecimal/bigdecimal.c (BigDecimal_load): Ditto.

* ext/digest/sha1/sha1ossl.c (SHA1_Finish): Ditto.

* ext/digest/rmd160/rmd160ossl.c (RMD160_Finish): Ditto.

* ext/digest/digest.c (rb_digest_base_finish,
  rb_digest_base_update): Ditto.

* ext/nkf/nkf.c (rb_str_resize, rb_nkf_kconv, rb_nkf_guess1,
  rb_nkf_guess2): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2007-02-27 10:38:32 +00:00
parent 8e062b44bd
commit 5a9a84efe7
7 changed files with 39 additions and 20 deletions

18
regex.c
View file

@ -1014,8 +1014,8 @@ calculate_must_string(start, end)
{
int mcnt;
int max = 0;
unsigned char *p = start;
unsigned char *pend = end;
unsigned char *p = (unsigned char *)start;
unsigned char *pend = (unsigned char *)end;
char *must = 0;
if (start == NULL) return 0;
@ -1029,7 +1029,7 @@ calculate_must_string(start, end)
case exactn:
mcnt = *p;
if (mcnt > max) {
must = p;
must = (char *)p;
max = mcnt;
}
p += mcnt+1;
@ -2689,7 +2689,7 @@ slow_search(little, llen, big, blen, translate)
}
}
if (slow_match(little, little+llen, big, bend, translate))
if (slow_match(little, little+llen, big, bend, (unsigned char *)translate))
return big - bsave;
big+=mbclen(*big);
@ -3222,13 +3222,13 @@ re_search(bufp, string, size, startpos, range, regs)
}
pend = size;
if (bufp->options & RE_OPTIMIZE_NO_BM) {
pos = slow_search(bufp->must+1, len,
string+pbeg, pend-pbeg,
MAY_TRANSLATE()?translate:0);
pos = slow_search((unsigned char *)(bufp->must+1), len,
(unsigned char*)(string+pbeg), pend-pbeg,
(char *)(MAY_TRANSLATE()?translate:0));
}
else {
pos = bm_search(bufp->must+1, len,
string+pbeg, pend-pbeg,
pos = bm_search((unsigned char *)(bufp->must+1), len,
(unsigned char *)(string+pbeg), pend-pbeg,
bufp->must_skip,
MAY_TRANSLATE()?translate:0);
}