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


_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to