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) {

Check warning on line 186 in src/config.c

View check run for this annotation

Codecov / codecov/patch

src/config.c#L186

Added line #L186 was not covered by tests
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) {

Check warning on line 189 in src/config.c

View check run for this annotation

Codecov / codecov/patch

src/config.c#L189

Added line #L189 was not covered by tests
return BLUR_METHOD_DUAL_KAWASE;
} else if (strcmp(src, "none") == 0) {
}
if (strcmp(src, "gaussian") == 0) {
return BLUR_METHOD_GAUSSIAN;

Check warning on line 193 in src/config.c

View check run for this annotation

Codecov / codecov/patch

src/config.c#L192-L193

Added lines #L192 - L193 were not covered by tests
}
if (strcmp(src, "kernel") == 0) {
return BLUR_METHOD_KERNEL;

Check warning on line 196 in src/config.c

View check run for this annotation

Codecov / codecov/patch

src/config.c#L195-L196

Added lines #L195 - L196 were not covered by tests
}
if (strcmp(src, "none") == 0) {

Check warning on line 198 in src/config.c

View check run for this annotation

Codecov / codecov/patch

src/config.c#L198

Added line #L198 was not covered by tests
return BLUR_METHOD_NONE;
}
return BLUR_METHOD_INVALID;
Expand Down

0 comments on commit 4a8b937

Please sign in to comment.