qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Subject: [Qemu-devel] [PATCH 2/7] allow passing NULL to qobject_type
Date: Sat, 17 Oct 2009 09:55:31 +0200	[thread overview]
Message-ID: <1255766136-3028-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1255766136-3028-1-git-send-email-pbonzini@redhat.com>

Cc: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qobject.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/qobject.h b/qobject.h
index 4cc9287..200644d 100644
--- a/qobject.h
+++ b/qobject.h
@@ -102,6 +102,8 @@ static inline void qobject_decref(QObject *obj)
  */
 static inline qtype_code qobject_type(const QObject *obj)
 {
+    if (!obj)
+        return QTYPE_NONE;
     assert(obj->type != NULL);
     return obj->type->code;
 }
-- 
1.6.2.5

  parent reply	other threads:[~2009-10-17  7:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-17  7:55 [Qemu-devel] [PATCH 0/7] Add JSON enconding and formatted printing to QObject Paolo Bonzini
2009-10-17  7:55 ` [Qemu-devel] [PATCH 1/7] add qemu_memdup Paolo Bonzini
2009-10-17  7:55 ` Paolo Bonzini [this message]
2009-10-17  7:55 ` [Qemu-devel] [PATCH 3/7] forward declare all QObject subclasses in qobject.h Paolo Bonzini
2009-10-17 13:02   ` Anthony Liguori
2009-10-17  7:55 ` [Qemu-devel] [PATCH 4/7] add mutable qstring functions Paolo Bonzini
2009-10-17 13:03   ` Anthony Liguori
2009-10-17  7:55 ` [Qemu-devel] [PATCH 5/7] add json encoder for qobjects Paolo Bonzini
2009-10-17 13:03   ` Anthony Liguori
2009-10-17 13:44     ` Paolo Bonzini
2009-10-17 16:20       ` Anthony Liguori
2009-10-17  7:55 ` [Qemu-devel] [PATCH 6/7] add testsuite for qobject json encoder Paolo Bonzini
2009-10-17  7:55 ` [Qemu-devel] [PATCH 7/7] add formatted printing of QObjects Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1255766136-3028-3-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=lcapitulino@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).