2008-02-17 Marco Barisione <marco@barisione.org>
+ * glib/gregex.c: (translate_compile_error), (g_regex_new): Avoid some
+ useless casts from const gchar * to gchar *. (#516597, patch by
+ Yevgen Muntyan)
+
+2008-02-17 Marco Barisione <marco@barisione.org>
+
* glib/gregex.c: (match_info_new), (g_match_info_next): Don't return
duplicate matches when matching empty strings. (#515944)
* tests/regex-test.c: Add tests.
}
static void
-translate_compile_error (gint *errcode, gchar **errmsg)
+translate_compile_error (gint *errcode, const gchar **errmsg)
{
/* Compile errors are created adding 100 to the error code returned
* by PCRE.
{
GRegex *regex;
pcre *re;
- gchar *errmsg;
+ const gchar *errmsg;
gint erroffset;
gint errcode;
gboolean optimize = FALSE;
/* compile the pattern */
re = pcre_compile2 (pattern, compile_options, &errcode,
- (const gchar **)&errmsg, &erroffset, NULL);
+ &errmsg, &erroffset, NULL);
/* if the compilation failed, set the error member and return
* immediately */
if (optimize)
{
- regex->extra = pcre_study (regex->pcre_re, 0, (const gchar **)&errmsg);
+ regex->extra = pcre_study (regex->pcre_re, 0, &errmsg);
if (errmsg != NULL)
{
GError *tmp_error = g_error_new (G_REGEX_ERROR,