speakup: document the usage of enum values
Samuel Thibault
maintainerPATCH 1/1 speakup: document the usage of enum values
The cursor tracking modes enum, the edge enum, and the read_all commands enum should be used as such in the source code, to make it more readable and make gcc catch missing values in switches.
Also, some values of enums are coupled with others, we at least need to document these.
Signed-off-by Samuel Thibault <[email protected]>
--- drivers/accessibility/speakup/i18n.h | 6 +++ drivers/accessibility/speakup/main.c | 64 ++++++++++++++++++----------------- 2 files changed, 39 insertions(+), 31 deletions(-)
drivers/accessibility/speakup/i18n.h +6 -0
@@ -23,12 +23,15 @@ enum msg_index_t {MSG_OFF =MSG_STATUS_START ,MSG_ON ,MSG_NO_WINDOW , + +/* These must be ordered the same as enum cursor_track */ MSG_CURSOR_MSGS_START ,MSG_CURSORING_OFF =MSG_CURSOR_MSGS_START ,MSG_CURSORING_ON ,MSG_HIGHLIGHT_TRACKING ,MSG_READ_WINDOW ,MSG_READ_ALL , +MSG_EDIT_DONE ,MSG_WINDOW_ALREADY_SET , MSG_END_BEFORE_START,
@@ -41,11 +44,14 @@ enum msg_index_t {MSG_LEAVING_HELP ,MSG_IS_UNASSIGNED ,MSG_HELP_INFO , + +/* These must be ordered the same as enum edge */ MSG_EDGE_MSGS_START ,MSG_EDGE_TOP =MSG_EDGE_MSGS_START ,MSG_EDGE_BOTTOM ,MSG_EDGE_LEFT ,MSG_EDGE_RIGHT , +MSG_NUMBER ,MSG_SPACE , MSG_START, /* A little confusing, given our convention. */
drivers/accessibility/speakup/main.c +33 -31
140 lines not on this page · raw message