* Make some functions in win.c pure
* Remove unused code
* Fix misuse of attr_const, const functions shouldn't exam data pointed
  to by its pointer arguments.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui
2019-02-21 14:08:08 +00:00
parent 69826a0844
commit 350933a054
7 changed files with 71 additions and 82 deletions

View File

@ -284,7 +284,7 @@ char *parse_config(options_t *, const char *config_file, bool *shadow_enable,
/**
* Parse a backend option argument.
*/
static inline attr_const enum backend parse_backend(const char *str) {
static inline attr_pure enum backend parse_backend(const char *str) {
for (enum backend i = 0; BACKEND_STRS[i]; ++i) {
if (!strcasecmp(str, BACKEND_STRS[i])) {
return i;
@ -311,7 +311,7 @@ static inline attr_const enum backend parse_backend(const char *str) {
*
* Returns -2 on failure
*/
static inline attr_const int parse_glx_swap_method(const char *str) {
static inline attr_pure int parse_glx_swap_method(const char *str) {
// Parse alias
if (!strcmp("undefined", str)) {
return 0;