From: Jarkko Hietaniemi Date: Fri, 13 Jul 2001 03:36:22 +0000 (+0000) Subject: Remove unicode::distinct, as per Inaba Hiroto. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=77caf834c201d3982a815b3d51794b6e3a769c6d;p=p5sagit%2Fp5-mst-13.2.git Remove unicode::distinct, as per Inaba Hiroto. p4raw-id: //depot/perl@11342 --- diff --git a/MANIFEST b/MANIFEST index 7e291a8..28d6255 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1179,7 +1179,6 @@ lib/unicode/Category.pl Unicode character database lib/unicode/CombiningClass.pl Unicode character database lib/unicode/CompExcl.txt Unicode character database lib/unicode/Decomposition.pl Unicode character database -lib/unicode/distinct.pm Perl pragma to strictly distinguish UTF8 data and non-UTF data lib/unicode/EAWidth.txt Unicode character database lib/unicode/In.pl Unicode character database lib/unicode/In/0.pl Unicode character database diff --git a/hv.c b/hv.c index 76180f2..a08720e 100644 --- a/hv.c +++ b/hv.c @@ -199,7 +199,7 @@ Perl_hv_fetch(pTHX_ HV *hv, const char *key, I32 klen, I32 lval) return 0; } - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) { + if (is_utf8) { STRLEN tmplen = klen; /* Just casting the &klen to (STRLEN) won't work well * if STRLEN and I32 are of different widths. --jhi */ @@ -333,7 +333,7 @@ Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash) keysave = key = SvPV(keysv, klen); is_utf8 = (SvUTF8(keysv)!=0); - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) + if (is_utf8) key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8); if (!hash) @@ -447,7 +447,7 @@ Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen, SV *val, register U32 has #endif } } - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) { + if (is_utf8) { STRLEN tmplen = klen; /* See the note in hv_fetch(). --jhi */ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8); @@ -565,7 +565,7 @@ Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, register U32 hash) keysave = key = SvPV(keysv, klen); is_utf8 = (SvUTF8(keysv) != 0); - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) + if (is_utf8) key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8); if (!hash) @@ -675,7 +675,7 @@ Perl_hv_delete(pTHX_ HV *hv, const char *key, I32 klen, I32 flags) if (!xhv->xhv_array /* !HvARRAY(hv) */) return Nullsv; - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) { + if (is_utf8) { STRLEN tmplen = klen; /* See the note in hv_fetch(). --jhi */ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8); @@ -779,7 +779,7 @@ Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash) keysave = key = SvPV(keysv, klen); is_utf8 = (SvUTF8(keysv) != 0); - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) + if (is_utf8) key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8); if (!hash) @@ -869,7 +869,7 @@ Perl_hv_exists(pTHX_ HV *hv, const char *key, I32 klen) return 0; #endif - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) { + if (is_utf8) { STRLEN tmplen = klen; /* See the note in hv_fetch(). --jhi */ key = (char*)bytes_from_utf8((U8*)key, &tmplen, &is_utf8); @@ -966,7 +966,7 @@ Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash) keysave = key = SvPV(keysv, klen); is_utf8 = (SvUTF8(keysv) != 0); - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) + if (is_utf8) key = (char*)bytes_from_utf8((U8*)key, &klen, &is_utf8); if (!hash) PERL_HASH(hash, key, klen); @@ -1584,14 +1584,11 @@ Perl_unsharepvn(pTHX_ const char *str, I32 len, U32 hash) const char *save = str; if (len < 0) { - len = -len; + STRLEN tmplen = -len; is_utf8 = TRUE; - if (!(PL_hints & HINT_UTF8_DISTINCT)) { - STRLEN tmplen = len; - /* See the note in hv_fetch(). --jhi */ - str = (char*)bytes_from_utf8((U8*)str, &tmplen, &is_utf8); - len = tmplen; - } + /* See the note in hv_fetch(). --jhi */ + str = (char*)bytes_from_utf8((U8*)str, &tmplen, &is_utf8); + len = tmplen; } /* what follows is the moral equivalent of: @@ -1647,14 +1644,11 @@ Perl_share_hek(pTHX_ const char *str, I32 len, register U32 hash) const char *save = str; if (len < 0) { - len = -len; + STRLEN tmplen = -len; is_utf8 = TRUE; - if (!(PL_hints & HINT_UTF8_DISTINCT)) { - STRLEN tmplen = len; - /* See the note in hv_fetch(). --jhi */ - str = (char*)bytes_from_utf8((U8*)str, &tmplen, &is_utf8); - len = tmplen; - } + /* See the note in hv_fetch(). --jhi */ + str = (char*)bytes_from_utf8((U8*)str, &tmplen, &is_utf8); + len = tmplen; } /* what follows is the moral equivalent of: diff --git a/lib/unicode/distinct.pm b/lib/unicode/distinct.pm deleted file mode 100644 index 74f791f..0000000 --- a/lib/unicode/distinct.pm +++ /dev/null @@ -1,35 +0,0 @@ -package unicode::distinct; - -our $VERSION = '0.01'; - -$unicode::distinct::hint_bits = 0x01000000; - -sub import { - $^H |= $unicode::distinct::hint_bits; -} - -sub unimport { - $^H &= ~$unicode::distinct::hint_bits; -} - -1; -__END__ - -=head1 NAME - -unicode::distinct - Perl pragma to strictly distinguish UTF8 data and non-UTF data. - -=head1 SYNOPSIS - - use unicode::distinct; - no unicode::distinct; - -=head1 DESCRIPTION - - *NOT YET* - -=head1 SEE ALSO - -L, L - -=cut diff --git a/perl.h b/perl.h index b4b1a4f..9041aa0 100644 --- a/perl.h +++ b/perl.h @@ -2962,7 +2962,6 @@ enum { /* pass one of these to get_vtbl */ #define HINT_FILETEST_ACCESS 0x00400000 #define HINT_UTF8 0x00800000 -#define HINT_UTF8_DISTINCT 0x01000000 /* Various states of an input record separator SV (rs, nrs) */ #define RsSNARF(sv) (! SvOK(sv)) diff --git a/pod/perlmodlib.pod b/pod/perlmodlib.pod index adc14cd..565c0d1 100644 --- a/pod/perlmodlib.pod +++ b/pod/perlmodlib.pod @@ -132,10 +132,6 @@ Restrict unsafe constructs Predeclare sub names -=item unicode::distinct - -Strictly distinguish UTF8 data and non-UTF data. - =item utf8 Enable/disable UTF-8 (or UTF-EBCDIC) in source code @@ -894,6 +890,26 @@ Expand and unexpand tabs per the unix expand(1) and unexpand(1) Line wrapping to form simple paragraphs +=item Thread + +Manipulate threads in Perl (EXPERIMENTAL, subject to change) + +=item Thread::Queue + +Thread-safe queues + +=item Thread::Semaphore + +Thread-safe semaphores + +=item Thread::Signal + +Start a thread which runs signal handlers reliably + +=item Thread::Specific + +Thread-specific keys + =item Tie::Array Base class for tied arrays diff --git a/pod/perltoc.pod b/pod/perltoc.pod index f1083fa..c906397 100644 --- a/pod/perltoc.pod +++ b/pod/perltoc.pod @@ -7307,19 +7307,6 @@ C, C, C =back -=head2 unicode::distinct - Perl pragma to strictly distinguish UTF8 data -and non-UTF data. - -=over 4 - -=item SYNOPSIS - -=item DESCRIPTION - -=item SEE ALSO - -=back - =head2 utf8 - Perl pragma to enable/disable UTF-8 (or UTF-EBCDIC) in source code @@ -8754,32 +8741,32 @@ C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, -C, C, C, C, -C, C, C, C, -C, C, -C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, C, -C, C, C, C, -C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, C, C, +C, C, C, +C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, +C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, diff --git a/sv.c b/sv.c index 12a5b87..d8929df 100644 --- a/sv.c +++ b/sv.c @@ -5274,8 +5274,6 @@ Perl_sv_eq(pTHX_ register SV *sv1, register SV *sv2) if (cur1 && cur2 && SvUTF8(sv1) != SvUTF8(sv2) && !IN_BYTES) { bool is_utf8 = TRUE; /* UTF-8ness differs */ - if (PL_hints & HINT_UTF8_DISTINCT) - return FALSE; if (SvUTF8(sv1)) { /* sv1 is the UTF-8 one , If is equal it must be downgrade-able */ @@ -5340,9 +5338,6 @@ Perl_sv_cmp(pTHX_ register SV *sv1, register SV *sv2) /* do not utf8ize the comparands as a side-effect */ if (cur1 && cur2 && SvUTF8(sv1) != SvUTF8(sv2) && !IN_BYTES) { - if (PL_hints & HINT_UTF8_DISTINCT) - return SvUTF8(sv1) ? 1 : -1; - if (SvUTF8(sv1)) { pv2 = (char*)bytes_to_utf8((U8*)pv2, &cur2); pv2tmp = TRUE; @@ -6189,11 +6184,8 @@ Perl_newSVpvn_share(pTHX_ const char *src, I32 len, U32 hash) register SV *sv; bool is_utf8 = FALSE; if (len < 0) { - len = -len; + STRLEN tmplen = -len; is_utf8 = TRUE; - } - if (is_utf8 && !(PL_hints & HINT_UTF8_DISTINCT)) { - STRLEN tmplen = len; /* See the note in hv.c:hv_fetch() --jhi */ src = (char*)bytes_from_utf8((U8*)src, &tmplen, &is_utf8); len = tmplen; diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index 2ebfb98..81c6f41 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -80,7 +80,6 @@ unless (has_extension('NDBM_File')) { } delete_by_prefix('unicode::'); -add_by_name('unicode::distinct'); # put this back # Delete all modules which have their own tests. # This makes this test a lot faster.