public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: kerolasa@iki.fi
Subject: [PATCH 4/4] losetup: fix declarations [smatch scan]
Date: Fri, 28 Dec 2012 21:23:43 +0000	[thread overview]
Message-ID: <1356729823-729-4-git-send-email-kerolasa@iki.fi> (raw)
In-Reply-To: <1356729823-729-1-git-send-email-kerolasa@iki.fi>

sys-utils/losetup.c:309:2: error: 'for' loop initial declarations are only allowed in C99 mode
sys-utils/losetup.c:374:2: error: 'for' loop initial declarations are only allowed in C99 mode

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 sys-utils/losetup.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/sys-utils/losetup.c b/sys-utils/losetup.c
index 2765a38..2c81e69 100644
--- a/sys-utils/losetup.c
+++ b/sys-utils/losetup.c
@@ -302,11 +302,12 @@ static int make_table(struct loopdev_cxt *lc, const char *file,
 {
 	struct stat sbuf, *st = &sbuf;
 	struct tt_line *ln;
+	int i;
 
 	if (!(tt = tt_new_table(0)))
 		errx(EXIT_FAILURE, _("failed to initialize output table"));
 
-	for (int i = 0; i < ncolumns; i++) {
+	for (i = 0; i < ncolumns; i++) {
 		struct colinfo *ci = get_column_info(i);
 
 		if (!tt_define_column(tt, ci->name, ci->whint, ci->flags))
@@ -341,6 +342,8 @@ static int make_table(struct loopdev_cxt *lc, const char *file,
 
 static void usage(FILE *out)
 {
+	size_t i;
+
 	fputs(USAGE_HEADER, out);
 
 	fprintf(out,
@@ -371,7 +374,7 @@ static void usage(FILE *out)
 	fputs(USAGE_VERSION, out);
 
 	fputs(_("\nAvailable --list columns:\n"), out);
-	for (size_t i = 0; i < NCOLS; i++)
+	for (i = 0; i < NCOLS; i++)
 		fprintf(out, " %12s  %s\n", infos[i].name, _(infos[i].help));
 
 	fprintf(out, USAGE_MAN_TAIL("losetup(8)"));
-- 
1.8.0.3


  parent reply	other threads:[~2012-12-28 21:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-28 21:23 [PATCH 1/4] script: search shell from path, when necessary Sami Kerola
2012-12-28 21:23 ` [PATCH 2/4] ipcs: fix spacing in summary output Sami Kerola
2013-01-09 13:20   ` Karel Zak
2012-12-28 21:23 ` [PATCH 3/4] swapon: default to --show if nothing is requested Sami Kerola
2013-01-09 13:21   ` Karel Zak
2012-12-28 21:23 ` Sami Kerola [this message]
2013-01-09 13:36   ` [PATCH 4/4] losetup: fix declarations [smatch scan] Karel Zak
2013-01-09 12:47 ` [PATCH 1/4] script: search shell from path, when necessary Karel Zak

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=1356729823-729-4-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox