All of lore.kernel.org
 help / color / mirror / Atom feed
From: guido@trentalancia.com (Guido Trentalancia)
To: refpolicy@oss.tresys.com
Subject: [refpolicy] [PATCH v3] fc_sort: avoid compiler warning/error
Date: Tue, 06 Jun 2017 00:08:13 +0200	[thread overview]
Message-ID: <1496700493.32176.2.camel@trentalancia.com> (raw)
In-Reply-To: <1496675093.4528.4.camel@trentalancia.com>

Fix a "-Werror=implicit-fallthrough" compiler warning/error on
the switch statement.

This third version (v3) fixes a bug introduced in the first
version and improves the style over the second version.

Signed-off-by: Guido Trentalancia <guido@trentalancia.com>
---
 support/fc_sort.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/support/fc_sort.c	2017-06-05 23:49:57.280624866 +0200
+++ b/support/fc_sort.c	2017-06-06 00:04:48.419621222 +0200
@@ -292,14 +292,16 @@ void fc_fill_data(file_context_node_t *f
 			/* If a escape character is found,
 			 *  skip the next character. */
 			c++;
+			break;
 		default:
-			/* If no meta character has been found yet,
-			 *  add one to the stem length. */
-			if (!fc_node->meta)
-				fc_node->stem_len++;
 			break;
 		}
 
+		/* If no meta character has been found yet,
+		 * add one to the stem length. */
+		if (!fc_node->meta)
+			fc_node->stem_len++;
+
 		fc_node->str_len++;
 		c++;
 	}

  parent reply	other threads:[~2017-06-05 22:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 14:56 [refpolicy] [PATCH] fc_sort: avoid compiler warning/error Guido Trentalancia
2017-06-05 15:04 ` [refpolicy] [PATCH v2] " Guido Trentalancia
2017-06-05 14:20   ` Christian Göttsche
2017-06-05 15:22     ` Guido Trentalancia
2017-06-05 16:31   ` Jason Zaman
2017-06-05 22:08   ` Guido Trentalancia [this message]
2017-06-07  0:07     ` [refpolicy] [PATCH v3] " Chris PeBenito
2017-06-07  5:27       ` Guido Trentalancia
2017-06-07 23:16     ` Chris PeBenito

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=1496700493.32176.2.camel@trentalancia.com \
    --to=guido@trentalancia.com \
    --cc=refpolicy@oss.tresys.com \
    /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.