do not 'default' handle switch-cases

Authored by sitter on Jul 4 2016, 9:38 AM.

Description

do not 'default' handle switch-cases

Summary:
using the default keyword hides compiler warnings. this causes enum
expansion to require a dev to remember to expand all switch-cases that use
the enum to make sure they are still correct, since that never ever happens
don't use default. also, why do what a computer can do for us...

drop default keyword usage. replace it with explicitly break cases, which
is explicitly overriding the compiler warning, and taking default actions
*after* the switch-case block.
this allows the compiler to warn about unhandled enum values. such as

console.cpp:139:12: warning: enumeration value ‘DVI’ not handled in switch [-Wswitch]

Reviewers: sebas

Reviewed By: sebas

Subscribers: plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D2080

Details

Committed
sitterJul 4 2016, 12:10 PM
Reviewer
sebas
Differential Revision
D2080: do not 'default' handle switch-cases
Parents
R104:a3c8857b68ab: Update version number for 5.7.0 GIT_SILENT
Branches
Unknown
Tags
Unknown