Skip to content

Commit

Permalink
Changed the type of the sixth argument of onig_snprintf_with_pattern(…
Browse files Browse the repository at this point in the history
…) from const UChar* to const char*
  • Loading branch information
kkos committed Oct 4, 2024
1 parent 3e5120d commit 43a8c3f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/regerror.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,15 +352,15 @@ onig_error_code_to_str(UChar* s, int code, ...)

void ONIG_VARIADIC_FUNC_ATTR
onig_snprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc,
UChar* pat, UChar* pat_end, const UChar *fmt, ...)
UChar* pat, UChar* pat_end, const char *fmt, ...)
{
int n, need, len;
UChar *p, *s, *bp;
UChar bs[6];
va_list args;

va_start(args, fmt);
n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
n = xvsnprintf((char* )buf, bufsize, fmt, args);
va_end(args);

need = (int )(pat_end - pat) * 4 + 4;
Expand Down
2 changes: 1 addition & 1 deletion src/regint.h
Original file line number Diff line number Diff line change
Expand Up @@ -953,7 +953,7 @@ struct re_pattern_buffer {
extern void onig_add_end_call(void (*func)(void));
extern void onig_warning(const char* s);
extern UChar* onig_error_code_to_format P_((int code));
extern void ONIG_VARIADIC_FUNC_ATTR ONIG_PRINTFLIKE(6, 7) onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const UChar *fmt, ...));
extern void ONIG_VARIADIC_FUNC_ATTR ONIG_PRINTFLIKE(6, 7) onig_snprintf_with_pattern PV_((UChar buf[], int bufsize, OnigEncoding enc, UChar* pat, UChar* pat_end, const char *fmt, ...));
extern int onig_compile P_((regex_t* reg, const UChar* pattern, const UChar* pattern_end, OnigErrorInfo* einfo));
extern int onig_is_code_in_cc_len P_((int enclen, OnigCodePoint code, void* /* CClassNode* */ cc));
extern RegexExt* onig_get_regex_ext(regex_t* reg);
Expand Down
8 changes: 4 additions & 4 deletions src/regparse.c
Original file line number Diff line number Diff line change
Expand Up @@ -5090,7 +5090,7 @@ CC_ESC_WARN(ParseEnv* env, UChar *c)
UChar buf[WARN_BUFSIZE];
onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
env->pattern, env->pattern_end,
(UChar* )"character class has '%s' without escape",
"character class has '%s' without escape",
c);
(*onig_warn)((char* )buf);
}
Expand All @@ -5105,7 +5105,7 @@ CLOSE_BRACKET_WITHOUT_ESC_WARN(ParseEnv* env, UChar* c)
UChar buf[WARN_BUFSIZE];
onig_snprintf_with_pattern(buf, WARN_BUFSIZE, (env)->enc,
(env)->pattern, (env)->pattern_end,
(UChar* )"regular expression has '%s' without escape", c);
"regular expression has '%s' without escape", c);
(*onig_warn)((char* )buf);
}
}
Expand Down Expand Up @@ -8553,7 +8553,7 @@ assign_quantifier_body(Node* qnode, Node* target, int group, ParseEnv* env)
if (onig_verb_warn != onig_null_warn) {
onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
env->pattern, env->pattern_end,
(UChar* )"redundant nested repeat operator");
"redundant nested repeat operator");
(*onig_verb_warn)((char* )buf);
}
goto warn_exit;
Expand All @@ -8563,7 +8563,7 @@ assign_quantifier_body(Node* qnode, Node* target, int group, ParseEnv* env)
if (onig_verb_warn != onig_null_warn) {
onig_snprintf_with_pattern(buf, WARN_BUFSIZE, env->enc,
env->pattern, env->pattern_end,
(UChar* )"nested repeat operator %s and %s was replaced with '%s'",
"nested repeat operator %s and %s was replaced with '%s'",
PopularQStr[targetq_num], PopularQStr[nestq_num],
ReduceQStr[ReduceTypeTable[targetq_num][nestq_num]]);
(*onig_verb_warn)((char* )buf);
Expand Down

0 comments on commit 43a8c3f

Please sign in to comment.