obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
776 stars 220 forks source link

obs-browser: Fix compiler warnings #327

Closed cg2121 closed 2 years ago

cg2121 commented 2 years ago

Description

This fixes warnings found with GCC on Linux.

Motivation and Context

Warnings are annoying.

How Has This Been Tested?

Compiled to see if warnings went away.

Types of changes

Checklist:

WizardCM commented 2 years ago

Yeah my understanding was that this is intentional.

RytoEX commented 2 years ago

This is a bad idea, that switch is meant to fall through (otherwise for example having Full access wouldn't give you access to Advanced and below). However, this PR does prove RytoEX's point about the switch not being particularly beautiful. Feel free to refactor it.

To avoid compiler warnings, wouldn't [[fallthrough]] from C++17 be more appropriate?

Supported in:

https://en.cppreference.com/w/cpp/language/attributes/fallthrough

cg2121 commented 2 years ago

Updated it to use the [[fallthrough]] statements