summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2012-08-25 08:58:42 -0600
committerKarl Williamson <public@khwilliamson.com>2012-08-25 23:21:29 -0600
commit5d3d13d10da5429b4c98a44ea398eb3cfb8c457b (patch)
tree3bfb087559d3d4550910610254f8cda2fb4397eb /utf8.c
parentab20d70a9a23debea96660523e287da51405d7de (diff)
downloadperl-5d3d13d10da5429b4c98a44ea398eb3cfb8c457b.tar.gz
utf8.c: collapse a function parameter
Now that we have a flags parameter, we can get put this parameter as just another flag, giving a cleaner interface to this internal-only function. This also renames the flag parameter to <flag_p> to indicate it needs to be dereferenced.
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/utf8.c b/utf8.c
index b12d82c0ef..b25c701d4e 100644
--- a/utf8.c
+++ b/utf8.c
@@ -2914,11 +2914,11 @@ Perl_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits
* public interface, and returning a copy prevents others from doing
* mischief on the original */
- return newSVsv(_core_swash_init(pkg, name, listsv, minbits, none, FALSE, NULL, NULL));
+ return newSVsv(_core_swash_init(pkg, name, listsv, minbits, none, NULL, NULL));
}
SV*
-Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits, I32 none, bool return_if_undef, SV* invlist, U8* const flags_p)
+Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 minbits, I32 none, SV* invlist, U8* const flags_p)
{
/* Initialize and return a swash, creating it if necessary. It does this
* by calling utf8_heavy.pl in the general case.
@@ -2937,8 +2937,6 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m
* minbits is the number of bits required to represent each data element.
* It is '1' for binary properties.
* none I (khw) do not understand this one, but it is used only in tr///.
- * return_if_undef is TRUE if the routine shouldn't croak if it can't find
- * the requested property
* invlist is an inversion list to initialize the swash with (or NULL)
* flags_p if non-NULL is the address of various input and output flag bits
* to the routine, as follows: ('I' means is input to the routine;
@@ -2946,6 +2944,8 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m
* meaningful on return.)
* _CORE_SWASH_INIT_USER_DEFINED_PROPERTY indicates if the swash
* came from a user-defined property. (I O)
+ * _CORE_SWASH_INIT_RETURN_IF_UNDEF indicates that instead of croaking
+ * when the swash cannot be located, to simply return NULL. (I)
*
* Thus there are three possible inputs to find the swash: <name>,
* <listsv>, and <invlist>. At least one must be specified. The result
@@ -3028,7 +3028,7 @@ Perl__core_swash_init(pTHX_ const char* pkg, const char* name, SV *listsv, I32 m
if (SvPOK(retval))
/* If caller wants to handle missing properties, let them */
- if (return_if_undef) {
+ if (flags_p && *flags_p & _CORE_SWASH_INIT_RETURN_IF_UNDEF) {
return NULL;
}
Perl_croak(aTHX_