summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-11-19 16:50:33 -0700
committerKarl Williamson <public@khwilliamson.com>2012-01-13 09:58:33 -0700
commitb0e3252edb68bc2dd1e28347ff032f53358df3ce (patch)
treec61f9d3de3ab5eafae2f2bfb36072b24255949a4
parent20b1a8918cf079bce8353cc51059b0ff48ed4ad6 (diff)
downloadperl-b0e3252edb68bc2dd1e28347ff032f53358df3ce.tar.gz
utf8.c: Change name of static function
This function has always confused me, as it doesn't return a swash, but a swatch.
-rw-r--r--embed.fnc2
-rw-r--r--embed.h2
-rw-r--r--lib/utf8_heavy.pl2
-rw-r--r--proto.h4
-rw-r--r--utf8.c28
5 files changed, 19 insertions, 19 deletions
diff --git a/embed.fnc b/embed.fnc
index 097105492b..9f7183acc5 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2149,7 +2149,7 @@ sn |NV|mulexp10 |NV value|I32 exponent
sRn |STRLEN |is_utf8_char_slow|NN const U8 *s|const STRLEN len
sRM |UV |check_locale_boundary_crossing|NN const U8* const p|const UV result|NN U8* const ustrp|NN STRLEN *lenp
sR |bool |is_utf8_common |NN const U8 *const p|NN SV **swash|NN const char * const swashname
-sR |SV* |swash_get |NN SV* swash|UV start|UV span
+sR |SV* |swatch_get |NN SV* swash|UV start|UV span
#endif
Apd |void |sv_setsv_flags |NN SV *dstr|NULLOK SV *sstr|const I32 flags
diff --git a/embed.h b/embed.h
index a1aed25747..9d140ee869 100644
--- a/embed.h
+++ b/embed.h
@@ -1589,7 +1589,7 @@
#define check_locale_boundary_crossing(a,b,c,d) S_check_locale_boundary_crossing(aTHX_ a,b,c,d)
#define is_utf8_char_slow S_is_utf8_char_slow
#define is_utf8_common(a,b,c) S_is_utf8_common(aTHX_ a,b,c)
-#define swash_get(a,b,c) S_swash_get(aTHX_ a,b,c)
+#define swatch_get(a,b,c) S_swatch_get(aTHX_ a,b,c)
#define to_lower_latin1(a,b,c) S_to_lower_latin1(aTHX_ a,b,c)
# endif
# if defined(PERL_IN_UTF8_C) || defined(PERL_IN_PP_C)
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl
index 6f639f04ec..3d78d800d4 100644
--- a/lib/utf8_heavy.pl
+++ b/lib/utf8_heavy.pl
@@ -662,6 +662,6 @@ sub _loose_name ($) {
}
}
-# Now SWASHGET is recasted into a C function S_swash_get (see utf8.c).
+# Now SWASHGET is recasted into a C function S_swatch_get (see utf8.c).
1;
diff --git a/proto.h b/proto.h
index 7d9e229bc4..a6a1a44526 100644
--- a/proto.h
+++ b/proto.h
@@ -7079,10 +7079,10 @@ STATIC bool S_is_utf8_common(pTHX_ const U8 *const p, SV **swash, const char * c
#define PERL_ARGS_ASSERT_IS_UTF8_COMMON \
assert(p); assert(swash); assert(swashname)
-STATIC SV* S_swash_get(pTHX_ SV* swash, UV start, UV span)
+STATIC SV* S_swatch_get(pTHX_ SV* swash, UV start, UV span)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_SWASH_GET \
+#define PERL_ARGS_ASSERT_SWATCH_GET \
assert(swash)
STATIC U8 S_to_lower_latin1(pTHX_ const U8 c, U8 *p, STRLEN *lenp)
diff --git a/utf8.c b/utf8.c
index b4b67b6541..13aa2dc19f 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2533,7 +2533,7 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
* the lower-level routine, and it is similarly broken for returning
* multiple values. --jhi
* For those, you should use to_utf8_case() instead */
-/* Now SWASHGET is recasted into S_swash_get in this file. */
+/* Now SWASHGET is recasted into S_swatch_get in this file. */
/* Note:
* Returns the value of property/mapping C<swash> for the first character
@@ -2633,7 +2633,7 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8)
/* Try our second-level swatch cache, kept in a hash. */
SV** svp = hv_fetch(hv, (const char*)ptr, klen, FALSE);
- /* If not cached, generate it via swash_get */
+ /* If not cached, generate it via swatch_get */
if (!svp || !SvPOK(*svp)
|| !(tmps = (const U8*)SvPV_const(*svp, slen))) {
/* We use utf8n_to_uvuni() as we want an index into
@@ -2642,7 +2642,7 @@ Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8)
const UV code_point = utf8n_to_uvuni(ptr, UTF8_MAXBYTES, 0,
ckWARN(WARN_UTF8) ?
0 : UTF8_ALLOW_ANY);
- swatch = swash_get(swash,
+ swatch = swatch_get(swash,
/* On EBCDIC & ~(0xA0-1) isn't a useful thing to do */
(klen) ? (code_point & ~((UV)needents - 1)) : 0,
needents);
@@ -2816,7 +2816,7 @@ S_swash_scan_list_line(pTHX_ U8* l, U8* const lend, UV* min, UV* max, UV* val,
* Should be used via swash_fetch, which will cache the swatch in C<swash>.
*/
STATIC SV*
-S_swash_get(pTHX_ SV* swash, UV start, UV span)
+S_swatch_get(pTHX_ SV* swash, UV start, UV span)
{
SV *swatch;
U8 *l, *lend, *x, *xend, *s, *send;
@@ -2837,10 +2837,10 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span)
const UV none = SvUV(*nonesvp);
UV end = start + span;
- PERL_ARGS_ASSERT_SWASH_GET;
+ PERL_ARGS_ASSERT_SWATCH_GET;
if (bits != 1 && bits != 8 && bits != 16 && bits != 32) {
- Perl_croak(aTHX_ "panic: swash_get doesn't expect bits %"UVuf,
+ Perl_croak(aTHX_ "panic: swatch_get doesn't expect bits %"UVuf,
(UV)bits);
}
@@ -3014,19 +3014,19 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span)
otherbitssvp = hv_fetchs(otherhv, "BITS", FALSE);
otherbits = (STRLEN)SvUV(*otherbitssvp);
if (bits < otherbits)
- Perl_croak(aTHX_ "panic: swash_get found swatch size mismatch");
+ Perl_croak(aTHX_ "panic: swatch_get found swatch size mismatch");
/* The "other" swatch must be destroyed after. */
- other = swash_get(*othersvp, start, span);
+ other = swatch_get(*othersvp, start, span);
o = (U8*)SvPV(other, olen);
if (!olen)
- Perl_croak(aTHX_ "panic: swash_get got improper swatch");
+ Perl_croak(aTHX_ "panic: swatch_get got improper swatch");
s = (U8*)SvPV(swatch, slen);
if (bits == 1 && otherbits == 1) {
if (slen != olen)
- Perl_croak(aTHX_ "panic: swash_get found swatch length mismatch");
+ Perl_croak(aTHX_ "panic: swatch_get found swatch length mismatch");
switch (opc) {
case '+':
@@ -3353,13 +3353,13 @@ Perl__swash_inversion_hash(pTHX_ SV* const swash)
/*DEBUG_U(PerlIO_printf(Perl_debug_log, "Adding %"UVXf" to list for %"UVXf"\n", inverse, val));*/
}
- /* swash_get() increments the value of val for each element in the
+ /* swatch_get() increments the value of val for each element in the
* range. That makes more compact tables possible. You can
* express the capitalization, for example, of all consecutive
* letters with a single line: 0061\t007A\t0041 This maps 0061 to
* 0041, 0062 to 0042, etc. I (khw) have never understood 'none',
* and it's not documented; it appears to be used only in
- * implementing tr//; I copied the semantics from swash_get(), just
+ * implementing tr//; I copied the semantics from swatch_get(), just
* in case */
if (!none || val < none) {
++val;
@@ -3451,7 +3451,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash)
_invlist_invert_prop(invlist);
}
- /* This code is copied from swash_get()
+ /* This code is copied from swatch_get()
* read $swash->{EXTRAS} */
x = (U8*)SvPV(*extssvp, xcur);
xend = x + xcur;
@@ -3503,7 +3503,7 @@ Perl__swash_to_invlist(pTHX_ SV* const swash)
/* The "other" swatch must be destroyed after. */
other = _swash_to_invlist((SV *)*othersvp);
- /* End of code copied from swash_get() */
+ /* End of code copied from swatch_get() */
switch (opc) {
case '+':
_invlist_union(invlist, other, &invlist);