return 0;
}
- if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT))
- key = (char*)bytes_from_utf8((U8*)key, (STRLEN*)&klen, &is_utf8);
+ if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = klen;
+ /* Just casting the &klen to (STRLEN) won't work well
+ * if STRLEN and I32 are of different widths. --jhi */
+ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8);
+ klen = tmplen;
+ }
PERL_HASH(hash, key, klen);
#endif
}
}
- if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT))
- key = (char*)bytes_from_utf8((U8*)key, (STRLEN*)&klen, &is_utf8);
+ if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = klen;
+ /* See the note in hv_fetch(). --jhi */
+ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8);
+ klen = tmplen;
+ }
if (!hash)
PERL_HASH(hash, key, klen);
if (!xhv->xhv_array)
return Nullsv;
- if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT))
- key = (char*)bytes_from_utf8((U8*)key, (STRLEN*)&klen, &is_utf8);
+ if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = klen;
+ /* See the note in hv_fetch(). --jhi */
+ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8);
+ klen = tmplen;
+ }
PERL_HASH(hash, key, klen);
return 0;
#endif
- if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT))
- key = (char*)bytes_from_utf8((U8*)key, (STRLEN*)&klen, &is_utf8);
+ if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = klen;
+ /* See the note in hv_fetch(). --jhi */
+ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8);
+ klen = tmplen;
+ }
PERL_HASH(hash, key, klen);
if (len < 0) {
len = -len;
is_utf8 = TRUE;
- if (!(PL_hints & HINT_UTF8_DISTINCT))
- str = (char*)bytes_from_utf8((U8*)str, (STRLEN*)&len, &is_utf8);
+ if (!(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = len;
+ /* See the note in hv_fetch(). --jhi */
+ str = (char*)bytes_from_utf8((U8*)str, &tmplen, &is_utf8);
+ len = tmplen;
+ }
}
/* what follows is the moral equivalent of:
if (len < 0) {
len = -len;
is_utf8 = TRUE;
- if (!(PL_hints & HINT_UTF8_DISTINCT))
- str = (char*)bytes_from_utf8((U8*)str, (STRLEN*)&len, &is_utf8);
+ if (!(PL_hints & HINT_UTF8_DISTINCT)) {
+ STRLEN tmplen = len;
+ /* See the note in hv_fetch(). --jhi */
+ str = (char*)bytes_from_utf8((U8*)str, &tmplen, &is_utf8);
+ len = tmplen;
+ }
}
/* what follows is the moral equivalent of: