diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-10 07:02:38 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-08-10 07:02:38 +0000 |
commit | dfe13c55d349c8cc782995becdedd62551082672 (patch) | |
tree | c0554f0cd4de1bffa629f662539d3b0654f8b3f4 | |
parent | 2aea9f8a7ec940891eef705f344a93a3b76154a2 (diff) | |
download | perl-dfe13c55d349c8cc782995becdedd62551082672.tar.gz |
various tweaks: fix signed vs. unsigned problems that prevented C++
builds; add sundry PERL_OBJECT scaffolding to get it to build; fix
lexical warning testsuite for win32
p4raw-id: //depot/perl@1777
-rw-r--r-- | Changes | 5 | ||||
-rw-r--r-- | doop.c | 11 | ||||
-rw-r--r-- | embed.h | 4 | ||||
-rw-r--r-- | global.sym | 3 | ||||
-rw-r--r-- | objXSUB.h | 100 | ||||
-rw-r--r-- | objpp.h | 111 | ||||
-rw-r--r-- | op.c | 10 | ||||
-rw-r--r-- | pod/perlhist.pod | 2 | ||||
-rw-r--r-- | pp.c | 51 | ||||
-rw-r--r-- | pp_hot.c | 12 | ||||
-rw-r--r-- | proto.h | 39 | ||||
-rw-r--r-- | regcomp.c | 32 | ||||
-rw-r--r-- | regexec.c | 168 | ||||
-rw-r--r-- | sv.c | 26 | ||||
-rw-r--r-- | t/pragma/warn-doio | 4 | ||||
-rw-r--r-- | t/pragma/warn-mg | 3 | ||||
-rw-r--r-- | t/pragma/warn-op | 14 | ||||
-rw-r--r-- | t/pragma/warn-regexec | 8 | ||||
-rw-r--r-- | toke.c | 41 | ||||
-rw-r--r-- | utf8.c | 68 | ||||
-rw-r--r-- | win32/GenCAPI.pl | 12 | ||||
-rw-r--r-- | win32/Makefile | 1 | ||||
-rw-r--r-- | win32/makefile.mk | 3 |
23 files changed, 503 insertions, 225 deletions
@@ -78,6 +78,11 @@ Version 5.005_51 Development release working toward 5.006 ---------------- ____________________________________________________________________________ +[ 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 @@ -42,7 +42,6 @@ do_trans(SV *sv, OP *arg) 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; @@ -155,7 +154,7 @@ do_trans(SV *sv, OP *arg) } else { while (s < send) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, *s); /* XXX suboptimal */ if (swash_fetch(rv, tmpbuf) < none) matches++; @@ -175,7 +174,7 @@ do_trans(SV *sv, OP *arg) 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; @@ -184,7 +183,7 @@ do_trans(SV *sv, OP *arg) 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); } @@ -233,7 +232,7 @@ do_trans(SV *sv, OP *arg) 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); } @@ -272,7 +271,7 @@ do_trans(SV *sv, OP *arg) s += UTF8SKIP(s); } } - sv_usepvn_mg(sv, dst, d - dst); + sv_usepvn_mg(sv, (char*)dst, d - dst); } return matches; } @@ -897,6 +897,7 @@ #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 @@ -998,6 +999,8 @@ #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 @@ -1101,6 +1104,7 @@ #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 diff --git a/global.sym b/global.sym index 6bce314b95..09667da410 100644 --- a/global.sym +++ b/global.sym @@ -952,6 +952,7 @@ save_long save_nogv save_op save_pptr +save_re_context save_scalar save_sptr save_svref @@ -1031,6 +1032,8 @@ sv_isobject sv_iv sv_len sv_len_utf8 +sv_pos_u2b +sv_pos_b2u sv_magic sv_mortalcopy sv_newmortal @@ -1076,6 +1076,58 @@ #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 @@ -1601,6 +1653,8 @@ #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 @@ -1741,6 +1795,12 @@ #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 @@ -1811,12 +1871,36 @@ #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 @@ -1831,6 +1915,20 @@ #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 @@ -1839,6 +1937,8 @@ #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 @@ -515,6 +515,57 @@ #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 @@ -1001,18 +1052,28 @@ #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 @@ -1135,6 +1196,8 @@ #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 @@ -1305,6 +1368,12 @@ #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 @@ -1397,6 +1466,10 @@ #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 @@ -1405,6 +1478,26 @@ #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 @@ -1421,6 +1514,22 @@ #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 @@ -1433,6 +1542,8 @@ #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 @@ -2133,11 +2133,11 @@ pmtrans(OP *o, OP *expr, OP *repl) 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) @@ -2146,11 +2146,11 @@ pmtrans(OP *o, OP *expr, OP *repl) 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; } diff --git a/pod/perlhist.pod b/pod/perlhist.pod index 2db0777c71..95a354fd51 100644 --- a/pod/perlhist.pod +++ b/pod/perlhist.pod @@ -302,7 +302,7 @@ the strings?). 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 @@ -2098,7 +2098,7 @@ PP(pp_ord) { djSP; dTARGET; I32 value; - char *tmps = POPp; + U8 *tmps = (U8*)POPp; I32 retlen; if (IN_UTF8 && (*tmps & 0x80)) @@ -2120,7 +2120,7 @@ PP(pp_chr) 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); @@ -2163,7 +2163,7 @@ PP(pp_ucfirst) 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; @@ -2181,12 +2181,12 @@ PP(pp_ucfirst) 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; @@ -2198,7 +2198,7 @@ PP(pp_ucfirst) 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; @@ -2219,7 +2219,7 @@ PP(pp_lcfirst) 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; @@ -2237,12 +2237,12 @@ PP(pp_lcfirst) 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; @@ -2254,7 +2254,7 @@ PP(pp_lcfirst) 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; @@ -2282,7 +2282,7 @@ PP(pp_uc) register U8 *d; U8 *send; - s = SvPV(sv,len); + s = (U8*)SvPV(sv,len); if (!len) { sv_setpvn(TARG, "", 0); SETs(TARG); @@ -2292,7 +2292,7 @@ PP(pp_uc) (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; @@ -2321,7 +2321,7 @@ PP(pp_uc) SETs(sv); } - s = SvPV_force(sv, len); + s = (U8*)SvPV_force(sv, len); if (len) { register U8 *send = s + len; @@ -2352,7 +2352,7 @@ PP(pp_lc) register U8 *d; U8 *send; - s = SvPV(sv,len); + s = (U8*)SvPV(sv,len); if (!len) { sv_setpvn(TARG, "", 0); SETs(TARG); @@ -2362,7 +2362,7 @@ PP(pp_lc) (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; @@ -2391,7 +2391,7 @@ PP(pp_lc) SETs(sv); } - s = SvPV_force(sv, len); + s = (U8*)SvPV_force(sv, len); if (len) { register U8 *send = s + len; @@ -3043,17 +3043,17 @@ PP(pp_reverse) 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; @@ -3395,7 +3395,7 @@ PP(pp_unpack) 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; } @@ -3404,7 +3404,7 @@ PP(pp_unpack) 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); @@ -4213,7 +4213,8 @@ PP(pp_pack) 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; @@ -888,7 +888,7 @@ play_it_again: 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; @@ -904,7 +904,7 @@ play_it_again: 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; @@ -913,7 +913,7 @@ play_it_again: 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))) @@ -1637,7 +1637,7 @@ PP(pp_subst) 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; } @@ -1647,7 +1647,7 @@ PP(pp_subst) 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; @@ -1656,7 +1656,7 @@ PP(pp_subst) 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))) @@ -225,15 +225,15 @@ VIRTUAL bool is_uni_print_lc _((U32 c)); 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)); @@ -637,12 +637,12 @@ VIRTUAL void sv_vsetpvfn _((SV* sv, const char* pat, STRLEN patlen, 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 @@ -654,10 +654,10 @@ VIRTUAL void unshare_hek _((HEK* hek)); 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)); @@ -835,7 +835,9 @@ regnode *reganode _((U8, U32)); 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 *)); @@ -855,8 +857,11 @@ I32 regrepeat _((regnode *p, I32 max)); 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)); @@ -1707,7 +1707,7 @@ tryagain: *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( @@ -1717,7 +1717,7 @@ tryagain: *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( @@ -1727,7 +1727,7 @@ tryagain: *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++; @@ -1738,7 +1738,7 @@ tryagain: *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++; @@ -1749,7 +1749,7 @@ tryagain: *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( @@ -1759,7 +1759,7 @@ tryagain: *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( @@ -1769,21 +1769,21 @@ tryagain: *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': @@ -1981,7 +1981,7 @@ tryagain: default: normal_default: if ((*p & 0xc0) == 0xc0 && UTF) { - ender = utf8_to_uv(p, &numlen); + ender = utf8_to_uv((U8*)p, &numlen); p += numlen; } else @@ -2297,7 +2297,7 @@ regclassutf8(void) 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 && @@ -2327,7 +2327,7 @@ regclassutf8(void) } 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': @@ -2357,7 +2357,7 @@ regclassutf8(void) flags |= ANYOF_SPACEL; sv_catpvf(listsv, "+utf8::IsSpace\n"); if (!PL_utf8_space) - is_utf8_space(" "); + is_utf8_space((U8*)" "); } lastvalue = 123456; continue; @@ -2368,7 +2368,7 @@ regclassutf8(void) sv_catpvf(listsv, "!utf8::IsSpace\n"); if (!PL_utf8_space) - is_utf8_space(" "); + is_utf8_space((U8*)" "); } lastvalue = 123456; continue; @@ -2575,11 +2575,11 @@ reguni(UV uv, char* s, I32* lenp) { 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; } @@ -113,10 +113,16 @@ static char * regcppop _((void)); #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) @@ -324,7 +330,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, } 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 ) ) @@ -367,7 +373,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, { 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--; @@ -420,11 +426,11 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 */ @@ -432,21 +438,21 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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) { @@ -472,7 +478,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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)) { @@ -531,12 +537,15 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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; @@ -572,12 +581,14 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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; @@ -601,7 +612,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -629,7 +640,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -655,7 +666,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -683,7 +694,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -709,7 +720,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -737,7 +748,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -763,7 +774,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -791,7 +802,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -817,7 +828,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -843,7 +854,7 @@ regexec_flags(register regexp *prog, char *stringarg, register char *strend, 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 @@ -1188,8 +1199,12 @@ regmatch(regnode *prog) 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); } @@ -1250,8 +1265,11 @@ regmatch(regnode *prog) 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; @@ -1280,8 +1298,11 @@ regmatch(regnode *prog) 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; @@ -1317,14 +1338,15 @@ regmatch(regnode *prog) 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; @@ -1348,8 +1370,11 @@ regmatch(regnode *prog) 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; @@ -1378,8 +1403,11 @@ regmatch(regnode *prog) 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; @@ -1396,7 +1424,7 @@ regmatch(regnode *prog) 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); @@ -1417,7 +1445,7 @@ regmatch(regnode *prog) 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); @@ -1428,10 +1456,10 @@ regmatch(regnode *prog) 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; @@ -1461,7 +1489,7 @@ regmatch(regnode *prog) 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); @@ -1471,7 +1499,7 @@ regmatch(regnode *prog) 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); @@ -1847,7 +1875,7 @@ regmatch(regnode *prog) { if (paren) { if (n) { - PL_regstartp[paren] = HOP(PL_reginput, -l); + PL_regstartp[paren] = HOPc(PL_reginput, -l); PL_regendp[paren] = PL_reginput; } else @@ -1908,7 +1936,7 @@ regmatch(regnode *prog) ); if (paren) { if (n) { - PL_regstartp[paren] = HOP(PL_reginput, -l); + PL_regstartp[paren] = HOPc(PL_reginput, -l); PL_regendp[paren] = PL_reginput; } else @@ -1920,7 +1948,7 @@ regmatch(regnode *prog) } /* Couldn't or didn't -- back up. */ n--; - locinput = HOP(locinput, -l); + locinput = HOPc(locinput, -l); PL_reginput = locinput; } } @@ -1986,7 +2014,7 @@ regmatch(regnode *prog) { if (paren) { if (n) { - PL_regstartp[paren] = HOP(PL_reginput, -1); + PL_regstartp[paren] = HOPc(PL_reginput, -1); PL_regendp[paren] = PL_reginput; } else @@ -2023,7 +2051,7 @@ regmatch(regnode *prog) { 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 @@ -2035,7 +2063,7 @@ regmatch(regnode *prog) } /* Couldn't or didn't -- back up. */ n--; - PL_reginput = locinput = HOP(locinput, -1); + PL_reginput = locinput = HOPc(locinput, -1); } } else { @@ -2051,7 +2079,7 @@ regmatch(regnode *prog) } /* Couldn't or didn't -- back up. */ n--; - PL_reginput = locinput = HOP(locinput, -1); + PL_reginput = locinput = HOPc(locinput, -1); } } } @@ -2070,7 +2098,7 @@ regmatch(regnode *prog) 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; @@ -2081,7 +2109,7 @@ regmatch(regnode *prog) 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; @@ -2225,7 +2253,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2238,7 +2266,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2250,7 +2278,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2263,7 +2291,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2274,7 +2302,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2287,7 +2315,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2298,7 +2326,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2311,7 +2339,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2322,7 +2350,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2334,7 +2362,7 @@ regrepeat(regnode *p, I32 max) 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++; } @@ -2468,7 +2496,7 @@ reginclassutf8(regnode *f, U8 *p) 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)); @@ -2494,8 +2522,8 @@ reginclassutf8(regnode *f, U8 *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) { @@ -2516,8 +2544,8 @@ reghop(unsigned char *s, I32 off) return s; } -STATIC char * -reghopmaybe(unsigned char *s, I32 off) +STATIC U8 * +reghopmaybe(U8* s, I32 off) { dTHR; if (off >= 0) { @@ -3082,8 +3082,8 @@ sv_len(register SV *sv) STRLEN sv_len_utf8(register SV *sv) { - unsigned char *s; - unsigned char *send; + U8 *s; + U8 *send; STRLEN len; if (!sv) @@ -3094,7 +3094,7 @@ sv_len_utf8(register SV *sv) len = mg_length(sv); else #endif - s = SvPV(sv, len); + s = (U8*)SvPV(sv, len); send = s + len; len = 0; while (s < send) { @@ -3107,16 +3107,16 @@ sv_len_utf8(register SV *sv) 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); @@ -3134,14 +3134,14 @@ sv_pos_u2b(register SV *sv, I32* offsetp, I32* lenp) 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; @@ -4529,7 +4529,7 @@ sv_vcatpvfn(SV *sv, const char *pat, STRLEN patlen, va_list *args, SV **svargs, STRLEN precis = 0; char esignbuf[4]; - char utf8buf[10]; + U8 utf8buf[10]; STRLEN esignlen = 0; char *eptr = Nullch; @@ -4664,8 +4664,8 @@ sv_vcatpvfn(SV *sv, const char *pat, STRLEN patlen, va_list *args, SV **svargs, 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) diff --git a/t/pragma/warn-doio b/t/pragma/warn-doio index 0efa4c662c..af14f42272 100644 --- a/t/pragma/warn-doio +++ b/t/pragma/warn-doio @@ -38,7 +38,7 @@ __END__ # doio.c use warning 'io' ; -open(F, "|true|") +open(F, "|$^X -e 1|") EXPECT Can't do bidirectional pipe at - line 3. ######## @@ -83,7 +83,7 @@ Unsuccessful stat on filename containing newline at - line 4. ######## # doio.c use warning 'io' ; -exec "lskdjfalksdjfdjfkls" ; +exec "lskdjfalksdjfdjfkls","" ; EXPECT Can't exec "lskdjfalksdjfdjfkls": No such file or directory at - line 3. ######## diff --git a/t/pragma/warn-mg b/t/pragma/warn-mg index f414cb3e80..44e7634952 100644 --- a/t/pragma/warn-mg +++ b/t/pragma/warn-mg @@ -16,6 +16,9 @@ No such signal: SIGFRED 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 diff --git a/t/pragma/warn-op b/t/pragma/warn-op index 8ca6a5fd1f..d0886edf58 100644 --- a/t/pragma/warn-op +++ b/t/pragma/warn-op @@ -185,10 +185,10 @@ readlink 1; # OP_READLINK 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. @@ -361,6 +361,10 @@ getprotoent ; # OP_GPROTOENT 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. @@ -528,7 +532,7 @@ Hash %FRED missing the % in argument 1 of keys() at - line 3. ######## # op.c use warning 'syntax' ; -exec "true" ; +exec "$^X -e 1" ; my $a EXPECT Statement unlikely to be reached at - line 4. diff --git a/t/pragma/warn-regexec b/t/pragma/warn-regexec index 5ca776f9c1..158a7538ae 100644 --- a/t/pragma/warn-regexec +++ b/t/pragma/warn-regexec @@ -10,6 +10,8 @@ __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)*$/ ; # @@ -28,10 +30,12 @@ $_ = 'a' x (2**15+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)*?$/ ; # @@ -50,4 +54,4 @@ $_ = 'a' x (2**15+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. @@ -235,16 +235,18 @@ win32_textfilter(int idx, SV *sv, int maxlen) } #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; @@ -255,16 +257,18 @@ utf16rev_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_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) { @@ -985,7 +989,7 @@ scan_const(char *start) 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++; @@ -1059,7 +1063,8 @@ scan_const(char *start) "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; } @@ -1068,7 +1073,7 @@ scan_const(char *start) 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) { @@ -1836,7 +1841,7 @@ yylex(void) * 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); @@ -4963,9 +4968,9 @@ scan_word(register char *s, char *dest, STRLEN destlen, int allow_package, STRLE *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); @@ -5017,9 +5022,9 @@ scan_ident(register char *s, register char *send, char *dest, STRLEN destlen, I3 *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); @@ -5069,13 +5074,13 @@ scan_ident(register char *s, register char *send, char *dest, STRLEN destlen, I3 } } } - 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); @@ -25,8 +25,8 @@ /* Unicode support */ -char * -uv_to_utf8(unsigned char *d, UV uv) +U8 * +uv_to_utf8(U8 *d, UV uv) { if (uv < 0x80) { *d++ = uv; @@ -96,7 +96,7 @@ uv_to_utf8(unsigned char *d, UV uv) } UV -utf8_to_uv(unsigned char* s, I32* retlen) +utf8_to_uv(U8* s, I32* retlen) { UV uv = *s; int len; @@ -140,7 +140,7 @@ utf8_to_uv(unsigned char* s, I32* retlen) /* 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) { @@ -161,7 +161,7 @@ utf8_distance(unsigned char *a, unsigned char *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--) @@ -248,7 +248,7 @@ utf16_to_utf8_reversed(U16* p, U8* d, I32 bytelen) bool is_uni_alnum(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_alnum(tmpbuf); } @@ -256,7 +256,7 @@ is_uni_alnum(U32 c) bool is_uni_idfirst(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_idfirst(tmpbuf); } @@ -264,7 +264,7 @@ is_uni_idfirst(U32 c) bool is_uni_alpha(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_alpha(tmpbuf); } @@ -272,7 +272,7 @@ is_uni_alpha(U32 c) bool is_uni_space(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_space(tmpbuf); } @@ -280,7 +280,7 @@ is_uni_space(U32 c) bool is_uni_digit(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_digit(tmpbuf); } @@ -288,7 +288,7 @@ is_uni_digit(U32 c) bool is_uni_upper(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_upper(tmpbuf); } @@ -296,7 +296,7 @@ is_uni_upper(U32 c) bool is_uni_lower(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_lower(tmpbuf); } @@ -304,7 +304,7 @@ is_uni_lower(U32 c) bool is_uni_print(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return is_utf8_print(tmpbuf); } @@ -312,7 +312,7 @@ is_uni_print(U32 c) U32 to_uni_upper(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return to_utf8_upper(tmpbuf); } @@ -320,7 +320,7 @@ to_uni_upper(U32 c) U32 to_uni_title(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return to_utf8_title(tmpbuf); } @@ -328,7 +328,7 @@ to_uni_title(U32 c) U32 to_uni_lower(U32 c) { - char tmpbuf[10]; + U8 tmpbuf[10]; uv_to_utf8(tmpbuf, (UV)c); return to_utf8_lower(tmpbuf); } @@ -403,7 +403,7 @@ to_uni_lower_lc(U32 c) 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); @@ -418,13 +418,13 @@ is_utf8_alnum(unsigned char *p) } 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); @@ -432,7 +432,7 @@ is_utf8_alpha(unsigned char *p) } 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); @@ -440,7 +440,7 @@ is_utf8_space(unsigned char *p) } 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); @@ -448,7 +448,7 @@ is_utf8_digit(unsigned char *p) } 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); @@ -456,7 +456,7 @@ is_utf8_upper(unsigned char *p) } 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); @@ -464,7 +464,7 @@ is_utf8_lower(unsigned char *p) } 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); @@ -472,7 +472,7 @@ is_utf8_print(unsigned char *p) } 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); @@ -480,7 +480,7 @@ is_utf8_mark(unsigned char *p) } U32 -to_utf8_upper(unsigned char *p) +to_utf8_upper(U8 *p) { UV uv; @@ -491,7 +491,7 @@ to_utf8_upper(unsigned char *p) } U32 -to_utf8_title(unsigned char *p) +to_utf8_title(U8 *p) { UV uv; @@ -502,7 +502,7 @@ to_utf8_title(unsigned char *p) } U32 -to_utf8_lower(unsigned char *p) +to_utf8_lower(U8 *p) { UV uv; @@ -551,14 +551,14 @@ swash_init(char* pkg, char* name, SV *listsv, I32 minbits, I32 none) } 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; @@ -580,10 +580,10 @@ swash_fetch(SV *sv, unsigned char *ptr) } 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; @@ -605,9 +605,9 @@ swash_fetch(SV *sv, unsigned char *ptr) 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"); } diff --git a/win32/GenCAPI.pl b/win32/GenCAPI.pl index 33ffe9446d..4c3947fec5 100644 --- a/win32/GenCAPI.pl +++ b/win32/GenCAPI.pl @@ -141,10 +141,14 @@ while () { @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 @@ -157,7 +161,7 @@ extern "C" $type $funcName ($args) 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 diff --git a/win32/Makefile b/win32/Makefile index 07e62c4d40..e00611d5f8 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -431,6 +431,7 @@ CORE_NOCFG_H = \ ..\unixish.h \ ..\utf8.h \ ..\util.h \ + ..\warning.h \ ..\XSUB.h \ ..\EXTERN.h \ ..\perlvars.h \ diff --git a/win32/makefile.mk b/win32/makefile.mk index 62373d0515..a786a61c05 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -199,7 +199,7 @@ OPTIMIZE = -O2 $(RUNTIME) 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 @@ -548,6 +548,7 @@ CORE_NOCFG_H = \ ..\unixish.h \ ..\utf8.h \ ..\util.h \ + ..\warning.h \ ..\XSUB.h \ ..\EXTERN.h \ ..\perlvars.h \ |