summaryrefslogtreecommitdiff
path: root/src/pcre2_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pcre2_config.c')
-rw-r--r--src/pcre2_config.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/pcre2_config.c b/src/pcre2_config.c
index 9218459..e99272f 100644
--- a/src/pcre2_config.c
+++ b/src/pcre2_config.c
@@ -61,15 +61,16 @@ convenient for user programs that want to test their values. */
* Return info about what features are configured *
*************************************************/
-/*
+/* If where is NULL, the length of memory required is returned.
+
Arguments:
what what information is required
where where to put the information
-Returns: 0 if data returned
- >= 0 if where is NULL, giving length required
+Returns: 0 if a numerical value is returned
+ >= 0 if a string value
PCRE2_ERROR_BADOPTION if "where" not recognized
- or JIT target requested when JIT not enabled
+ or JIT target requested when JIT not enabled
*/
PCRE2_EXP_DEFN int PCRE2_CALL_CONVENTION
@@ -127,15 +128,15 @@ switch (what)
#ifdef SUPPORT_JIT
{
const char *v = PRIV(jit_get_target)();
- return 1 + ((where == NULL)?
- strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v));
+ return (int)(1 + ((where == NULL)?
+ strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v)));
}
#else
return PCRE2_ERROR_BADOPTION;
#endif
case PCRE2_CONFIG_LINKSIZE:
- *((uint32_t *)where) = configured_link_size;
+ *((uint32_t *)where) = (uint32_t)configured_link_size;
break;
case PCRE2_CONFIG_MATCHLIMIT:
@@ -169,8 +170,8 @@ switch (what)
#else
const char *v = "Unicode not supported";
#endif
- return 1 + ((where == NULL)?
- strlen(v): PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v));
+ return (int)(1 + ((where == NULL)?
+ strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v)));
}
break;
@@ -206,8 +207,8 @@ switch (what)
const char *v = (XSTRING(Z PCRE2_PRERELEASE)[1] == 0)?
XSTRING(PCRE2_MAJOR.PCRE2_MINOR PCRE2_DATE) :
XSTRING(PCRE2_MAJOR.PCRE2_MINOR) XSTRING(PCRE2_PRERELEASE PCRE2_DATE);
- return 1 + ((where == NULL)?
- strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v));
+ return (int)(1 + ((where == NULL)?
+ strlen(v) : PRIV(strcpy_c8)((PCRE2_UCHAR *)where, v)));
}
}