hail-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pete Zaitcev <zaitcev@redhat.com>
To: jeff@garzik.org
Cc: Project Hail List <hail-devel@vger.kernel.org>
Subject: [Patch 3/8] CLD: cleanup: if() to switch()
Date: Wed, 14 Apr 2010 12:34:19 -0600	[thread overview]
Message-ID: <20100414123419.258cb527@redhat.com> (raw)

I distinctly remember how my precious ifs were mercilessly replaced
elsewhere, but apparently this piece escaped notice thus far.
Now, make it more style-uniform with the rest.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>

---
 lib/cldc.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/cldc.c b/lib/cldc.c
index be8598f..305e05d 100644
--- a/lib/cldc.c
+++ b/lib/cldc.c
@@ -1386,10 +1388,12 @@ static void ncld_thread_command(struct ncld_sess *nsess)
 		abort();
 	}
 
-	if (cmd == NCLD_CMD_END) {
+	switch (cmd) {
+	case NCLD_CMD_END:
 		/* No answer to requestor. Wait with g_thread_join. */
 		g_thread_exit(NULL);
-	} else if (cmd == NCLD_CMD_SESEV) {
+		break;
+	case NCLD_CMD_SESEV:
 		rrc = read(nsess->to_thread[0], &what, sizeof(uint32_t));
 		if (rrc < sizeof(uint32_t)) {
 			fprintf(stderr, "bad read param\n");
@@ -1397,7 +1401,8 @@ static void ncld_thread_command(struct ncld_sess *nsess)
 		}
 		if (nsess->event)
 			nsess->event(nsess->event_arg, what);
-	} else {
+		break;
+	default:
 		fprintf(stderr, "bad command 0x%x\n", cmd);
 		abort();
 	}

                 reply	other threads:[~2010-04-14 18:34 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20100414123419.258cb527@redhat.com \
    --to=zaitcev@redhat.com \
    --cc=hail-devel@vger.kernel.org \
    --cc=jeff@garzik.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).