Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[display] Make display state enume start from zero. Contributes to ME…
…R#1401

Having negative state values makes indexing based on them difficult.

The numerical state values are not exposed outside mce and mce itself
tests explicit values, so it is safe to renumber the state values to
start from zero.
  • Loading branch information
spiiroin committed Nov 3, 2015
1 parent 0b7a9f9 commit 194c03f
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions mce.h
Expand Up @@ -197,14 +197,17 @@ call_type_t call_type_parse(const char *name);

/** Display state */
typedef enum {
MCE_DISPLAY_UNDEF = -1, /**< Display state not set */
MCE_DISPLAY_OFF = 0, /**< Display is off */
MCE_DISPLAY_LPM_OFF = 1, /**< Display is off in low power mode */
MCE_DISPLAY_LPM_ON = 2, /**< Display is on in low power mode */
MCE_DISPLAY_DIM = 3, /**< Display is dimmed */
MCE_DISPLAY_ON = 4, /**< Display is on */
MCE_DISPLAY_POWER_UP, /**< Display is resuming */
MCE_DISPLAY_POWER_DOWN, /**< Display is suspending */
MCE_DISPLAY_UNDEF, /**< Display state not set */
MCE_DISPLAY_OFF, /**< Display is off */
MCE_DISPLAY_LPM_OFF, /**< Display is off in low power mode */
MCE_DISPLAY_LPM_ON, /**< Display is on in low power mode */
MCE_DISPLAY_DIM, /**< Display is dimmed */
MCE_DISPLAY_ON, /**< Display is on */
MCE_DISPLAY_POWER_UP, /**< Display is resuming */
MCE_DISPLAY_POWER_DOWN, /**< Display is suspending */

MCE_DISPLAY_NUMSTATES /**< Number of display states */

} display_state_t;

const char *display_state_repr(display_state_t state);
Expand Down

0 comments on commit 194c03f

Please sign in to comment.