utf8.c: Change prototypes of two functions
authorKarl Williamson <public@khwilliamson.com>
Wed, 14 Dec 2011 16:29:33 +0000 (09:29 -0700)
committerKarl Williamson <public@khwilliamson.com>
Thu, 15 Dec 2011 23:26:01 +0000 (16:26 -0700)
_to_uni_fold_flags() and _to_fold_latin1() now have their flags
parameter be a boolean.  The name 'flags' is retained in case the usage
ever expands instead of calling it by the name of the only use this
currently has.

This is as a result of confusion between this and _to_ut8_fold_flags()
which does have more than one flag possibility.

embed.fnc
proto.h
utf8.c

index 3fc270a..e96e660 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -602,14 +602,14 @@ Ap        |UV     |to_uni_upper   |UV c|NN U8 *p|NN STRLEN *lenp
 Ap     |UV     |to_uni_title   |UV c|NN U8 *p|NN STRLEN *lenp
 #ifdef PERL_IN_UTF8_C
 sR     |U8     |to_lower_latin1|const U8 c|NULLOK U8 *p|NULLOK STRLEN *lenp
-p      |UV     |_to_fold_latin1|const U8 c|NN U8 *p|NN STRLEN *lenp|const U8 flags
+p      |UV     |_to_fold_latin1|const U8 c|NN U8 *p|NN STRLEN *lenp|const bool flags
 #endif
 #if defined(PERL_IN_UTF8_C) || defined(PERL_IN_PP_C)
 p      |UV     |_to_upper_title_latin1|const U8 c|NN U8 *p|NN STRLEN *lenp|const char S_or_s
 #endif
 Ap     |UV     |to_uni_lower   |UV c|NN U8 *p|NN STRLEN *lenp
 Amp    |UV     |to_uni_fold    |UV c|NN U8 *p|NN STRLEN *lenp
-AMp    |UV     |_to_uni_fold_flags|UV c|NN U8 *p|NN STRLEN *lenp|U8 flags
+AMp    |UV     |_to_uni_fold_flags|UV c|NN U8 *p|NN STRLEN *lenp|const bool flags
 ApPR   |bool   |is_uni_alnum_lc|UV c
 ApPR   |bool   |is_uni_idfirst_lc|UV c
 ApPR   |bool   |is_uni_alpha_lc|UV c
diff --git a/proto.h b/proto.h
index 3fc81e3..92befda 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -29,7 +29,7 @@ PERL_CALLCONV bool    Perl__is_utf8__perl_idstart(pTHX_ const U8 *p)
 #define PERL_ARGS_ASSERT__IS_UTF8__PERL_IDSTART        \
        assert(p)
 
-PERL_CALLCONV UV       Perl__to_uni_fold_flags(pTHX_ UV c, U8 *p, STRLEN *lenp, U8 flags)
+PERL_CALLCONV UV       Perl__to_uni_fold_flags(pTHX_ UV c, U8 *p, STRLEN *lenp, const bool flags)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT__TO_UNI_FOLD_FLAGS    \
@@ -7031,7 +7031,7 @@ STATIC bool       S_isa_lookup(pTHX_ HV *stash, const char * const name, STRLEN len, U
 
 #endif
 #if defined(PERL_IN_UTF8_C)
-PERL_CALLCONV UV       Perl__to_fold_latin1(pTHX_ const U8 c, U8 *p, STRLEN *lenp, const U8 flags)
+PERL_CALLCONV UV       Perl__to_fold_latin1(pTHX_ const U8 c, U8 *p, STRLEN *lenp, const bool flags)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);
 #define PERL_ARGS_ASSERT__TO_FOLD_LATIN1       \
diff --git a/utf8.c b/utf8.c
index bc9f6b2..7bc2b38 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -1461,8 +1461,11 @@ Perl_to_uni_lower(pTHX_ UV c, U8* p, STRLEN *lenp)
 }
 
 UV
-Perl__to_fold_latin1(pTHX_ const U8 c, U8* p, STRLEN *lenp, const U8 flags)
+Perl__to_fold_latin1(pTHX_ const U8 c, U8* p, STRLEN *lenp, const bool flags)
 {
+    /* Corresponds to to_lower_latin1(), flags is TRUE if to use full case
+     * folding */
+
     UV converted;
 
     PERL_ARGS_ASSERT__TO_FOLD_LATIN1;
@@ -1495,11 +1498,11 @@ Perl__to_fold_latin1(pTHX_ const U8 c, U8* p, STRLEN *lenp, const U8 flags)
 }
 
 UV
-Perl__to_uni_fold_flags(pTHX_ UV c, U8* p, STRLEN *lenp, U8 flags)
+Perl__to_uni_fold_flags(pTHX_ UV c, U8* p, STRLEN *lenp, const bool flags)
 {
 
     /* Not currently externally documented, and subject to change, <flags> is
-     * non-zero iff full folding is to be used */
+     * TRUE iff full folding is to be used */
 
     PERL_ARGS_ASSERT__TO_UNI_FOLD_FLAGS;