----------------
____________________________________________________________________________
+[ 1776] By: gsar on 1998/08/09 17:53:48
+ Log: fix coredump with MULTIPLICITY (ckWARN() needs early curcop init)
+ Branch: perl
+ ! Changes MANIFEST perl.c pod/perlhist.pod
+____________________________________________________________________________
[ 1775] By: gsar on 1998/08/09 14:35:33
Log: tweak warning test
Branch: perl
UV final;
register UV uv;
UV puv;
- char *dst;
register I32 from_utf = PL_op->op_private & OPpTRANS_FROM_UTF;
register I32 to_utf = PL_op->op_private & OPpTRANS_TO_UTF;
}
else {
while (s < send) {
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, *s); /* XXX suboptimal */
if (swash_fetch(rv, tmpbuf) < none)
matches++;
if (svp)
final = SvUV(*svp);
- Newz(801, d, len * (bits >> 3) + 1, char);
+ Newz(801, d, len * (bits >> 3) + 1, U8);
dst = d;
puv = 0xfeedface;
if (from_utf)
uv = swash_fetch(rv, s);
else {
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, *s); /* XXX suboptimal */
uv = swash_fetch(rv, tmpbuf);
}
if (from_utf)
uv = swash_fetch(rv, s);
else {
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, *s); /* XXX suboptimal */
uv = swash_fetch(rv, tmpbuf);
}
s += UTF8SKIP(s);
}
}
- sv_usepvn_mg(sv, dst, d - dst);
+ sv_usepvn_mg(sv, (char*)dst, d - dst);
}
return matches;
}
#define save_nogv Perl_save_nogv
#define save_op Perl_save_op
#define save_pptr Perl_save_pptr
+#define save_re_context Perl_save_re_context
#define save_scalar Perl_save_scalar
#define save_sptr Perl_save_sptr
#define save_svref Perl_save_svref
#define sv_newref Perl_sv_newref
#define sv_nv Perl_sv_nv
#define sv_peek Perl_sv_peek
+#define sv_pos_b2u Perl_sv_pos_b2u
+#define sv_pos_u2b Perl_sv_pos_u2b
#define sv_pvn Perl_sv_pvn
#define sv_pvn_force Perl_sv_pvn_force
#define sv_ref Perl_sv_ref
#define warn_nosemi Perl_warn_nosemi
#define warn_reserved Perl_warn_reserved
#define warn_uninit Perl_warn_uninit
+#define warner Perl_warner
#define watch Perl_watch
#define watchaddr Perl_watchaddr
#define watchok Perl_watchok
save_nogv
save_op
save_pptr
+save_re_context
save_scalar
save_sptr
save_svref
sv_iv
sv_len
sv_len_utf8
+sv_pos_u2b
+sv_pos_b2u
sv_magic
sv_mortalcopy
sv_newmortal
#define intuit_more pPerl->Perl_intuit_more
#undef invert
#define invert pPerl->Perl_invert
+
+#undef is_uni_alnum
+#define is_uni_alnum pPerl->Perl_is_uni_alnum
+#undef is_uni_alnum_lc
+#define is_uni_alnum_lc pPerl->Perl_is_uni_alnum_lc
+#undef is_uni_alpha
+#define is_uni_alpha pPerl->Perl_is_uni_alpha
+#undef is_uni_alpha_lc
+#define is_uni_alpha_lc pPerl->Perl_is_uni_alpha_lc
+#undef is_uni_digit
+#define is_uni_digit pPerl->Perl_is_uni_digit
+#undef is_uni_digit_lc
+#define is_uni_digit_lc pPerl->Perl_is_uni_digit_lc
+#undef is_uni_idfirst
+#define is_uni_idfirst pPerl->Perl_is_uni_idfirst
+#undef is_uni_idfirst_lc
+#define is_uni_idfirst_lc pPerl->Perl_is_uni_idfirst_lc
+#undef is_uni_lower
+#define is_uni_lower pPerl->Perl_is_uni_lower
+#undef is_uni_lower_lc
+#define is_uni_lower_lc pPerl->Perl_is_uni_lower_lc
+#undef is_uni_print
+#define is_uni_print pPerl->Perl_is_uni_print
+#undef is_uni_print_lc
+#define is_uni_print_lc pPerl->Perl_is_uni_print_lc
+#undef is_uni_space
+#define is_uni_space pPerl->Perl_is_uni_space
+#undef is_uni_space_lc
+#define is_uni_space_lc pPerl->Perl_is_uni_space_lc
+#undef is_uni_upper
+#define is_uni_upper pPerl->Perl_is_uni_upper
+#undef is_uni_upper_lc
+#define is_uni_upper_lc pPerl->Perl_is_uni_upper_lc
+#undef is_utf8_alnum
+#define is_utf8_alnum pPerl->Perl_is_utf8_alnum
+#undef is_utf8_alpha
+#define is_utf8_alpha pPerl->Perl_is_utf8_alpha
+#undef is_utf8_digit
+#define is_utf8_digit pPerl->Perl_is_utf8_digit
+#undef is_utf8_idfirst
+#define is_utf8_idfirst pPerl->Perl_is_utf8_idfirst
+#undef is_utf8_lower
+#define is_utf8_lower pPerl->Perl_is_utf8_lower
+#undef is_utf8_mark
+#define is_utf8_mark pPerl->Perl_is_utf8_mark
+#undef is_utf8_print
+#define is_utf8_print pPerl->Perl_is_utf8_print
+#undef is_utf8_space
+#define is_utf8_space pPerl->Perl_is_utf8_space
+#undef is_utf8_upper
+#define is_utf8_upper pPerl->Perl_is_utf8_upper
+
#undef io_close
#define io_close pPerl->Perl_io_close
#undef ioctl
#define save_scalar pPerl->Perl_save_scalar
#undef save_pptr
#define save_pptr pPerl->Perl_save_pptr
+#undef save_re_context
+#define save_re_context pPerl->Perl_save_re_context
#undef save_sptr
#define save_sptr pPerl->Perl_save_sptr
#undef save_svref
#define sv_iv pPerl->Perl_sv_iv
#undef sv_len
#define sv_len pPerl->Perl_sv_len
+#undef sv_len_utf8
+#define sv_len_utf8 pPerl->Perl_sv_len_utf8
+#undef sv_pos_u2b
+#define sv_pos_u2b pPerl->Perl_sv_pos_u2b
+#undef sv_pos_b2u
+#define sv_pos_b2u pPerl->Perl_sv_pos_b2u
#undef sv_magic
#define sv_magic pPerl->Perl_sv_magic
#undef sv_mortalcopy
#define sv_vcatpvfn pPerl->Perl_sv_vcatpvfn
#undef sv_vsetpvfn
#define sv_vsetpvfn pPerl->Perl_sv_vsetpvfn
+#undef swash_init
+#define swash_init pPerl->Perl_swash_init
+#undef swash_fetch
+#define swash_fetch pPerl->Perl_swash_fetch
#undef taint_env
#define taint_env pPerl->Perl_taint_env
#undef taint_not
#define taint_not pPerl->Perl_taint_not
#undef taint_proper
#define taint_proper pPerl->Perl_taint_proper
+
+#undef to_uni_lower
+#define to_uni_lower pPerl->Perl_to_uni_lower
+#undef to_uni_lower_lc
+#define to_uni_lower_lc pPerl->Perl_to_uni_lower_lc
+#undef to_uni_title
+#define to_uni_title pPerl->Perl_to_uni_title
+#undef to_uni_title_lc
+#define to_uni_title_lc pPerl->Perl_to_uni_title_lc
+#undef to_uni_upper
+#define to_uni_upper pPerl->Perl_to_uni_upper
+#undef to_uni_upper_lc
+#define to_uni_upper_lc pPerl->Perl_to_uni_upper_lc
+#undef to_utf8_lower
+#define to_utf8_lower pPerl->Perl_to_utf8_lower
+#undef to_utf8_title
+#define to_utf8_title pPerl->Perl_to_utf8_title
+#undef to_utf8_upper
+#define to_utf8_upper pPerl->Perl_to_utf8_upper
+
#undef too_few_arguments
#define too_few_arguments pPerl->Perl_too_few_arguments
#undef too_many_arguments
#define unsharepvn pPerl->Perl_unsharepvn
#undef utilize
#define utilize pPerl->Perl_utilize
+
+#undef utf16_to_utf8
+#define utf16_to_utf8 pPerl->Perl_utf16_to_utf8
+#undef utf16_to_utf8_reversed
+#define utf16_to_utf8_reversed pPerl->Perl_utf16_to_utf8_reversed
+#undef utf8_distance
+#define utf8_distance pPerl->Perl_utf8_distance
+#undef utf8_hop
+#define utf8_hop pPerl->Perl_utf8_hop
+#undef utf8_to_uv
+#define utf8_to_uv pPerl->Perl_utf8_to_uv
+#undef uv_to_utf8
+#define uv_to_utf8 pPerl->Perl_uv_to_utf8
+
#undef vivify_defelem
#define vivify_defelem pPerl->Perl_vivify_defelem
#undef vivify_ref
#define wait4pid pPerl->Perl_wait4pid
#undef warn
#define warn pPerl->Perl_warn
+#undef warner
+#define warner pPerl->Perl_warner
#undef watch
#define watch pPerl->Perl_watch
#undef whichsig
#define intuit_more CPerlObj::Perl_intuit_more
#undef invert
#define invert CPerlObj::Perl_invert
+#undef is_uni_alnum
+#define is_uni_alnum CPerlObj::Perl_is_uni_alnum
+#undef is_uni_alnum_lc
+#define is_uni_alnum_lc CPerlObj::Perl_is_uni_alnum_lc
+#undef is_uni_alpha
+#define is_uni_alpha CPerlObj::Perl_is_uni_alpha
+#undef is_uni_alpha_lc
+#define is_uni_alpha_lc CPerlObj::Perl_is_uni_alpha_lc
+#undef is_uni_digit
+#define is_uni_digit CPerlObj::Perl_is_uni_digit
+#undef is_uni_digit_lc
+#define is_uni_digit_lc CPerlObj::Perl_is_uni_digit_lc
+#undef is_uni_idfirst
+#define is_uni_idfirst CPerlObj::Perl_is_uni_idfirst
+#undef is_uni_idfirst_lc
+#define is_uni_idfirst_lc CPerlObj::Perl_is_uni_idfirst_lc
+#undef is_uni_lower
+#define is_uni_lower CPerlObj::Perl_is_uni_lower
+#undef is_uni_lower_lc
+#define is_uni_lower_lc CPerlObj::Perl_is_uni_lower_lc
+#undef is_uni_print
+#define is_uni_print CPerlObj::Perl_is_uni_print
+#undef is_uni_print_lc
+#define is_uni_print_lc CPerlObj::Perl_is_uni_print_lc
+#undef is_uni_space
+#define is_uni_space CPerlObj::Perl_is_uni_space
+#undef is_uni_space_lc
+#define is_uni_space_lc CPerlObj::Perl_is_uni_space_lc
+#undef is_uni_upper
+#define is_uni_upper CPerlObj::Perl_is_uni_upper
+#undef is_uni_upper_lc
+#define is_uni_upper_lc CPerlObj::Perl_is_uni_upper_lc
+#undef is_utf8_alnum
+#define is_utf8_alnum CPerlObj::Perl_is_utf8_alnum
+#undef is_utf8_alpha
+#define is_utf8_alpha CPerlObj::Perl_is_utf8_alpha
+#undef is_utf8_digit
+#define is_utf8_digit CPerlObj::Perl_is_utf8_digit
+#undef is_utf8_idfirst
+#define is_utf8_idfirst CPerlObj::Perl_is_utf8_idfirst
+#undef is_utf8_lower
+#define is_utf8_lower CPerlObj::Perl_is_utf8_lower
+#undef is_utf8_mark
+#define is_utf8_mark CPerlObj::Perl_is_utf8_mark
+#undef is_utf8_print
+#define is_utf8_print CPerlObj::Perl_is_utf8_print
+#undef is_utf8_space
+#define is_utf8_space CPerlObj::Perl_is_utf8_space
+#undef is_utf8_upper
+#define is_utf8_upper CPerlObj::Perl_is_utf8_upper
+
#undef io_close
#define io_close CPerlObj::Perl_io_close
#undef is_an_int
#define regbranch CPerlObj::regbranch
#undef regc
#define regc CPerlObj::regc
+#undef reguni
+#define reguni CPerlObj::reguni
#undef regcurly
#define regcurly CPerlObj::regcurly
#undef regcppush
#define regcppush CPerlObj::regcppush
#undef regcppop
#define regcppop CPerlObj::regcppop
+#undef reghop
+#define reghop CPerlObj::reghop
+#undef reghopmaybe
+#define reghopmaybe CPerlObj::reghopmaybe
#undef regclass
#define regclass CPerlObj::regclass
+#undef regclassutf8
+#define regclassutf8 CPerlObj::regclassutf8
#undef regexec_flags
#define regexec_flags CPerlObj::Perl_regexec_flags
#undef reginclass
#define reginclass CPerlObj::reginclass
+#undef reginclassutf8
+#define reginclassutf8 CPerlObj::reginclassutf8
#undef reginsert
#define reginsert CPerlObj::reginsert
#undef regmatch
#define save_scalar_at CPerlObj::save_scalar_at
#undef save_pptr
#define save_pptr CPerlObj::Perl_save_pptr
+#undef save_re_context
+#define save_re_context CPerlObj::Perl_save_re_context
#undef save_sptr
#define save_sptr CPerlObj::Perl_save_sptr
#undef save_svref
#define sv_iv CPerlObj::Perl_sv_iv
#undef sv_len
#define sv_len CPerlObj::Perl_sv_len
+#undef sv_len_utf8
+#define sv_len_utf8 CPerlObj::Perl_sv_len_utf8
+#undef sv_pos_u2b
+#define sv_pos_u2b CPerlObj::Perl_sv_pos_u2b
+#undef sv_pos_b2u
+#define sv_pos_b2u CPerlObj::Perl_sv_pos_b2u
#undef sv_magic
#define sv_magic CPerlObj::Perl_sv_magic
#undef sv_mortalcopy
#define sv_vcatpvfn CPerlObj::Perl_sv_vcatpvfn
#undef sv_vsetpvfn
#define sv_vsetpvfn CPerlObj::Perl_sv_vsetpvfn
+#undef swash_init
+#define swash_init CPerlObj::Perl_swash_init
+#undef swash_fetch
+#define swash_fetch CPerlObj::Perl_swash_fetch
#undef taint_env
#define taint_env CPerlObj::Perl_taint_env
#undef taint_not
#define taint_proper CPerlObj::Perl_taint_proper
#undef tokeq
#define tokeq CPerlObj::tokeq
+
+#undef to_uni_lower
+#define to_uni_lower CPerlObj::Perl_to_uni_lower
+#undef to_uni_lower_lc
+#define to_uni_lower_lc CPerlObj::Perl_to_uni_lower_lc
+#undef to_uni_title
+#define to_uni_title CPerlObj::Perl_to_uni_title
+#undef to_uni_title_lc
+#define to_uni_title_lc CPerlObj::Perl_to_uni_title_lc
+#undef to_uni_upper
+#define to_uni_upper CPerlObj::Perl_to_uni_upper
+#undef to_uni_upper_lc
+#define to_uni_upper_lc CPerlObj::Perl_to_uni_upper_lc
+#undef to_utf8_lower
+#define to_utf8_lower CPerlObj::Perl_to_utf8_lower
+#undef to_utf8_title
+#define to_utf8_title CPerlObj::Perl_to_utf8_title
+#undef to_utf8_upper
+#define to_utf8_upper CPerlObj::Perl_to_utf8_upper
+
#undef too_few_arguments
#define too_few_arguments CPerlObj::Perl_too_few_arguments
#undef too_many_arguments
#define usage CPerlObj::usage
#undef utilize
#define utilize CPerlObj::Perl_utilize
+
+
+#undef utf16_to_utf8
+#define utf16_to_utf8 CPerlObj::Perl_utf16_to_utf8
+#undef utf16_to_utf8_reversed
+#define utf16_to_utf8_reversed CPerlObj::Perl_utf16_to_utf8_reversed
+#undef utf8_distance
+#define utf8_distance CPerlObj::Perl_utf8_distance
+#undef utf8_hop
+#define utf8_hop CPerlObj::Perl_utf8_hop
+#undef utf8_to_uv
+#define utf8_to_uv CPerlObj::Perl_utf8_to_uv
+#undef uv_to_utf8
+#define uv_to_utf8 CPerlObj::Perl_uv_to_utf8
+
+
#undef validate_suid
#define validate_suid CPerlObj::validate_suid
#undef visit
#define wait4pid CPerlObj::Perl_wait4pid
#undef warn
#define warn CPerlObj::Perl_warn
+#undef warner
+#define warner CPerlObj::Perl_warner
#undef watch
#define watch CPerlObj::Perl_watch
#undef whichsig
diff = val - nextmin;
if (diff > 0) {
t = uv_to_utf8(tmpbuf,nextmin);
- sv_catpvn(transv, tmpbuf, t - tmpbuf);
+ sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf);
if (diff > 1) {
t = uv_to_utf8(tmpbuf, val - 1);
sv_catpvn(transv, "\377", 1);
- sv_catpvn(transv, tmpbuf, t - tmpbuf);
+ sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf);
}
}
if (*s == 0xff)
nextmin = val + 1;
}
t = uv_to_utf8(tmpbuf,nextmin);
- sv_catpvn(transv, tmpbuf, t - tmpbuf);
+ sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf);
t = uv_to_utf8(tmpbuf, 0x7fffffff);
sv_catpvn(transv, "\377", 1);
- sv_catpvn(transv, tmpbuf, t - tmpbuf);
- t = SvPVX(transv);
+ sv_catpvn(transv, (char*)tmpbuf, t - tmpbuf);
+ t = (U8*)SvPVX(transv);
tlen = SvCUR(transv);
tend = t + tlen;
}
Graham 5.005_03 1998-
Sarathy 5.005_50 1998-Jul-26 The 5.006 development track.
- 5.005_51 1998-Aug-09
+ 5.005_51 1998-Aug-10
=head2 SELECTED RELEASE SIZES
{
djSP; dTARGET;
I32 value;
- char *tmps = POPp;
+ U8 *tmps = (U8*)POPp;
I32 retlen;
if (IN_UTF8 && (*tmps & 0x80))
if (IN_UTF8 && value >= 128) {
SvGROW(TARG,8);
tmps = SvPVX(TARG);
- tmps = uv_to_utf8(tmps, (UV)value);
+ tmps = (char*)uv_to_utf8((U8*)tmps, (UV)value);
SvCUR_set(TARG, tmps - SvPVX(TARG));
*tmps = '\0';
(void)SvPOK_only(TARG);
register U8 *s;
STRLEN slen;
- if (IN_UTF8 && (s = SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
+ if (IN_UTF8 && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
I32 ulen;
U8 tmpbuf[10];
U8 *tend;
if (!SvPADTMP(sv) || tend - tmpbuf != ulen) {
dTARGET;
- sv_setpvn(TARG, tmpbuf, tend - tmpbuf);
- sv_catpvn(TARG, s + ulen, slen - ulen);
+ sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
+ sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
SETs(TARG);
}
else {
- s = SvPV_force(sv, slen);
+ s = (U8*)SvPV_force(sv, slen);
Copy(tmpbuf, s, ulen, U8);
}
RETURN;
sv = TARG;
SETs(sv);
}
- s = SvPV_force(sv, PL_na);
+ s = (U8*)SvPV_force(sv, PL_na);
if (*s) {
if (PL_op->op_private & OPpLOCALE) {
TAINT;
register U8 *s;
STRLEN slen;
- if (IN_UTF8 && (s = SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
+ if (IN_UTF8 && (s = (U8*)SvPV(sv, slen)) && slen && (*s & 0xc0) == 0xc0) {
I32 ulen;
U8 tmpbuf[10];
U8 *tend;
if (!SvPADTMP(sv) || tend - tmpbuf != ulen) {
dTARGET;
- sv_setpvn(TARG, tmpbuf, tend - tmpbuf);
- sv_catpvn(TARG, s + ulen, slen - ulen);
+ sv_setpvn(TARG, (char*)tmpbuf, tend - tmpbuf);
+ sv_catpvn(TARG, (char*)(s + ulen), slen - ulen);
SETs(TARG);
}
else {
- s = SvPV_force(sv, slen);
+ s = (U8*)SvPV_force(sv, slen);
Copy(tmpbuf, s, ulen, U8);
}
RETURN;
sv = TARG;
SETs(sv);
}
- s = SvPV_force(sv, PL_na);
+ s = (U8*)SvPV_force(sv, PL_na);
if (*s) {
if (PL_op->op_private & OPpLOCALE) {
TAINT;
register U8 *d;
U8 *send;
- s = SvPV(sv,len);
+ s = (U8*)SvPV(sv,len);
if (!len) {
sv_setpvn(TARG, "", 0);
SETs(TARG);
(void)SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, (len * 2) + 1);
(void)SvPOK_only(TARG);
- d = SvPVX(TARG);
+ d = (U8*)SvPVX(TARG);
send = s + len;
if (PL_op->op_private & OPpLOCALE) {
TAINT;
SETs(sv);
}
- s = SvPV_force(sv, len);
+ s = (U8*)SvPV_force(sv, len);
if (len) {
register U8 *send = s + len;
register U8 *d;
U8 *send;
- s = SvPV(sv,len);
+ s = (U8*)SvPV(sv,len);
if (!len) {
sv_setpvn(TARG, "", 0);
SETs(TARG);
(void)SvUPGRADE(TARG, SVt_PV);
SvGROW(TARG, (len * 2) + 1);
(void)SvPOK_only(TARG);
- d = SvPVX(TARG);
+ d = (U8*)SvPVX(TARG);
send = s + len;
if (PL_op->op_private & OPpLOCALE) {
TAINT;
SETs(sv);
}
- s = SvPV_force(sv, len);
+ s = (U8*)SvPV_force(sv, len);
if (len) {
register U8 *send = s + len;
up = SvPV_force(TARG, len);
if (len > 1) {
if (IN_UTF8) { /* first reverse each character */
- unsigned char* s = SvPVX(TARG);
- unsigned char* send = s + len;
+ U8* s = (U8*)SvPVX(TARG);
+ U8* send = (U8*)(s + len);
while (s < send) {
if (*s < 0x80) {
s++;
continue;
}
else {
- up = s;
+ up = (char*)s;
s += UTF8SKIP(s);
- down = s - 1;
+ down = (char*)(s - 1);
if (s > send || !((*down & 0xc0) == 0x80)) {
warn("Malformed UTF-8 character");
break;
len = strend - s;
if (checksum) {
while (len-- > 0 && s < strend) {
- auint = utf8_to_uv(s, &along);
+ auint = utf8_to_uv((U8*)s, &along);
s += along;
culong += auint;
}
EXTEND(SP, len);
EXTEND_MORTAL(len);
while (len-- > 0 && s < strend) {
- auint = utf8_to_uv(s, &along);
+ auint = utf8_to_uv((U8*)s, &along);
s += along;
sv = NEWSV(37, 0);
sv_setiv(sv, (IV)auint);
fromstr = NEXTFROM;
auint = SvUV(fromstr);
SvGROW(cat, SvCUR(cat) + 10);
- SvCUR_set(cat, uv_to_utf8(SvEND(cat), auint) - SvPVX(cat));
+ SvCUR_set(cat, (char*)uv_to_utf8((U8*)SvEND(cat),auint)
+ - SvPVX(cat));
}
*SvEND(cat) = '\0';
break;
if (PL_screamfirst[BmRARE(rx->check_substr)] < 0)
goto nope;
- b = HOP((U8*)s, rx->check_offset_min);
+ b = (char*)HOP((U8*)s, rx->check_offset_min);
if (!(s = screaminstr(TARG, rx->check_substr, b - s, 0, &p, 0)))
goto nope;
goto yup;
if (s && rx->check_offset_max < s - t) {
++BmUSEFUL(rx->check_substr);
- s = HOP((U8*)s, -rx->check_offset_max);
+ s = (char*)HOP((U8*)s, -rx->check_offset_max);
}
else
s = t;
beginning of match, and the match is anchored at s. */
else if (!PL_multiline) { /* Anchored near beginning of string. */
I32 slen;
- char *b = HOP((U8*)s, rx->check_offset_min);
+ char *b = (char*)HOP((U8*)s, rx->check_offset_min);
if (*SvPVX(rx->check_substr) != *b
|| ((slen = SvCUR(rx->check_substr)) > 1
&& memNE(SvPVX(rx->check_substr), b, slen)))
if (PL_screamfirst[BmRARE(rx->check_substr)] < 0)
goto nope;
- b = HOP((U8*)s, rx->check_offset_min);
+ b = (char*)HOP((U8*)s, rx->check_offset_min);
if (!(s = screaminstr(TARG, rx->check_substr, b - s, 0, &p, 0)))
goto nope;
}
goto nope;
if (s && rx->check_offset_max < s - m) {
++BmUSEFUL(rx->check_substr);
- s = HOP((U8*)s, -rx->check_offset_max);
+ s = (char*)HOP((U8*)s, -rx->check_offset_max);
}
else
s = m;
beginning of match, and the match is anchored at s. */
else if (!PL_multiline) { /* Anchored at beginning of string. */
I32 slen;
- char *b = HOP((U8*)s, rx->check_offset_min);
+ char *b = (char*)HOP((U8*)s, rx->check_offset_min);
if (*SvPVX(rx->check_substr) != *b
|| ((slen = SvCUR(rx->check_substr)) > 1
&& memNE(SvPVX(rx->check_substr), b, slen)))
VIRTUAL U32 to_uni_upper_lc _((U32 c));
VIRTUAL U32 to_uni_title_lc _((U32 c));
VIRTUAL U32 to_uni_lower_lc _((U32 c));
-VIRTUAL bool is_utf8_alnum _((unsigned char *p));
-VIRTUAL bool is_utf8_idfirst _((unsigned char *p));
-VIRTUAL bool is_utf8_alpha _((unsigned char *p));
-VIRTUAL bool is_utf8_space _((unsigned char *p));
-VIRTUAL bool is_utf8_digit _((unsigned char *p));
-VIRTUAL bool is_utf8_upper _((unsigned char *p));
-VIRTUAL bool is_utf8_lower _((unsigned char *p));
-VIRTUAL bool is_utf8_print _((unsigned char *p));
-VIRTUAL bool is_utf8_mark _((unsigned char *p));
+VIRTUAL bool is_utf8_alnum _((U8 *p));
+VIRTUAL bool is_utf8_idfirst _((U8 *p));
+VIRTUAL bool is_utf8_alpha _((U8 *p));
+VIRTUAL bool is_utf8_space _((U8 *p));
+VIRTUAL bool is_utf8_digit _((U8 *p));
+VIRTUAL bool is_utf8_upper _((U8 *p));
+VIRTUAL bool is_utf8_lower _((U8 *p));
+VIRTUAL bool is_utf8_print _((U8 *p));
+VIRTUAL bool is_utf8_mark _((U8 *p));
VIRTUAL OP* jmaybe _((OP* arg));
VIRTUAL I32 keyword _((char* d, I32 len));
VIRTUAL void leave_scope _((I32 base));
va_list* args, SV** svargs, I32 svmax,
bool *used_locale));
VIRTUAL SV* swash_init _((char* pkg, char* name, SV* listsv, I32 minbits, I32 none));
-VIRTUAL UV swash_fetch _((SV *sv, unsigned char *ptr));
+VIRTUAL UV swash_fetch _((SV *sv, U8 *ptr));
VIRTUAL void taint_env _((void));
VIRTUAL void taint_proper _((const char* f, char* s));
-VIRTUAL UV to_utf8_lower _((unsigned char *p));
-VIRTUAL UV to_utf8_upper _((unsigned char *p));
-VIRTUAL UV to_utf8_title _((unsigned char *p));
+VIRTUAL UV to_utf8_lower _((U8 *p));
+VIRTUAL UV to_utf8_upper _((U8 *p));
+VIRTUAL UV to_utf8_title _((U8 *p));
#ifdef UNLINK_ALL_VERSIONS
VIRTUAL I32 unlnk _((char* f));
#endif
VIRTUAL void utilize _((int aver, I32 floor, OP* version, OP* id, OP* arg));
VIRTUAL U8* utf16_to_utf8 _((U16* p, U8 *d, I32 bytelen));
VIRTUAL U8* utf16_to_utf8_reversed _((U16* p, U8 *d, I32 bytelen));
-VIRTUAL I32 utf8_distance _((unsigned char *a, unsigned char *b));
-VIRTUAL U8* utf8_hop _((unsigned char *s, I32 off));
-VIRTUAL UV utf8_to_uv _((unsigned char *s, I32* retlen));
-VIRTUAL char* uv_to_utf8 _((unsigned char *d, UV uv));
+VIRTUAL I32 utf8_distance _((U8 *a, U8 *b));
+VIRTUAL U8* utf8_hop _((U8 *s, I32 off));
+VIRTUAL UV utf8_to_uv _((U8 *s, I32* retlen));
+VIRTUAL U8* uv_to_utf8 _((U8 *d, UV uv));
VIRTUAL void vivify_defelem _((SV* sv));
VIRTUAL void vivify_ref _((SV* sv, U32 to_what));
VIRTUAL I32 wait4pid _((int pid, int* statusp, int flags));
regnode *regatom _((I32 *));
regnode *regbranch _((I32 *, I32));
void regc _((U8, char *));
+void reguni _((UV, char *, I32*));
regnode *regclass _((void));
+regnode *regclassutf8 _((void));
I32 regcurly _((char *));
regnode *reg_node _((U8));
regnode *regpiece _((I32 *));
I32 regrepeat_hard _((regnode *p, I32 max, I32 *lp));
I32 regtry _((regexp *prog, char *startpos));
bool reginclass _((char *p, I32 c));
+bool reginclassutf8 _((regnode *f, U8* p));
CHECKPOINT regcppush _((I32 parenfloor));
char * regcppop _((void));
+U8 * reghop _((U8 *pos, I32 off));
+U8 * reghopmaybe _((U8 *pos, I32 off));
void dump _((char *pat,...));
#ifdef WIN32
int do_aspawn _((void *vreally, void **vmark, void **vsp));
*flagp |= HASWIDTH;
nextchar();
if (UTF && !PL_utf8_mark)
- is_utf8_mark("~"); /* preload table */
+ is_utf8_mark((U8*)"~"); /* preload table */
break;
case 'w':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'W':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'b':
PL_seen_zerolen++;
*flagp |= SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 'B':
PL_seen_zerolen++;
*flagp |= SIMPLE;
nextchar();
if (UTF && !PL_utf8_alnum)
- is_utf8_alnum("a"); /* preload table */
+ is_utf8_alnum((U8*)"a"); /* preload table */
break;
case 's':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_space)
- is_utf8_space(" "); /* preload table */
+ is_utf8_space((U8*)" "); /* preload table */
break;
case 'S':
ret = reg_node(
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_space)
- is_utf8_space(" "); /* preload table */
+ is_utf8_space((U8*)" "); /* preload table */
break;
case 'd':
ret = reg_node(UTF ? DIGITUTF8 : DIGIT);
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_digit)
- is_utf8_digit("1"); /* preload table */
+ is_utf8_digit((U8*)"1"); /* preload table */
break;
case 'D':
ret = reg_node(UTF ? NDIGITUTF8 : NDIGIT);
*flagp |= HASWIDTH|SIMPLE;
nextchar();
if (UTF && !PL_utf8_digit)
- is_utf8_digit("1"); /* preload table */
+ is_utf8_digit((U8*)"1"); /* preload table */
break;
case 'p':
case 'P':
default:
normal_default:
if ((*p & 0xc0) == 0xc0 && UTF) {
- ender = utf8_to_uv(p, &numlen);
+ ender = utf8_to_uv((U8*)p, &numlen);
p += numlen;
}
else
while (PL_regcomp_parse < PL_regxend && *PL_regcomp_parse != ']') {
skipcond:
- value = utf8_to_uv(PL_regcomp_parse, &numlen);
+ value = utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
PL_regcomp_parse += numlen;
if (value == '[' && PL_regcomp_parse + 1 < PL_regxend &&
}
if (value == '\\') {
- value = utf8_to_uv(PL_regcomp_parse, &numlen);
+ value = utf8_to_uv((U8*)PL_regcomp_parse, &numlen);
PL_regcomp_parse += numlen;
switch (value) {
case 'w':
flags |= ANYOF_SPACEL;
sv_catpvf(listsv, "+utf8::IsSpace\n");
if (!PL_utf8_space)
- is_utf8_space(" ");
+ is_utf8_space((U8*)" ");
}
lastvalue = 123456;
continue;
sv_catpvf(listsv,
"!utf8::IsSpace\n");
if (!PL_utf8_space)
- is_utf8_space(" ");
+ is_utf8_space((U8*)" ");
}
lastvalue = 123456;
continue;
{
dTHR;
if (SIZE_ONLY) {
- char tmpbuf[10];
+ U8 tmpbuf[10];
*lenp = uv_to_utf8(tmpbuf, uv) - tmpbuf;
}
else
- *lenp = uv_to_utf8(s, uv) - s;
+ *lenp = uv_to_utf8((U8*)s, uv) - (U8*)s;
}
#define CHR_SVLEN(sv) (UTF ? sv_len_utf8(sv) : SvCUR(sv))
#define CHR_DIST(a,b) (UTF ? utf8_distance(a,b) : a - b)
-static char * reghop _((unsigned char *pos, I32 off));
-static char * reghopmaybe _((unsigned char *pos, I32 off));
-#define HOP(pos,off) (UTF ? reghop(pos, off) : (pos + off))
-#define HOPMAYBE(pos,off) (UTF ? reghopmaybe(pos, off) : (pos + off))
+#ifndef PERL_OBJECT
+static U8 * reghop _((U8 *pos, I32 off));
+static U8 * reghopmaybe _((U8 *pos, I32 off));
+#endif
+#define reghop_c(pos,off) ((char*)reghop((U8*)pos, off))
+#define reghopmaybe_c(pos,off) ((char*)reghopmaybe((U8*)pos, off))
+#define HOP(pos,off) (UTF ? reghop((U8*)pos, off) : (U8*)(pos + off))
+#define HOPMAYBE(pos,off) (UTF ? reghopmaybe((U8*)pos, off) : (U8*)(pos + off))
+#define HOPc(pos,off) ((char*)HOP(pos,off))
+#define HOPMAYBEc(pos,off) ((char*)HOPMAYBE(pos,off))
STATIC CHECKPOINT
regcppush(I32 parenfloor)
}
else if (s - stringarg > prog->check_offset_max &&
(UTF
- ? ((t = reghopmaybe(s, -(prog->check_offset_max))) && t >= stringarg)
+ ? ((t = reghopmaybe_c(s, -(prog->check_offset_max))) && t >= stringarg)
: (t = s - prog->check_offset_max) != 0
)
)
{
if (minlen)
dontbother = minlen - 1;
- strend = HOP(strend, -dontbother);
+ strend = HOPc(strend, -dontbother);
/* for multiline we only have to try after newlines */
if (s > startpos)
s--;
I32 back_min =
prog->anchored_substr ? prog->anchored_offset : prog->float_min_offset;
I32 delta = back_max - back_min;
- char *last = HOP(strend, 0-(CHR_SVLEN(must) + back_min)); /* Cannot start after this */
+ char *last = HOPc(strend, 0-(CHR_SVLEN(must) + back_min)); /* Cannot start after this */
char *last1; /* Last position checked before */
if (s > PL_bostr)
- last1 = HOP(s, -1);
+ last1 = HOPc(s, -1);
else
last1 = s - 1; /* bogus */
check_substr==must. */
scream_pos = -1;
dontbother = end_shift;
- strend = HOP(strend, -dontbother);
+ strend = HOPc(strend, -dontbother);
while ( (s <= last) &&
(screamer
- ? (s = screaminstr(screamer, must, HOP(s, back_min) - strbeg,
+ ? (s = screaminstr(screamer, must, HOPc(s, back_min) - strbeg,
end_shift, &scream_pos, 0))
: (s = fbm_instr((unsigned char*)HOP(s, back_min),
(unsigned char*)strend, must, 0))) ) {
- if (HOP(s, -back_max) > last1) {
- last1 = HOP(s, -back_min);
- s = HOP(s, -back_max);
+ if (HOPc(s, -back_max) > last1) {
+ last1 = HOPc(s, -back_min);
+ s = HOPc(s, -back_max);
}
else {
- char *t = (last1 >= PL_bostr) ? HOP(last1, 1) : last1 + 1;
+ char *t = (last1 >= PL_bostr) ? HOPc(last1, 1) : last1 + 1;
- last1 = HOP(s, -back_min);
+ last1 = HOPc(s, -back_min);
s = t;
}
if (UTF) {
if (minlen)
dontbother = minlen - 1;
- strend = HOP(strend, -dontbother); /* don't bother with what can't match */
+ strend = HOPc(strend, -dontbother); /* don't bother with what can't match */
tmp = 1;
/* We know what class it must start with. */
switch (OP(c)) {
case BOUNDUTF8:
if (minlen) {
dontbother++;
- strend = reghop(strend, -1);
+ strend = reghop_c(strend, -1);
}
- tmp = (I32)(s != startpos) ? utf8_to_uv(reghop(s, -1), 0) : PL_regprev;
+ tmp = (I32)(s != startpos) ? utf8_to_uv(reghop((U8*)s, -1), 0) : PL_regprev;
tmp = ((OP(c) == BOUND ? isALNUM_uni(tmp) : isALNUM_LC_uni(tmp)) != 0);
while (s < strend) {
- if (tmp == !(OP(c) == BOUND ? swash_fetch(PL_utf8_alnum, s) : isALNUM_LC_utf8(s))) {
+ if (tmp == !(OP(c) == BOUND ?
+ swash_fetch(PL_utf8_alnum, (U8*)s) :
+ isALNUM_LC_utf8((U8*)s)))
+ {
tmp = !tmp;
if (regtry(prog, s))
goto got_it;
case NBOUNDUTF8:
if (minlen) {
dontbother++;
- strend = reghop(strend, -1);
+ strend = reghop_c(strend, -1);
}
- tmp = (I32)(s != startpos) ? utf8_to_uv(reghop(s, -1), 0) : PL_regprev;
+ tmp = (I32)(s != startpos) ? utf8_to_uv(reghop((U8*)s, -1), 0) : PL_regprev;
tmp = ((OP(c) == NBOUND ? isALNUM_uni(tmp) : isALNUM_LC_uni(tmp)) != 0);
while (s < strend) {
- if (tmp == !(OP(c) == NBOUND ? swash_fetch(PL_utf8_alnum, s) : isALNUM_LC_utf8(s)))
+ if (tmp == !(OP(c) == NBOUND ?
+ swash_fetch(PL_utf8_alnum, (U8*)s) :
+ isALNUM_LC_utf8((U8*)s)))
tmp = !tmp;
else if (regtry(prog, s))
goto got_it;
break;
case ALNUMUTF8:
while (s < strend) {
- if (swash_fetch(PL_utf8_alnum, s)) {
+ if (swash_fetch(PL_utf8_alnum, (U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
case ALNUMLUTF8:
PL_reg_flags |= RF_tainted;
while (s < strend) {
- if (isALNUM_LC_utf8(s)) {
+ if (isALNUM_LC_utf8((U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
break;
case NALNUMUTF8:
while (s < strend) {
- if (!swash_fetch(PL_utf8_alnum, s)) {
+ if (!swash_fetch(PL_utf8_alnum, (U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
case NALNUMLUTF8:
PL_reg_flags |= RF_tainted;
while (s < strend) {
- if (!isALNUM_LC_utf8(s)) {
+ if (!isALNUM_LC_utf8((U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
break;
case SPACEUTF8:
while (s < strend) {
- if (*s == ' ' || swash_fetch(PL_utf8_space,s)) {
+ if (*s == ' ' || swash_fetch(PL_utf8_space,(U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
case SPACELUTF8:
PL_reg_flags |= RF_tainted;
while (s < strend) {
- if (*s == ' ' || isSPACE_LC_utf8(s)) {
+ if (*s == ' ' || isSPACE_LC_utf8((U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
break;
case NSPACEUTF8:
while (s < strend) {
- if (!(*s == ' ' || swash_fetch(PL_utf8_space,s))) {
+ if (!(*s == ' ' || swash_fetch(PL_utf8_space,(U8*)s))) {
if (tmp && regtry(prog, s))
goto got_it;
else
case NSPACELUTF8:
PL_reg_flags |= RF_tainted;
while (s < strend) {
- if (!(*s == ' ' || isSPACE_LC_utf8(s))) {
+ if (!(*s == ' ' || isSPACE_LC_utf8((U8*)s))) {
if (tmp && regtry(prog, s))
goto got_it;
else
break;
case DIGITUTF8:
while (s < strend) {
- if (swash_fetch(PL_utf8_digit,s)) {
+ if (swash_fetch(PL_utf8_digit,(U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
break;
case NDIGITUTF8:
while (s < strend) {
- if (!swash_fetch(PL_utf8_digit,s)) {
+ if (!swash_fetch(PL_utf8_digit,(U8*)s)) {
if (tmp && regtry(prog, s))
goto got_it;
else
while (s < e) {
if (l >= PL_regeol)
sayNO;
- if (utf8_to_uv(s, 0) != (c1 ? toLOWER_utf8(l) : toLOWER_LC_utf8(l)))
+ if (utf8_to_uv((U8*)s, 0) != (c1 ?
+ toLOWER_utf8((U8*)l) :
+ toLOWER_LC_utf8((U8*)l)))
+ {
sayNO;
+ }
s += UTF8SKIP(s);
l += UTF8SKIP(l);
}
sayNO;
if (nextchr & 0x80) {
if (!(OP(scan) == ALNUMUTF8
- ? swash_fetch(PL_utf8_alnum, locinput) : isALNUM_LC_utf8(locinput)))
+ ? swash_fetch(PL_utf8_alnum, (U8*)locinput)
+ : isALNUM_LC_utf8((U8*)locinput)))
+ {
sayNO;
+ }
locinput += utf8skip[nextchr];
nextchr = UCHARAT(locinput);
break;
sayNO;
if (nextchr & 0x80) {
if (OP(scan) == NALNUMUTF8
- ? swash_fetch(PL_utf8_alnum, locinput) : isALNUM_LC_utf8(locinput))
+ ? swash_fetch(PL_utf8_alnum, (U8*)locinput)
+ : isALNUM_LC_utf8((U8*)locinput))
+ {
sayNO;
+ }
locinput += utf8skip[nextchr];
nextchr = UCHARAT(locinput);
break;
case BOUNDUTF8:
case NBOUNDUTF8:
/* was last char in word? */
- ln = (locinput != PL_regbol) ? utf8_to_uv(reghop(locinput, -1), 0) : PL_regprev;
+ ln = (locinput != PL_regbol)
+ ? utf8_to_uv(reghop((U8*)locinput, -1), 0) : PL_regprev;
if (OP(scan) == BOUNDUTF8 || OP(scan) == NBOUNDUTF8) {
ln = isALNUM_uni(ln);
- n = swash_fetch(PL_utf8_alnum, locinput);
+ n = swash_fetch(PL_utf8_alnum, (U8*)locinput);
}
else {
ln = isALNUM_LC_uni(ln);
- n = isALNUM_LC_utf8(locinput);
+ n = isALNUM_LC_utf8((U8*)locinput);
}
if (((!ln) == (!n)) == (OP(scan) == BOUNDUTF8 || OP(scan) == BOUNDLUTF8))
sayNO;
sayNO;
if (nextchr & 0x80) {
if (!(OP(scan) == SPACEUTF8
- ? swash_fetch(PL_utf8_space,locinput) : isSPACE_LC_utf8(locinput)))
+ ? swash_fetch(PL_utf8_space,(U8*)locinput)
+ : isSPACE_LC_utf8((U8*)locinput)))
+ {
sayNO;
+ }
locinput += utf8skip[nextchr];
nextchr = UCHARAT(locinput);
break;
sayNO;
if (nextchr & 0x80) {
if (OP(scan) == NSPACEUTF8
- ? swash_fetch(PL_utf8_space,locinput) : isSPACE_LC_utf8(locinput))
+ ? swash_fetch(PL_utf8_space,(U8*)locinput)
+ : isSPACE_LC_utf8((U8*)locinput))
+ {
sayNO;
+ }
locinput += utf8skip[nextchr];
nextchr = UCHARAT(locinput);
break;
break;
case DIGITUTF8:
if (nextchr & 0x80) {
- if (!(swash_fetch(PL_utf8_digit,locinput)))
+ if (!(swash_fetch(PL_utf8_digit,(U8*)locinput)))
sayNO;
locinput += utf8skip[nextchr];
nextchr = UCHARAT(locinput);
if (!nextchr && locinput >= PL_regeol)
sayNO;
if (nextchr & 0x80) {
- if (swash_fetch(PL_utf8_digit,locinput))
+ if (swash_fetch(PL_utf8_digit,(U8*)locinput))
sayNO;
locinput += utf8skip[nextchr];
nextchr = UCHARAT(locinput);
nextchr = UCHARAT(++locinput);
break;
case CLUMP:
- if (locinput >= PL_regeol || swash_fetch(PL_utf8_mark, locinput))
+ if (locinput >= PL_regeol || swash_fetch(PL_utf8_mark,(U8*)locinput))
sayNO;
locinput += utf8skip[nextchr];
- while (locinput < PL_regeol && swash_fetch(PL_utf8_mark, locinput))
+ while (locinput < PL_regeol && swash_fetch(PL_utf8_mark,(U8*)locinput))
locinput += UTF8SKIP(locinput);
if (locinput > PL_regeol)
sayNO;
while (s < e) {
if (l >= PL_regeol)
sayNO;
- if (toLOWER_utf8(s) != toLOWER_utf8(l))
+ if (toLOWER_utf8((U8*)s) != toLOWER_utf8((U8*)l))
sayNO;
s += UTF8SKIP(s);
l += UTF8SKIP(l);
while (s < e) {
if (l >= PL_regeol)
sayNO;
- if (toLOWER_LC_utf8(s) != toLOWER_LC_utf8(l))
+ if (toLOWER_LC_utf8((U8*)s) != toLOWER_LC_utf8((U8*)l))
sayNO;
s += UTF8SKIP(s);
l += UTF8SKIP(l);
{
if (paren) {
if (n) {
- PL_regstartp[paren] = HOP(PL_reginput, -l);
+ PL_regstartp[paren] = HOPc(PL_reginput, -l);
PL_regendp[paren] = PL_reginput;
}
else
);
if (paren) {
if (n) {
- PL_regstartp[paren] = HOP(PL_reginput, -l);
+ PL_regstartp[paren] = HOPc(PL_reginput, -l);
PL_regendp[paren] = PL_reginput;
}
else
}
/* Couldn't or didn't -- back up. */
n--;
- locinput = HOP(locinput, -l);
+ locinput = HOPc(locinput, -l);
PL_reginput = locinput;
}
}
{
if (paren) {
if (n) {
- PL_regstartp[paren] = HOP(PL_reginput, -1);
+ PL_regstartp[paren] = HOPc(PL_reginput, -1);
PL_regendp[paren] = PL_reginput;
}
else
{
if (paren && n) {
if (n) {
- PL_regstartp[paren] = HOP(PL_reginput, -1);
+ PL_regstartp[paren] = HOPc(PL_reginput, -1);
PL_regendp[paren] = PL_reginput;
}
else
}
/* Couldn't or didn't -- back up. */
n--;
- PL_reginput = locinput = HOP(locinput, -1);
+ PL_reginput = locinput = HOPc(locinput, -1);
}
}
else {
}
/* Couldn't or didn't -- back up. */
n--;
- PL_reginput = locinput = HOP(locinput, -1);
+ PL_reginput = locinput = HOPc(locinput, -1);
}
}
}
case UNLESSM:
n = 0;
if (scan->flags) {
- s = HOPMAYBE(locinput, -scan->flags);
+ s = HOPMAYBEc(locinput, -scan->flags);
if (!s)
goto say_yes;
PL_reginput = s;
case IFMATCH:
n = 1;
if (scan->flags) {
- s = HOPMAYBE(locinput, -scan->flags);
+ s = HOPMAYBEc(locinput, -scan->flags);
if (!s)
goto say_no;
PL_reginput = s;
break;
case ALNUMUTF8:
loceol = PL_regeol;
- while (scan < loceol && swash_fetch(PL_utf8_alnum, scan)) {
+ while (scan < loceol && swash_fetch(PL_utf8_alnum, (U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
case ALNUMLUTF8:
PL_reg_flags |= RF_tainted;
loceol = PL_regeol;
- while (scan < loceol && isALNUM_LC_utf8(scan)) {
+ while (scan < loceol && isALNUM_LC_utf8((U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
break;
case NALNUMUTF8:
loceol = PL_regeol;
- while (scan < loceol && !swash_fetch(PL_utf8_alnum, scan)) {
+ while (scan < loceol && !swash_fetch(PL_utf8_alnum, (U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
case NALNUMLUTF8:
PL_reg_flags |= RF_tainted;
loceol = PL_regeol;
- while (scan < loceol && !isALNUM_LC_utf8(scan)) {
+ while (scan < loceol && !isALNUM_LC_utf8((U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
break;
case SPACEUTF8:
loceol = PL_regeol;
- while (scan < loceol && (*scan == ' ' || swash_fetch(PL_utf8_space,scan))) {
+ while (scan < loceol && (*scan == ' ' || swash_fetch(PL_utf8_space,(U8*)scan))) {
scan += UTF8SKIP(scan);
hardcount++;
}
case SPACELUTF8:
PL_reg_flags |= RF_tainted;
loceol = PL_regeol;
- while (scan < loceol && (*scan == ' ' || isSPACE_LC_utf8(scan))) {
+ while (scan < loceol && (*scan == ' ' || isSPACE_LC_utf8((U8*)scan))) {
scan += UTF8SKIP(scan);
hardcount++;
}
break;
case NSPACEUTF8:
loceol = PL_regeol;
- while (scan < loceol && !(*scan == ' ' || swash_fetch(PL_utf8_space,scan))) {
+ while (scan < loceol && !(*scan == ' ' || swash_fetch(PL_utf8_space,(U8*)scan))) {
scan += UTF8SKIP(scan);
hardcount++;
}
case NSPACELUTF8:
PL_reg_flags |= RF_tainted;
loceol = PL_regeol;
- while (scan < loceol && !(*scan == ' ' || isSPACE_LC_utf8(scan))) {
+ while (scan < loceol && !(*scan == ' ' || isSPACE_LC_utf8((U8*)scan))) {
scan += UTF8SKIP(scan);
hardcount++;
}
break;
case DIGITUTF8:
loceol = PL_regeol;
- while (scan < loceol && swash_fetch(PL_utf8_digit,scan)) {
+ while (scan < loceol && swash_fetch(PL_utf8_digit,(U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
break;
case NDIGITUTF8:
loceol = PL_regeol;
- while (scan < loceol && !swash_fetch(PL_utf8_digit,scan)) {
+ while (scan < loceol && !swash_fetch(PL_utf8_digit,(U8*)scan)) {
scan += UTF8SKIP(scan);
hardcount++;
}
match = TRUE;
else if (flags & ANYOF_FOLD) {
I32 cf;
- char tmpbuf[10];
+ U8 tmpbuf[10];
if (flags & ANYOF_LOCALE) {
PL_reg_flags |= RF_tainted;
uv_to_utf8(tmpbuf, toLOWER_LC_utf8(p));
return (flags & ANYOF_INVERT) ? !match : match;
}
-STATIC char *
-reghop(unsigned char *s, I32 off)
+STATIC U8 *
+reghop(U8 *s, I32 off)
{
dTHR;
if (off >= 0) {
return s;
}
-STATIC char *
-reghopmaybe(unsigned char *s, I32 off)
+STATIC U8 *
+reghopmaybe(U8* s, I32 off)
{
dTHR;
if (off >= 0) {
STRLEN
sv_len_utf8(register SV *sv)
{
- unsigned char *s;
- unsigned char *send;
+ U8 *s;
+ U8 *send;
STRLEN len;
if (!sv)
len = mg_length(sv);
else
#endif
- s = SvPV(sv, len);
+ s = (U8*)SvPV(sv, len);
send = s + len;
len = 0;
while (s < send) {
void
sv_pos_u2b(register SV *sv, I32* offsetp, I32* lenp)
{
- unsigned char *start;
- unsigned char *s;
- unsigned char *send;
+ U8 *start;
+ U8 *s;
+ U8 *send;
I32 uoffset = *offsetp;
STRLEN len;
if (!sv)
return;
- start = s = SvPV(sv, len);
+ start = s = (U8*)SvPV(sv, len);
send = s + len;
while (s < send && uoffset--)
s += UTF8SKIP(s);
void
sv_pos_b2u(register SV *sv, I32* offsetp)
{
- unsigned char *s;
- unsigned char *send;
+ U8 *s;
+ U8 *send;
STRLEN len;
if (!sv)
return;
- s = SvPV(sv, len);
+ s = (U8*)SvPV(sv, len);
if (len < *offsetp)
croak("panic: bad byte offset");
send = s + *offsetp;
STRLEN precis = 0;
char esignbuf[4];
- char utf8buf[10];
+ U8 utf8buf[10];
STRLEN esignlen = 0;
char *eptr = Nullch;
else
uv = (svix < svmax) ? SvIVx(svargs[svix++]) : 0;
- eptr = utf8buf;
- elen = uv_to_utf8(eptr, uv) - utf8buf;
+ eptr = (char*)utf8buf;
+ elen = uv_to_utf8((U8*)eptr, uv) - utf8buf;
goto string;
}
if (args)
__END__
# doio.c
use warning 'io' ;
-open(F, "|true|")
+open(F, "|$^X -e 1|")
EXPECT
Can't do bidirectional pipe at - line 3.
########
########
# doio.c
use warning 'io' ;
-exec "lskdjfalksdjfdjfkls" ;
+exec "lskdjfalksdjfdjfkls","" ;
EXPECT
Can't exec "lskdjfalksdjfdjfkls": No such file or directory at - line 3.
########
########
# mg.c
use warning 'signal' ;
+if ($^O eq 'MSWin32') {
+ print "SKIPPED\n# win32, can't kill() to raise()\n"; exit;
+}
$|=1;
$SIG{"INT"} = "fred"; kill "INT",$$;
EXPECT
time ; # OP_TIME
localtime ; # OP_LOCALTIME
gmtime ; # OP_GMTIME
-getgrnam 1; # OP_GGRNAM
-getgrgid 1 ; # OP_GGRGID
-getpwnam 1; # OP_GPWNAM
-getpwuid 1; # OP_GPWUID
+eval { getgrnam 1 }; # OP_GGRNAM
+eval { getgrgid 1 }; # OP_GGRGID
+eval { getpwnam 1 }; # OP_GPWNAM
+eval { getpwuid 1 }; # OP_GPWUID
EXPECT
Useless use of repeat in void context at - line 3.
Useless use of wantarray in void context at - line 5.
getservbyname 1,2; # OP_GSBYNAME
getservbyport 1,2; # OP_GSBYPORT
getservent ; # OP_GSERVENT
+INIT {
+ # some functions may not be there, so we exit without running
+ exit;
+}
EXPECT
Useless use of getsockname in void context at - line 24.
Useless use of getpeername in void context at - line 25.
########
# op.c
use warning 'syntax' ;
-exec "true" ;
+exec "$^X -e 1" ;
my $a
EXPECT
Statement unlikely to be reached at - line 4.
__END__
# regexec.c
use warning 'unsafe' ;
+print("SKIPPED\n# win32 can't increase stacksize in shell\n"),exit
+ if $^O eq 'MSWin32';
$_ = 'a' x (2**15+1);
/^()(a\1)*$/ ;
#
# % limit stacksize 16000
#
EXPECT
-Complex regular subexpression recursion limit (32766) exceeded at - line 4.
+Complex regular subexpression recursion limit (32766) exceeded at - line 6.
########
# regexec.c
use warning 'unsafe' ;
+print("SKIPPED\n# win32 can't increase stacksize in shell\n"),exit
+ if $^O eq 'MSWin32';
$_ = 'a' x (2**15+1);
/^()(a\1)*?$/ ;
#
# % limit stacksize 16000
#
EXPECT
-Complex regular subexpression recursion limit (32766) exceeded at - line 4.
+Complex regular subexpression recursion limit (32766) exceeded at - line 6.
}
#endif
+#ifndef PERL_OBJECT
+
STATIC I32
utf16_textfilter(int idx, SV *sv, int maxlen)
{
I32 count = FILTER_READ(idx+1, sv, maxlen);
if (count) {
- char* tmps;
- char* tend;
- New(898, tmps, SvCUR(sv) * 3 / 2 + 1, char);
+ U8* tmps;
+ U8* tend;
+ New(898, tmps, SvCUR(sv) * 3 / 2 + 1, U8);
tend = utf16_to_utf8((U16*)SvPVX(sv), tmps, SvCUR(sv));
- sv_usepvn(sv, tmps, tend - tmps);
+ sv_usepvn(sv, (char*)tmps, tend - tmps);
}
return count;
{
I32 count = FILTER_READ(idx+1, sv, maxlen);
if (count) {
- char* tmps;
- char* tend;
- New(898, tmps, SvCUR(sv) * 3 / 2 + 1, char);
+ U8* tmps;
+ U8* tend;
+ New(898, tmps, SvCUR(sv) * 3 / 2 + 1, U8);
tend = utf16_to_utf8_reversed((U16*)SvPVX(sv), tmps, SvCUR(sv));
- sv_usepvn(sv, tmps, tend - tmps);
+ sv_usepvn(sv, (char*)tmps, tend - tmps);
}
return count;
}
+#endif
+
void
lex_start(SV *line)
{
if (*s & 0x80 && thisutf) {
dTHR; /* only for ckWARN */
if (ckWARN(WARN_UTF8)) {
- (void)utf8_to_uv(s, &len); /* could cvt latin-1 to utf8 here... */
+ (void)utf8_to_uv((U8*)s, &len); /* could cvt latin-1 to utf8 here... */
if (len) {
while (len--)
*d++ = *s++;
"Use of \\x{} without utf8 declaration");
}
/* note: utf always shorter than hex */
- d = uv_to_utf8(d, scan_hex(s + 1, e - s - 1, &len));
+ d = (char*)uv_to_utf8((U8*)d,
+ scan_hex(s + 1, e - s - 1, &len));
s = e + 1;
}
if (utf && PL_lex_inwhat == OP_TRANS &&
utf != (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF))
{
- d = uv_to_utf8(d, uv); /* doing a CU or UC */
+ d = (char*)uv_to_utf8((U8*)d, uv); /* doing a CU or UC */
}
else {
if (uv >= 127 && UTF) {
* routines unnecessarily. You will see this not just here but throughout this file.
*/
if (UTF && (*s & 0xc0) == 0x80) {
- if (isIDFIRST_utf8(s))
+ if (isIDFIRST_utf8((U8*)s))
goto keylookup;
}
croak("Unrecognized character \\x%02X", *s & 255);
*d++ = *s++;
*d++ = *s++;
}
- else if (UTF && (*s & 0xc0) == 0x80 && isALNUM_utf8(s)) {
+ else if (UTF && (*s & 0xc0) == 0x80 && isALNUM_utf8((U8*)s)) {
char *t = s + UTF8SKIP(s);
- while (*t & 0x80 && is_utf8_mark(t))
+ while (*t & 0x80 && is_utf8_mark((U8*)t))
t += UTF8SKIP(t);
if (d + (t - s) > e)
croak(ident_too_long);
*d++ = *s++;
*d++ = *s++;
}
- else if (UTF && (*s & 0xc0) == 0x80 && isALNUM_utf8(s)) {
+ else if (UTF && (*s & 0xc0) == 0x80 && isALNUM_utf8((U8*)s)) {
char *t = s + UTF8SKIP(s);
- while (*t & 0x80 && is_utf8_mark(t))
+ while (*t & 0x80 && is_utf8_mark((U8*)t))
t += UTF8SKIP(t);
if (d + (t - s) > e)
croak(ident_too_long);
}
}
}
- if (isIDFIRST(*d) || (UTF && (*d & 0xc0) == 0x80 && isIDFIRST_utf8(d))) {
+ if (isIDFIRST(*d) || (UTF && (*d & 0xc0) == 0x80 && isIDFIRST_utf8((U8*)d))) {
d++;
if (UTF) {
e = s;
while (e < send && (isALNUM(*e) || ((*e & 0xc0) == 0x80 && isALNUM_utf8((U8*)e)) || *e == ':')) {
e += UTF8SKIP(e);
- while (e < send && *e & 0x80 && is_utf8_mark(e))
+ while (e < send && *e & 0x80 && is_utf8_mark((U8*)e))
e += UTF8SKIP(e);
}
Copy(s, d, e - s, char);
/* Unicode support */
-char *
-uv_to_utf8(unsigned char *d, UV uv)
+U8 *
+uv_to_utf8(U8 *d, UV uv)
{
if (uv < 0x80) {
*d++ = uv;
}
UV
-utf8_to_uv(unsigned char* s, I32* retlen)
+utf8_to_uv(U8* s, I32* retlen)
{
UV uv = *s;
int len;
/* utf8_distance(a,b) is intended to be a - b in pointer arithmetic */
I32
-utf8_distance(unsigned char *a, unsigned char *b)
+utf8_distance(U8 *a, U8 *b)
{
I32 off = 0;
if (a < b) {
/* WARNING: do not use the following unless you *know* off is within bounds */
U8 *
-utf8_hop(unsigned char *s, I32 off)
+utf8_hop(U8 *s, I32 off)
{
if (off >= 0) {
while (off--)
bool
is_uni_alnum(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_alnum(tmpbuf);
}
bool
is_uni_idfirst(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_idfirst(tmpbuf);
}
bool
is_uni_alpha(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_alpha(tmpbuf);
}
bool
is_uni_space(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_space(tmpbuf);
}
bool
is_uni_digit(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_digit(tmpbuf);
}
bool
is_uni_upper(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_upper(tmpbuf);
}
bool
is_uni_lower(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_lower(tmpbuf);
}
bool
is_uni_print(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return is_utf8_print(tmpbuf);
}
U32
to_uni_upper(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return to_utf8_upper(tmpbuf);
}
U32
to_uni_title(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return to_utf8_title(tmpbuf);
}
U32
to_uni_lower(U32 c)
{
- char tmpbuf[10];
+ U8 tmpbuf[10];
uv_to_utf8(tmpbuf, (UV)c);
return to_utf8_lower(tmpbuf);
}
bool
-is_utf8_alnum(unsigned char *p)
+is_utf8_alnum(U8 *p)
{
if (!PL_utf8_alnum)
PL_utf8_alnum = swash_init("utf8", "IsAlnum", &sv_undef, 0, 0);
}
bool
-is_utf8_idfirst(unsigned char *p)
+is_utf8_idfirst(U8 *p)
{
return *p == '_' || is_utf8_alpha(p);
}
bool
-is_utf8_alpha(unsigned char *p)
+is_utf8_alpha(U8 *p)
{
if (!PL_utf8_alpha)
PL_utf8_alpha = swash_init("utf8", "IsAlpha", &sv_undef, 0, 0);
}
bool
-is_utf8_space(unsigned char *p)
+is_utf8_space(U8 *p)
{
if (!PL_utf8_space)
PL_utf8_space = swash_init("utf8", "IsSpace", &sv_undef, 0, 0);
}
bool
-is_utf8_digit(unsigned char *p)
+is_utf8_digit(U8 *p)
{
if (!PL_utf8_digit)
PL_utf8_digit = swash_init("utf8", "IsDigit", &sv_undef, 0, 0);
}
bool
-is_utf8_upper(unsigned char *p)
+is_utf8_upper(U8 *p)
{
if (!PL_utf8_upper)
PL_utf8_upper = swash_init("utf8", "IsUpper", &sv_undef, 0, 0);
}
bool
-is_utf8_lower(unsigned char *p)
+is_utf8_lower(U8 *p)
{
if (!PL_utf8_lower)
PL_utf8_lower = swash_init("utf8", "IsLower", &sv_undef, 0, 0);
}
bool
-is_utf8_print(unsigned char *p)
+is_utf8_print(U8 *p)
{
if (!PL_utf8_print)
PL_utf8_print = swash_init("utf8", "IsPrint", &sv_undef, 0, 0);
}
bool
-is_utf8_mark(unsigned char *p)
+is_utf8_mark(U8 *p)
{
if (!PL_utf8_mark)
PL_utf8_mark = swash_init("utf8", "IsM", &sv_undef, 0, 0);
}
U32
-to_utf8_upper(unsigned char *p)
+to_utf8_upper(U8 *p)
{
UV uv;
}
U32
-to_utf8_title(unsigned char *p)
+to_utf8_title(U8 *p)
{
UV uv;
}
U32
-to_utf8_lower(unsigned char *p)
+to_utf8_lower(U8 *p)
{
UV uv;
}
UV
-swash_fetch(SV *sv, unsigned char *ptr)
+swash_fetch(SV *sv, U8 *ptr)
{
HV* hv = (HV*)SvRV(sv);
U32 klen = UTF8SKIP(ptr) - 1;
U32 off = ptr[klen] & 127; /* NB: 64 bit always 0 when len > 1 */
STRLEN slen;
STRLEN needents = (klen ? 64 : 128);
- unsigned char *tmps;
+ U8 *tmps;
U32 bit;
SV *retval;
}
else {
/* Try our second-level swatch cache, kept in a hash. */
- SV** svp = hv_fetch(hv, ptr, klen, FALSE);
+ SV** svp = hv_fetch(hv, (char*)ptr, klen, FALSE);
/* If not cached, generate it via utf8::SWASHGET */
- if (!svp || !SvPOK(*svp) || !(tmps = SvPV(*svp, slen))) {
+ if (!svp || !SvPOK(*svp) || !(tmps = (U8*)SvPV(*svp, slen))) {
dSP;
ENTER;
SAVETMPS;
if (curcop == &compiling)
curcop->op_private = PL_hints;
- svp = hv_store(hv, ptr, klen, retval, 0);
+ svp = hv_store(hv, (char*)ptr, klen, retval, 0);
- if (!svp || !(tmps = SvPV(*svp, slen)) || slen < 8)
+ if (!svp || !(tmps = (U8*)SvPV(*svp, slen)) || slen < 8)
croak("SWASHGET didn't return result of proper length");
}
@args = split(',', $args);
if ($args[$#args] =~ /\s*\.\.\.\s*/) {
if(($name eq "croak") or ($name eq "deb") or ($name eq "die")
- or ($name eq "form") or ($name eq "warn")) {
+ or ($name eq "form") or ($name eq "warn")
+ or ($name eq "warner")) {
print OUTFILE "\n#ifdef $name" . "_defined" unless ($separateObj == 0);
- $args[0] =~ /(\w+)\W*$/;
- $arg = $1;
+ for (@args) { $_ = $1 if /(\w+)\W*$/; }
+ $arg = $args[$#args-1];
+ my $start = '';
+ $start = join(', ',@args[0 .. ($#args - 2)]) if @args > 2;
+ $start .= ', ' if $start;
print OUTFILE <<ENDCODE;
#undef $name
pmsg = pPerl->Perl_mess($arg, &args);
New(0, pstr, strlen(pmsg)+1, char);
strcpy(pstr, pmsg);
-$return pPerl->Perl_$name(pstr);
+$return pPerl->Perl_$name($start pstr);
va_end(args);
}
ENDCODE
..\unixish.h \
..\utf8.h \
..\util.h \
+ ..\warning.h \
..\XSUB.h \
..\EXTERN.h \
..\perlvars.h \
LINK_DBG =
.ENDIF
-CFLAGS = -K -w -d -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
+CFLAGS = -w -g0 -d -tWM -tWD $(INCLUDES) $(DEFINES) $(LOCDEFS) \
$(PCHFLAGS) $(OPTIMIZE)
LINK_FLAGS = $(LINK_DBG) -L$(CCLIBDIR) $(EXTRALIBDIRS:^"-L")
OBJOUT_FLAG = -o
..\unixish.h \
..\utf8.h \
..\util.h \
+ ..\warning.h \
..\XSUB.h \
..\EXTERN.h \
..\perlvars.h \