diff --git a/src/cre2.cpp b/src/cre2.cpp index 5a63b93..f9c8e16 100644 --- a/src/cre2.cpp +++ b/src/cre2.cpp @@ -718,11 +718,11 @@ cre2_set_add_simple(cre2_set *set, const char *pattern) // Compile the regex set into a DFA. Must be called after add and before match. -int +bool cre2_set_compile(cre2_set *set) { RE2::Set *s = TO_RE2_SET(set); - return static_cast(s->Compile()); + return s->Compile(); } // Match the set of regex against text and store indices of matching regexes in match array. diff --git a/src/cre2.h b/src/cre2.h index 92eaf65..374c02c 100644 --- a/src/cre2.h +++ b/src/cre2.h @@ -330,8 +330,8 @@ cre2_decl int cre2_set_add(cre2_set *set, const char *pattern, size_t pattern_le cre2_decl int cre2_set_add_simple(cre2_set *set, const char *pattern); /* Compile the regex set into a DFA. Must be called after add and before match. - * Returns 1 on success, 0 on error */ -cre2_decl int cre2_set_compile(cre2_set *set); + * Returns true on success, false on error */ +cre2_decl bool cre2_set_compile(cre2_set *set); /* Match the set of regex against text and store indices of matching regexes in match array. * Returns the number of regexes which match. */