1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2024-11-11 13:51:02 -05:00

config: refactor the parse_blur_method function

sort blur methods alphabetically and address some clang-tidy issues
This commit is contained in:
Maxim Solovyov 2023-07-22 01:19:22 +03:00
parent 2c83fb821b
commit 4a8b937c90
No known key found for this signature in database

View file

@ -183,15 +183,19 @@ const char *parse_readnum(const char *src, double *dest) {
} }
enum blur_method parse_blur_method(const char *src) { enum blur_method parse_blur_method(const char *src) {
if (strcmp(src, "box") == 0) {
return BLUR_METHOD_BOX;
}
if (strcmp(src, "dual_kawase") == 0) {
return BLUR_METHOD_DUAL_KAWASE;
}
if (strcmp(src, "gaussian") == 0) {
return BLUR_METHOD_GAUSSIAN;
}
if (strcmp(src, "kernel") == 0) { if (strcmp(src, "kernel") == 0) {
return BLUR_METHOD_KERNEL; return BLUR_METHOD_KERNEL;
} else if (strcmp(src, "box") == 0) { }
return BLUR_METHOD_BOX; if (strcmp(src, "none") == 0) {
} else if (strcmp(src, "gaussian") == 0) {
return BLUR_METHOD_GAUSSIAN;
} else if (strcmp(src, "dual_kawase") == 0) {
return BLUR_METHOD_DUAL_KAWASE;
} else if (strcmp(src, "none") == 0) {
return BLUR_METHOD_NONE; return BLUR_METHOD_NONE;
} }
return BLUR_METHOD_INVALID; return BLUR_METHOD_INVALID;