From patchwork Fri Jun 11 19:58:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 55363 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 93C4F1007D2 for ; Sat, 12 Jun 2010 06:11:25 +1000 (EST) Received: from localhost ([127.0.0.1]:51010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONAZW-0004C7-Jo for incoming@patchwork.ozlabs.org; Fri, 11 Jun 2010 16:11:22 -0400 Received: from [140.186.70.92] (port=49342 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ONAN5-0004fz-R0 for qemu-devel@nongnu.org; Fri, 11 Jun 2010 15:58:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1ONAN4-0004Ro-Oi for qemu-devel@nongnu.org; Fri, 11 Jun 2010 15:58:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14180) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1ONAN4-0004Rd-Ew for qemu-devel@nongnu.org; Fri, 11 Jun 2010 15:58:30 -0400 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5BJwTrH023050 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 11 Jun 2010 15:58:29 -0400 Received: from localhost (dhcp-32-227.gru.redhat.com [10.96.32.227]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5BJwSAP011713; Fri, 11 Jun 2010 15:58:29 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Fri, 11 Jun 2010 16:58:11 -0300 Message-Id: <1276286295-17601-7-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1276286295-17601-1-git-send-email-lcapitulino@redhat.com> References: <1276286295-17601-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 06/10] json-streamer: Don't use qdict_put_obj() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org It's not needed, use qobject_put() instead and get a cleaner code. Signed-off-by: Luiz Capitulino --- json-streamer.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/json-streamer.c b/json-streamer.c index 610ffea..f7e7a68 100644 --- a/json-streamer.c +++ b/json-streamer.c @@ -43,11 +43,11 @@ static void json_message_process_token(JSONLexer *lexer, QString *token, JSONTok } dict = qdict_new(); - qdict_put_obj(dict, "type", QOBJECT(qint_from_int(type))); + qdict_put(dict, "type", qint_from_int(type)); QINCREF(token); - qdict_put_obj(dict, "token", QOBJECT(token)); - qdict_put_obj(dict, "x", QOBJECT(qint_from_int(x))); - qdict_put_obj(dict, "y", QOBJECT(qint_from_int(y))); + qdict_put(dict, "token", token); + qdict_put(dict, "x", qint_from_int(x)); + qdict_put(dict, "y", qint_from_int(y)); qlist_append(parser->tokens, dict);