[libvirt] [libvirt-glib 0/3] small cleanups

The 3 patches fix various small warnings when building, and a misnamed function call in some examples. Christophe

It was renamed to gvir_config_object_to_xml() a long while ago. --- examples/conn-test.js | 2 +- examples/conn-test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/conn-test.js b/examples/conn-test.js index 0225a95..7f9784b 100755 --- a/examples/conn-test.js +++ b/examples/conn-test.js @@ -25,7 +25,7 @@ function done(conn, result, data) { print ("Name " + doms[d].get_name()) var conf = doms[d].get_config(0) print ("Conf " + conf) - var xml = conf.get_doc() + var xml = conf.to_xml() print ("XML " + xml) print ("Info " + doms[d].get_info().memory) } diff --git a/examples/conn-test.py b/examples/conn-test.py index 446d7d6..deeaa26 100644 --- a/examples/conn-test.py +++ b/examples/conn-test.py @@ -33,7 +33,7 @@ def done(conn, result, data): except Exception, e: print "Document is not valid according to %s: %s: %s" % (conf.get_schema(), str(e), str(type(e))) - xml = conf.get_doc() + xml = conf.to_xml() print ("XML " + xml) print ("Info " + str(d.get_info().memory)) -- 1.8.2.1

This is used to tell the compiler about printf-like format strings used by some functions. Without this marking, gcc 4.8 is outputs warnings to recommend using it. --- libvirt-glib/libvirt-glib-error.c | 3 +++ libvirt-glib/libvirt-glib-error.h | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/libvirt-glib/libvirt-glib-error.c b/libvirt-glib/libvirt-glib-error.c index 6598948..889fceb 100644 --- a/libvirt-glib/libvirt-glib-error.c +++ b/libvirt-glib/libvirt-glib-error.c @@ -259,6 +259,9 @@ void gvir_set_error_valist(GError **error, } static void +gvir_log_valist(GLogLevelFlags level, const gchar *format, va_list args) G_GNUC_PRINTF(2, 0); + +static void gvir_log_valist(GLogLevelFlags level, const gchar *format, va_list args) { gchar *message; diff --git a/libvirt-glib/libvirt-glib-error.h b/libvirt-glib/libvirt-glib-error.h index 88d8d29..2a7e35d 100644 --- a/libvirt-glib/libvirt-glib-error.h +++ b/libvirt-glib/libvirt-glib-error.h @@ -31,7 +31,7 @@ G_BEGIN_DECLS GError *gvir_error_new(GQuark domain, gint code, const gchar *format, - ...); + ...) G_GNUC_PRINTF(3, 4); GError *gvir_error_new_literal(GQuark domain, gint code, @@ -40,13 +40,13 @@ GError *gvir_error_new_literal(GQuark domain, GError *gvir_error_new_valist(GQuark domain, gint code, const gchar *format, - va_list args); + va_list args) G_GNUC_PRINTF(3, 0); void gvir_set_error(GError **error, GQuark domain, gint code, const gchar *format, - ...); + ...) G_GNUC_PRINTF(4, 5); void gvir_set_error_literal(GError **error, GQuark domain, @@ -57,10 +57,10 @@ void gvir_set_error_valist(GError **error, GQuark domain, gint code, const gchar *format, - va_list args); + va_list args) G_GNUC_PRINTF(4, 0); -void gvir_critical(const gchar *format, ...); -void gvir_warning(const gchar *format, ...); +void gvir_critical(const gchar *format, ...) G_GNUC_PRINTF(1, 2); +void gvir_warning(const gchar *format, ...) G_GNUC_PRINTF(1, 2); G_END_DECLS -- 1.8.2.1

automake outputs a warning about AM_CPPFLAGS being the recommended name to use for INCLUDES --- libvirt-gconfig/tests/Makefile.am | 2 +- python/Makefile.am | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libvirt-gconfig/tests/Makefile.am b/libvirt-gconfig/tests/Makefile.am index 4d1a564..c0dbf90 100644 --- a/libvirt-gconfig/tests/Makefile.am +++ b/libvirt-gconfig/tests/Makefile.am @@ -4,7 +4,7 @@ AM_CFLAGS = \ $(GOBJECT2_CFLAGS) \ $(LIBXML2_CFLAGS) \ $(WARN_CFLAGS) -INCLUDES = -I$(top_srcdir) +AM_CPPFLAGS = -I$(top_srcdir) LDADD = \ $(top_builddir)/libvirt-gconfig/libvirt-gconfig-1.0.la \ $(GOBJECT2_LIBS) \ diff --git a/python/Makefile.am b/python/Makefile.am index 8f693bf..1471dce 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -1,6 +1,6 @@ # Makefile for libvirt python library -INCLUDES = \ +AM_CPPFLAGS = \ $(WARN_CFLAGS) \ -I$(PYTHON_INCLUDES) \ -I$(top_srcdir) \ -- 1.8.2.1

On Sun, May 12, 2013 at 07:34:07PM +0200, Christophe Fergeau wrote:
The 3 patches fix various small warnings when building, and a misnamed function call in some examples.
ACK to all 3 Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Christophe Fergeau
-
Daniel P. Berrange