Open Source Telephony
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: ofono@ofono.org
Subject: Re: [PATCH 5/6] stk: Handle the Select Item proactive command.
Date: Mon, 26 Jul 2010 17:27:40 -0700	[thread overview]
Message-ID: <1280190460.2621.67.camel@localhost.localdomain> (raw)
In-Reply-To: <1280150080-6257-5-git-send-email-andrew.zaborowski@intel.com>

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

Hi Andew,

> +	switch (result) {
> +	case STK_AGENT_RESULT_OK:
> +		type = STK_RESULT_TYPE_SUCCESS;
> +		break;
> +
> +	case STK_AGENT_RESULT_BACK:
> +		type = STK_RESULT_TYPE_GO_BACK;
> +		goto send;
> +
> +	case STK_AGENT_RESULT_TIMEOUT:
> +		type = STK_RESULT_TYPE_NO_RESPONSE;
> +		goto send;
> +
> +	case STK_AGENT_RESULT_TERMINATE:
> +	default:
> +		type = STK_RESULT_TYPE_USER_TERMINATED;
> +		goto send;
> +
> +	case STK_AGENT_RESULT_CANCEL:
> +		goto out;
> +	}

have you tested this? The STK_AGENT_RESULT_CANCEL will never be reached
since we hit default label first.

As a general rule, default label should always be the last one. And in
case this is an enum, you can just skip default label and let the
compiler warn you about unhandled enum entries.

So just duplicate the code or re-arrange the order and work with a
proper /* fall trough */ comment.

Regards

Marcel



  reply	other threads:[~2010-07-27  0:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-26 13:14 [PATCH 1/6] Add STK agent utilities and logic Andrzej Zaborowski
2010-07-26 13:14 ` [PATCH 2/6] stk: Add STK agent registration api Andrzej Zaborowski
2010-07-26 13:14 ` [PATCH 3/6] stk: Utilities to deal with menus Andrzej Zaborowski
2010-07-26 13:14 ` [PATCH 4/6] stk: Handle the main menu Andrzej Zaborowski
2010-07-26 13:14 ` [PATCH 5/6] stk: Handle the Select Item proactive command Andrzej Zaborowski
2010-07-27  0:27   ` Marcel Holtmann [this message]
2010-07-27  0:53     ` Andrzej Zaborowski
2010-07-26 13:14 ` [PATCH 6/6] stk: Handle the Display Text " Andrzej Zaborowski
  -- strict thread matches above, loose matches on Subject: below --
2010-07-28  6:09 [PATCH 1/6] Add STK agent utilities and logic Andrzej Zaborowski
2010-07-28  6:09 ` [PATCH 5/6] stk: Handle the Select Item proactive command Andrzej Zaborowski
2010-07-28 10:26 [PATCH 1/6] Add STK agent utilities and logic Andrzej Zaborowski
2010-07-28 10:26 ` [PATCH 5/6] stk: Handle the Select Item proactive command Andrzej Zaborowski

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=1280190460.2621.67.camel@localhost.localdomain \
    --to=marcel@holtmann.org \
    --cc=ofono@ofono.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