All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
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	[thread overview]
Message-ID: <1538712196-13625-16-git-send-email-sandeen@sandeen.net> (raw)
In-Reply-To: <1538712196-13625-1-git-send-email-sandeen@sandeen.net>

From: Eric Sandeen <sandeen@redhat.com>

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 <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
---
 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;
 
-- 
1.8.3.1

  parent reply	other threads:[~2018-10-05 11:00 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05  4:03 [PATCH 0/15] xfsprogs: sparse fixes Eric Sandeen
2018-10-05  4:03 ` [PATCH 01/15] xfsprogs: minor " Eric Sandeen
2018-10-06 10:07   ` Christoph Hellwig
2018-10-08 14:58     ` Eric Sandeen
2018-10-05  4:03 ` [PATCH 02/15] xfsprogs: use ANSI declarations of void-arg functions Eric Sandeen
2018-10-06 10:07   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 03/15] mkfs.xfs: include full parser prototype in subopts definition Eric Sandeen
2018-10-06 10:08   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 04/15] xfs_db: single-bit bitfields are unsigned Eric Sandeen
2018-10-06 10:08   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 05/15] xfsprogs: don't use 0 as pointer Eric Sandeen
2018-10-06 10:08   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 06/15] xfsprogs: minor endian annotation fixes Eric Sandeen
2018-10-06 10:11   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 07/15] libxfs: avoid redefinitions of macros in mount.h Eric Sandeen
2018-10-06 10:12   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 08/15] xfsprogs: avoid redefinition of NBBY Eric Sandeen
2018-10-06 10:12   ` Christoph Hellwig
2018-10-08 14:59     ` Eric Sandeen
2018-10-05  4:03 ` [PATCH 09/15] xfsprogs: remove write-only variables Eric Sandeen
2018-10-06 10:13   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 10/15] xfsprogs: make static things static Eric Sandeen
2018-10-06 10:13   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 11/15] xfsprogs: include headers for extern variables Eric Sandeen
2018-10-06 10:14   ` Christoph Hellwig
2018-10-08 17:08     ` Eric Sandeen
2018-10-05  4:03 ` [PATCH 12/15] xfsprogs: kill EXTERN macro Eric Sandeen
2018-10-06 10:15   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 13/15] libxfs: export unused nonstatic functions to quiet static checkers Eric Sandeen
2018-10-06 10:15   ` Christoph Hellwig
2018-10-05  4:03 ` [PATCH 14/15] xfsprogs: eliminate shadow variables Eric Sandeen
2018-10-06 10:16   ` Christoph Hellwig
2018-10-08 15:48     ` Eric Sandeen
2018-10-05  4:03 ` Eric Sandeen [this message]
2018-10-06 10:18   ` [PATCH 15/15] libfrog: change project entity variable scope Christoph Hellwig
2018-10-08 15:50     ` Eric Sandeen
2018-10-05 15:41 ` [PATCH 0/15] xfsprogs: sparse fixes Darrick J. Wong
2018-10-05 15:52   ` Eric Sandeen

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=1538712196-13625-16-git-send-email-sandeen@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=linux-xfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.