qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
@ 2014-05-13 18:34 Mike Day
  2014-05-13 19:37 ` Eric Blake
  0 siblings, 1 reply; 8+ messages in thread
From: Mike Day @ 2014-05-13 18:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: kwolf, peter.maydell, Mike Day, stefanha, cornelia.huck, ambru

g_sequence_lookup is not supported by glib < 2.28. The usage
of g_sequence_lookup is not essential in this context (its a
safeguard against duplicate values in the help message).
Removing the call enables the build on all platforms and
does not change the operation of the help function.

Signed-off-by: Mike Day <ncmike@ncultra.org>
---
 qemu-img.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 04ce02a..bf5e74c 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -70,11 +70,8 @@ static void add_format_to_seq(void *opaque, const char *fmt_name)
 {
     GSequence *seq = opaque;
 
-    if (!g_sequence_lookup(seq, (gpointer)fmt_name,
-                           compare_data, NULL)) {
         g_sequence_insert_sorted(seq, (gpointer)fmt_name,
                                  compare_data, NULL);
-    }
 }
 
 static void QEMU_NORETURN GCC_FMT_ATTR(1, 2) error_exit(const char *fmt, ...)
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function
@ 2014-05-13 21:11 Mike Day
  2014-05-13 21:48 ` Eric Blake
  2014-05-14  6:31 ` Cornelia Huck
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Day @ 2014-05-13 21:11 UTC (permalink / raw)
  To: qemu-devel
  Cc: kwolf, peter.maydell, armbru, Mike Day, stefanha, cornelia.huck

g_sequence_lookup is not supported by glib < 2.28. The usage
of g_sequence_lookup is not essential in this context (it's a
safeguard against duplicate values in the help message).
Removing the call enables the build on all platforms and
does not change the operation of the help function.

Signed-off-by: Mike Day <ncmike@ncultra.org>
---
 qemu-img.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/qemu-img.c b/qemu-img.c
index 04ce02a..1ad899e 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -70,11 +70,8 @@ static void add_format_to_seq(void *opaque, const char *fmt_name)
 {
     GSequence *seq = opaque;
 
-    if (!g_sequence_lookup(seq, (gpointer)fmt_name,
-                           compare_data, NULL)) {
-        g_sequence_insert_sorted(seq, (gpointer)fmt_name,
-                                 compare_data, NULL);
-    }
+    g_sequence_insert_sorted(seq, (gpointer)fmt_name,
+                             compare_data, NULL);
 }
 
 static void QEMU_NORETURN GCC_FMT_ATTR(1, 2) error_exit(const char *fmt, ...)
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-16 12:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-13 18:34 [Qemu-devel] [PATCH] Remove g_sequence_lookup from qemu-img help function Mike Day
2014-05-13 19:37 ` Eric Blake
  -- strict thread matches above, loose matches on Subject: below --
2014-05-13 21:11 Mike Day
2014-05-13 21:48 ` Eric Blake
2014-05-14  7:44   ` Kevin Wolf
2014-05-14  8:23     ` Peter Maydell
2014-05-16 12:35       ` Alexander Graf
2014-05-14  6:31 ` Cornelia Huck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).