configure.ac, *: require GLib 2.40.0

Remove gimp_output_stream_[v]printf() and use the new functions from
GLib instead. Use memmove() instead of the deprecated g_memmove().
This commit is contained in:
Michael Natterer 2014-08-12 15:29:34 +02:00
parent 0904b1e923
commit dae366bb6e
10 changed files with 37 additions and 98 deletions

View File

@ -258,8 +258,8 @@ dump_gimprc_manpage (GimpConfig *rc,
guint n_property_specs;
guint i;
gimp_output_stream_printf (output, NULL, NULL, NULL,
"%s", man_page_header);
g_output_stream_printf (output, NULL, NULL, NULL,
"%s", man_page_header);
klass = G_OBJECT_GET_CLASS (rc);
property_specs = g_object_class_list_properties (klass, &n_property_specs);
@ -275,20 +275,20 @@ dump_gimprc_manpage (GimpConfig *rc,
if (prop_spec->flags & GIMP_CONFIG_PARAM_IGNORE)
continue;
gimp_output_stream_printf (output, NULL, NULL, NULL,
".TP\n");
g_output_stream_printf (output, NULL, NULL, NULL,
".TP\n");
if (gimp_config_serialize_property (rc, prop_spec, writer))
{
gimp_output_stream_printf (output, NULL, NULL, NULL,
"\n");
g_output_stream_printf (output, NULL, NULL, NULL,
"\n");
desc = dump_describe_param (prop_spec);
dump_with_linebreaks (output, desc);
gimp_output_stream_printf (output, NULL, NULL, NULL,
"\n");
g_output_stream_printf (output, NULL, NULL, NULL,
"\n");
g_free (desc);
}
@ -296,10 +296,10 @@ dump_gimprc_manpage (GimpConfig *rc,
g_free (property_specs);
gimp_output_stream_printf (output, NULL, NULL, NULL,
"%s", man_page_path);
gimp_output_stream_printf (output, NULL, NULL, NULL,
"%s", man_page_footer);
g_output_stream_printf (output, NULL, NULL, NULL,
"%s", man_page_path);
g_output_stream_printf (output, NULL, NULL, NULL,
"%s", man_page_footer);
}
@ -521,8 +521,8 @@ dump_with_linebreaks (GOutputStream *output,
/* groff doesn't like lines to start with a single quote */
if (*text == '\'')
gimp_output_stream_printf (output, NULL, NULL, NULL,
"\\&"); /* a zero width space */
g_output_stream_printf (output, NULL, NULL, NULL,
"\\&"); /* a zero width space */
for (t = text, i = 0, space = 0;
*t != '\n' && (i <= LINE_LENGTH || space == 0) && i < len;
@ -536,12 +536,12 @@ dump_with_linebreaks (GOutputStream *output,
i = space;
g_output_stream_write_all (output, text, i, NULL, NULL, NULL);
gimp_output_stream_printf (output, NULL, NULL, NULL,
"\n");
g_output_stream_printf (output, NULL, NULL, NULL,
"\n");
if (*t == '\n')
gimp_output_stream_printf (output, NULL, NULL, NULL,
".br\n");
g_output_stream_printf (output, NULL, NULL, NULL,
".br\n");
i++;

View File

@ -305,7 +305,7 @@ themes_apply_theme (Gimp *gimp,
esc_gtkrc_user = g_strescape (tmp, NULL);
g_free (tmp);
if (! gimp_output_stream_printf
if (! g_output_stream_printf
(output, NULL, NULL, &error,
"# GIMP themerc\n"
"#\n"

View File

@ -1435,7 +1435,7 @@ gimp_text_buffer_load (GimpTextBuffer *buffer,
gtk_text_buffer_get_end_iter (GTK_TEXT_BUFFER (buffer), &iter);
remaining = (buf + remaining + bytes_read) - leftover;
g_memmove (buf, leftover, remaining);
memmove (buf, leftover, remaining);
if (! success)
{

View File

@ -42,7 +42,7 @@ m4_define([gimp_full_name], [GNU Image Manipulation Program])
# required versions of other packages
m4_define([babl_required_version], [0.1.11])
m4_define([gegl_required_version], [0.3.0])
m4_define([glib_required_version], [2.36.0])
m4_define([glib_required_version], [2.40.0])
m4_define([atk_required_version], [2.2.0])
m4_define([gtk_required_version], [2.24.10])
m4_define([gdk_pixbuf_required_version], [2.24.1])
@ -583,13 +583,13 @@ if test "x$GDBUS_CODEGEN" = xno; then
AC_MSG_ERROR([Could not find gdbus-codegen in your PATH])
fi
AC_MSG_CHECKING([if GLib is version 2.39.0 or newer])
if $PKG_CONFIG --atleast-version=2.39.0 glib-2.0; then
have_glib_2_39=yes
AC_MSG_CHECKING([if GLib is version 2.43.0 or newer])
if $PKG_CONFIG --atleast-version=2.43.0 glib-2.0; then
have_glib_2_43=yes
else
have_glib_2_39=no
have_glib_2_43=no
fi
AC_MSG_RESULT($have_glib_2_39)
AC_MSG_RESULT($have_glib_2_43)
# Check for bind_textdomain_codeset, including -lintl if GLib brings it in.
@ -2035,7 +2035,7 @@ CPPFLAGS="${CPPFLAGS} -DGIMP_DISABLE_DEPRECATED -DBABL_DISABLE_DEPRECATED -DGSEA
# We must build without problems with future releases of libraries
# and disabling deprecated API risks breaking the build
if test "x$have_glib_2_39" != "xyes"; then
if test "x$have_glib_2_43" != "xyes"; then
CPPFLAGS="${CPPFLAGS} -DG_DISABLE_DEPRECATED"
fi

View File

@ -83,8 +83,6 @@ EXPORTS
gimp_minor_version
gimp_offset_type_get_type
gimp_orientation_type_get_type
gimp_output_stream_printf
gimp_output_stream_vprintf
gimp_paint_application_mode_get_type
gimp_param_memsize_get_type
gimp_param_parasite_get_type

View File

@ -810,47 +810,3 @@ gimp_flags_value_get_help (GFlagsClass *flags_class,
return NULL;
}
gboolean
gimp_output_stream_printf (GOutputStream *stream,
gsize *bytes_written,
GCancellable *cancellable,
GError **error,
const gchar *format,
...)
{
va_list args;
gboolean success;
va_start (args, format);
success = gimp_output_stream_vprintf (stream, bytes_written, cancellable,
error, format, args);
va_end (args);
return success;
}
gboolean
gimp_output_stream_vprintf (GOutputStream *stream,
gsize *bytes_written,
GCancellable *cancellable,
GError **error,
const gchar *format,
va_list args)
{
gchar *text;
gboolean success;
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), FALSE);
g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (stream), FALSE);
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (format != NULL, FALSE);
text = g_strdup_vprintf (format, args);
success = g_output_stream_write_all (stream,
text, strlen (text),
bytes_written, cancellable, error);
g_free (text);
return success;
}

View File

@ -69,21 +69,6 @@ const gchar * gimp_flags_value_get_desc (GFlagsClass *flags_class,
const gchar * gimp_flags_value_get_help (GFlagsClass *flags_class,
GFlagsValue *flags_value);
/* temporary, to be removed when we depend on glib 2.40, which will
* clearly be before gimp 2.10
*/
gboolean gimp_output_stream_printf (GOutputStream *stream,
gsize *bytes_written,
GCancellable *cancellable,
GError **error,
const gchar *format,
...) G_GNUC_PRINTF (5, 6);
gboolean gimp_output_stream_vprintf (GOutputStream *stream,
gsize *bytes_written,
GCancellable *cancellable,
GError **error,
const gchar *format,
va_list args) G_GNUC_PRINTF (5, 0);
G_END_DECLS

View File

@ -277,8 +277,8 @@ gimp_value_array_insert (GimpValueArray *value_array,
value_array_grow (value_array, value_array->n_values + 1, FALSE);
if (index + 1 < value_array->n_values)
g_memmove (value_array->values + index + 1, value_array->values + index,
(i - index) * sizeof (value_array->values[0]));
memmove (value_array->values + index + 1, value_array->values + index,
(i - index) * sizeof (value_array->values[0]));
memset (value_array->values + index, 0, sizeof (value_array->values[0]));
@ -317,8 +317,8 @@ gimp_value_array_remove (GimpValueArray *value_array,
value_array->n_values--;
if (index < value_array->n_values)
g_memmove (value_array->values + index, value_array->values + index + 1,
(value_array->n_values - index) * sizeof (value_array->values[0]));
memmove (value_array->values + index, value_array->values + index + 1,
(value_array->n_values - index) * sizeof (value_array->values[0]));
value_array_shrink (value_array);

View File

@ -309,8 +309,8 @@ print (GOutputStream *stream,
gboolean success;
va_start (args, format);
success = gimp_output_stream_vprintf (stream, NULL, NULL,
error, format, args);
success = g_output_stream_vprintf (stream, NULL, NULL,
error, format, args);
va_end (args);
return success;

View File

@ -323,8 +323,8 @@ pcx_header_from_buffer (guint8 *buf)
for (i = 0; pcx_header_buf_xlate[i].size != 0; i++)
{
g_memmove (pcx_header_buf_xlate[i].address, buf + buf_offset,
pcx_header_buf_xlate[i].size);
memmove (pcx_header_buf_xlate[i].address, buf + buf_offset,
pcx_header_buf_xlate[i].size);
buf_offset += pcx_header_buf_xlate[i].size;
}
}
@ -337,8 +337,8 @@ pcx_header_to_buffer (guint8 *buf)
for (i = 0; pcx_header_buf_xlate[i].size != 0; i++)
{
g_memmove (buf + buf_offset, pcx_header_buf_xlate[i].address,
pcx_header_buf_xlate[i].size);
memmove (buf + buf_offset, pcx_header_buf_xlate[i].address,
pcx_header_buf_xlate[i].size);
buf_offset += pcx_header_buf_xlate[i].size;
}
}