From patchwork Fri Oct 5 04:03:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 10627343 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7251A184E for ; Fri, 5 Oct 2018 04:03:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 648932881E for ; Fri, 5 Oct 2018 04:03:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 597442925D; Fri, 5 Oct 2018 04:03:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E059A2907B for ; Fri, 5 Oct 2018 04:03:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727599AbeJELAO (ORCPT ); Fri, 5 Oct 2018 07:00:14 -0400 Received: from sandeen.net ([63.231.237.45]:48096 "EHLO sandeen.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727576AbeJELAO (ORCPT ); Fri, 5 Oct 2018 07:00:14 -0400 Received: by sandeen.net (Postfix, from userid 500) id 77F7722C7; Thu, 4 Oct 2018 23:03:19 -0500 (CDT) From: Eric Sandeen To: linux-xfs@vger.kernel.org Subject: [PATCH 15/15] libfrog: change project entity variable scope Date: Thu, 4 Oct 2018 23:03:16 -0500 Message-Id: <1538712196-13625-16-git-send-email-sandeen@sandeen.net> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1538712196-13625-1-git-send-email-sandeen@sandeen.net> References: <1538712196-13625-1-git-send-email-sandeen@sandeen.net> Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Eric Sandeen The global "p" got shadowed in some other functions, and it was a bit hard to keep track of what's what. Change the scope of some of the project entity retrieval function variables to make the behavior more clear. Fixes sparse warnings about this. Signed-off-by: Eric Sandeen Signed-off-by: Eric Sandeen --- libfrog/projects.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libfrog/projects.c b/libfrog/projects.c index d4dda3f..91bc78f 100644 --- a/libfrog/projects.c +++ b/libfrog/projects.c @@ -15,12 +15,8 @@ char *projid_file; char *projects_file; static FILE *projects; -static fs_project_t p; -static char projects_buffer[512]; static FILE *project_paths; -static fs_project_path_t pp; -static char project_paths_buffer[1024]; void setprfiles(void) @@ -64,8 +60,10 @@ endprpathent(void) fs_project_t * getprent(void) { - char *idstart, *idend; - size_t size = sizeof(projects_buffer) - 1; + static fs_project_t p; + static char projects_buffer[512]; + char *idstart, *idend; + size_t size = sizeof(projects_buffer) - 1; if (!projects) return NULL; @@ -125,6 +123,8 @@ getprprid( fs_project_path_t * getprpathent(void) { + static fs_project_path_t pp; + static char project_paths_buffer[1024]; char *nmstart, *nmend; size_t size = sizeof(project_paths_buffer) - 1;