diff options
author | Mattias Andrée <maandree@kth.se> | 2021-03-08 18:52:33 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2021-03-08 18:52:33 +0100 |
commit | b800ba9e60dfae5af122410b36a4a1b51b83b642 (patch) | |
tree | 495b54b344e45510401b56d3eb97b1360fc9fd34 /libgamma_value_of_subpixel_order.c | |
parent | m + style fix + check memory allocation overflows (diff) | |
download | libgamma-b800ba9e60dfae5af122410b36a4a1b51b83b642.tar.gz libgamma-b800ba9e60dfae5af122410b36a4a1b51b83b642.tar.bz2 libgamma-b800ba9e60dfae5af122410b36a4a1b51b83b642.tar.xz |
unmark libgamma_value_of_subpixel_order as pure, unmark libgamma_value_of_connector_type as pure, fix whitespace, use goto in libgamma_value_of_{subpixel_order,connector_type} from name case to const case
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | libgamma_value_of_subpixel_order.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libgamma_value_of_subpixel_order.c b/libgamma_value_of_subpixel_order.c index ed81435..1a66c9f 100644 --- a/libgamma_value_of_subpixel_order.c +++ b/libgamma_value_of_subpixel_order.c @@ -16,15 +16,14 @@ int libgamma_value_of_subpixel_order(const char *order, enum libgamma_subpixel_order *out) { #define X(CONST, NAME, ...)\ - if (!strcmp(order, NAME)) {\ - *out = CONST;\ - return 0;\ - } + if (!strcmp(order, NAME))\ + goto case_##CONST; LIST_SUBPIXEL_ORDERS(X) #undef X #define X(CONST, ...)\ if (!strcmp(order, #CONST)) {\ + case_##CONST:\ *out = CONST;\ return 0;\ } |