[IOT-2539] clean switch warning
authorGeorge Nash <george.nash@intel.com>
Mon, 31 Jul 2017 20:00:55 +0000 (13:00 -0700)
committerNathan Heldt-Sheller <nathan.heldt-sheller@intel.com>
Fri, 22 Sep 2017 05:50:48 +0000 (05:50 +0000)
commitc98259c5244e337966b4a0613c729d7302f9c75b
tree59d57250a3c8ef0b908d5bb595fd5df49d5b2bcf
parent7a17e8034402afb15853087bf03d6bbc48fad796
[IOT-2539] clean switch warning

The file deviceonboardingstate.c produced a warning:
enumeration value 'DOS_STATE_COUNT' not handled in switch

This is a result of adding the the DOS_STATE_COUNT as an
enum value. This is a common programming pattern but will
result in the -Wswitch warning if the enum values are
used in a case statement without a default state.

There are multiple ways to handle this warning.
- add an empty case for the unhandled count state
- add a default case to the switch statement
- move the count out of the enum

For this fix the unhandled count state was added
to the switch statment with an assert if that case
is ever encountered.

Bug: https://jira.iotivity.org/browse/IOT-2539
Change-Id: I14c390b34d33db9a82a3bd055dd513a96c941733
Signed-off-by: George Nash <george.nash@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/21685
Tested-by: jenkins-iotivity <jenkins@iotivity.org>
Reviewed-by: Dan Mihai <Daniel.Mihai@microsoft.com>
(cherry picked from commit b76529cbc0004b40b8142fb6721deff67eddb0e4)
resource/csdk/security/src/deviceonboardingstate.c