From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16949 invoked by alias); 4 Feb 2016 17:29:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 16913 invoked by uid 89); 4 Feb 2016 17:29:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=BAYES_00,KAM_STOCKGEN,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=Hx-languages-length:753 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 04 Feb 2016 17:29:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 31826AC6A for ; Thu, 4 Feb 2016 17:29:37 +0000 (UTC) Received: by starscream.home.jeffm.io (Postfix, from userid 1000) id 7A24D89989; Thu, 4 Feb 2016 12:29:34 -0500 (EST) From: jeffm@suse.com To: gdb-patches@sourceware.org Cc: Jeff Mahoney Subject: [PATCH 3/7] py-symbol: use Py_RETURN_NONE instead of open coding it Date: Thu, 04 Feb 2016 17:29:00 -0000 Message-Id: <1454606973-31017-4-git-send-email-jeffm@suse.com> In-Reply-To: <1454606973-31017-1-git-send-email-jeffm@suse.com> References: <1454606973-31017-1-git-send-email-jeffm@suse.com> X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00119.txt.bz2 From: Jeff Mahoney --- gdb/python/py-symbol.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c index c1511b5..cbbc9e2 100644 --- a/gdb/python/py-symbol.c +++ b/gdb/python/py-symbol.c @@ -73,8 +73,7 @@ sympy_get_type (PyObject *self, void *closure) if (SYMBOL_TYPE (symbol) == NULL) { - Py_INCREF (Py_None); - return Py_None; + Py_RETURN_NONE; } return type_to_type_object (SYMBOL_TYPE (symbol)); @@ -471,8 +470,7 @@ gdbpy_lookup_global_symbol (PyObject *self, PyObject *args, PyObject *kw) } else { - sym_obj = Py_None; - Py_INCREF (Py_None); + Py_RETURN_NONE; } return sym_obj; -- 2.1.4