From patchwork Mon Aug 31 20:49:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 8531 Received: (qmail 3917 invoked by alias); 31 Aug 2015 20:49:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 3837 invoked by uid 89); 31 Aug 2015 20:49:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: mail-wi0-f181.google.com Received: from mail-wi0-f181.google.com (HELO mail-wi0-f181.google.com) (209.85.212.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 31 Aug 2015 20:49:35 +0000 Received: by wicmx12 with SMTP id mx12so10585263wic.0 for ; Mon, 31 Aug 2015 13:49:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=RlH/eP70J2a+wza93pUv2uOJnxc9vYcLe3kC4Of9Fyw=; b=OAv2io7kkTXsQGxHFcvdrUhfJTd5Z9WdHtA1ZAyXP6AMhxLR/iJB+dplNls1NeF3jF d2mTLYPTiQV2pLq1Bm/aN/LVpG0Zngzfw1nTevJqH6y22w0tbjP69KneSvkbX72k2xF7 AAbRTeBiTdxDbOzIFhjAvFWsucRa684hzNf90xXGg785Qk2SBH++B5tC0+b/X18yUonD LeCenmi/IRMCYGMViFUmfWrjNFY/l1OxNIYXhTBpaOB8jjeejlQH+Qpo6ndFwvdI2g7f rf95XDvntUX45oNwIJCLOX4ZdN1xaBlKCydu4qxrwMSF8gCiq7/Ewl9FS3cK/DChv9rY sNww== X-Gm-Message-State: ALoCoQlCO5WIJ7K5YrbYOQd0a7KsX+7OiimtOWmj9fyAGwI5M7KVsXk5EI+IkKKH+ynQN7azdet8 X-Received: by 10.194.78.164 with SMTP id c4mr27929131wjx.65.1441054171868; Mon, 31 Aug 2015 13:49:31 -0700 (PDT) Received: from localhost (host86-146-54-249.range86-146.btcentralplus.com. [86.146.54.249]) by smtp.gmail.com with ESMTPSA id yu4sm23896325wjc.43.2015.08.31.13.49.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 31 Aug 2015 13:49:31 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/3] gdb/cli: Remove casts of NULL during assignment. Date: Mon, 31 Aug 2015 21:49:23 +0100 Message-Id: In-Reply-To: References: In-Reply-To: References: X-IsSubscribed: yes In the following code: struct symbol *wsym = (struct symbol *) NULL; the cast of NULL is redundant, it adds noise, and is just one more thing to change if the type of wsym ever changes. There are a relatively small number of places in gdb where the above code pattern is used. Usually the cast is removed like this: struct symbol *wsym = NULL; This commit updates all the places within the gdb/cli directory where we cast NULL during assignment, removing the cast. gdb/ChangeLog: * cli/cli-decode.c (find_cmd): Remove cast of NULL pointer. --- gdb/ChangeLog | 4 ++++ gdb/cli/cli-decode.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f4dafb6..0c23ca6 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2015-08-31 Andrew Burgess + * cli/cli-decode.c (find_cmd): Remove cast of NULL pointer. + +2015-08-31 Andrew Burgess + * c-valprint.c (print_unpacked_pointer): Remove cast of NULL pointer. * dbxread.c (dbx_end_psymtab): Likewise. diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index f5b6fc4..cab2336 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1219,7 +1219,7 @@ find_cmd (const char *command, int len, struct cmd_list_element *clist, { struct cmd_list_element *found, *c; - found = (struct cmd_list_element *) NULL; + found = NULL; *nfound = 0; for (c = clist; c; c = c->next) if (!strncmp (command, c->name, len)