Skip to content

Commit

Permalink
config: refactor the parse_blur_method function
Browse files Browse the repository at this point in the history
sort blur methods alphabetically and address some clang-tidy issues
  • Loading branch information
absolutelynothelix committed Jul 21, 2023
1 parent 2c83fb8 commit 4a8b937
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,15 +183,19 @@ const char *parse_readnum(const char *src, double *dest) {
}

enum blur_method parse_blur_method(const char *src) {
if (strcmp(src, "kernel") == 0) {
return BLUR_METHOD_KERNEL;
} else if (strcmp(src, "box") == 0) {
if (strcmp(src, "box") == 0) {
return BLUR_METHOD_BOX;
} else if (strcmp(src, "gaussian") == 0) {
return BLUR_METHOD_GAUSSIAN;
} else if (strcmp(src, "dual_kawase") == 0) {
}
if (strcmp(src, "dual_kawase") == 0) {
return BLUR_METHOD_DUAL_KAWASE;
} else if (strcmp(src, "none") == 0) {
}
if (strcmp(src, "gaussian") == 0) {
return BLUR_METHOD_GAUSSIAN;
}
if (strcmp(src, "kernel") == 0) {
return BLUR_METHOD_KERNEL;
}
if (strcmp(src, "none") == 0) {
return BLUR_METHOD_NONE;
}
return BLUR_METHOD_INVALID;
Expand Down

0 comments on commit 4a8b937

Please sign in to comment.