From: Bartosz Golaszewski Date: Wed, 20 Feb 2019 10:30:42 +0000 (+0100) Subject: treewide: order includes alphabetically X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=937ded4dbc77c9d461fc1dc6907b165073b76f6a;p=qemu-gpiodev%2Flibgpiod.git treewide: order includes alphabetically Unify the header includes by ordering them alphabetically and always having local headers in a second group below the global ones (separated by a newline). Signed-off-by: Bartosz Golaszewski --- diff --git a/bindings/cxx/chip.cpp b/bindings/cxx/chip.cpp index f4c92ef..9b825c7 100644 --- a/bindings/cxx/chip.cpp +++ b/bindings/cxx/chip.cpp @@ -5,12 +5,11 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include #include - +#include #include -#include #include -#include namespace gpiod { diff --git a/bindings/cxx/gpiod.hpp b/bindings/cxx/gpiod.hpp index fd08b17..b92597f 100644 --- a/bindings/cxx/gpiod.hpp +++ b/bindings/cxx/gpiod.hpp @@ -8,13 +8,12 @@ #ifndef __LIBGPIOD_GPIOD_CXX_HPP__ #define __LIBGPIOD_GPIOD_CXX_HPP__ +#include +#include #include - +#include #include #include -#include -#include -#include namespace gpiod { diff --git a/bindings/cxx/iter.cpp b/bindings/cxx/iter.cpp index 39e738d..8c0b9ba 100644 --- a/bindings/cxx/iter.cpp +++ b/bindings/cxx/iter.cpp @@ -6,7 +6,6 @@ */ #include - #include namespace gpiod { diff --git a/bindings/cxx/line.cpp b/bindings/cxx/line.cpp index 35fef8b..f8d0e62 100644 --- a/bindings/cxx/line.cpp +++ b/bindings/cxx/line.cpp @@ -6,7 +6,6 @@ */ #include - #include namespace gpiod { diff --git a/bindings/cxx/line_bulk.cpp b/bindings/cxx/line_bulk.cpp index e52d33d..3006b65 100644 --- a/bindings/cxx/line_bulk.cpp +++ b/bindings/cxx/line_bulk.cpp @@ -6,9 +6,8 @@ */ #include - -#include #include +#include namespace gpiod { diff --git a/include/gpiod.h b/include/gpiod.h index 0181a3d..2679478 100644 --- a/include/gpiod.h +++ b/include/gpiod.h @@ -8,8 +8,8 @@ #ifndef __LIBGPIOD_GPIOD_H__ #define __LIBGPIOD_GPIOD_H__ -#include #include +#include #include #ifdef __cplusplus diff --git a/src/lib/core.c b/src/lib/core.c index 7c4f0bf..347f92b 100644 --- a/src/lib/core.c +++ b/src/lib/core.c @@ -7,20 +7,19 @@ /* Low-level, core library code. */ +#include +#include #include - +#include +#include +#include #include #include -#include -#include -#include -#include -#include -#include -#include #include +#include #include -#include +#include +#include enum { LINE_FREE = 0, diff --git a/src/lib/ctxless.c b/src/lib/ctxless.c index 17f255f..a0681a5 100644 --- a/src/lib/ctxless.c +++ b/src/lib/ctxless.c @@ -7,12 +7,12 @@ /* Implementation of the high-level API. */ -#include -#include -#include #include +#include #include +#include +#include int gpiod_ctxless_get_value(const char *device, unsigned int offset, bool active_low, const char *consumer) diff --git a/src/lib/helpers.c b/src/lib/helpers.c index 9beea3a..479f370 100644 --- a/src/lib/helpers.c +++ b/src/lib/helpers.c @@ -10,13 +10,11 @@ * access to neither the internal library data structures nor the kernel UAPI. */ +#include +#include #include - #include #include -#include -#include -#include static bool isuint(const char *str) { diff --git a/src/lib/iter.c b/src/lib/iter.c index 5b3d378..a4d883a 100644 --- a/src/lib/iter.c +++ b/src/lib/iter.c @@ -7,10 +7,9 @@ /* GPIO chip and line iterators. */ +#include #include - #include -#include struct gpiod_chip_iter { struct gpiod_chip **chips; diff --git a/src/tools/gpiodetect.c b/src/tools/gpiodetect.c index 98e26cd..aa86568 100644 --- a/src/tools/gpiodetect.c +++ b/src/tools/gpiodetect.c @@ -5,12 +5,12 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include #include -#include "tools-common.h" - #include #include -#include + +#include "tools-common.h" static const struct option longopts[] = { { "help", no_argument, NULL, 'h' }, diff --git a/src/tools/gpiofind.c b/src/tools/gpiofind.c index 76f0889..35cc491 100644 --- a/src/tools/gpiofind.c +++ b/src/tools/gpiofind.c @@ -5,12 +5,12 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include #include -#include "tools-common.h" - #include #include -#include + +#include "tools-common.h" static const struct option longopts[] = { { "help", no_argument, NULL, 'h' }, diff --git a/src/tools/gpioget.c b/src/tools/gpioget.c index d942c07..196ebeb 100644 --- a/src/tools/gpioget.c +++ b/src/tools/gpioget.c @@ -5,13 +5,13 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include #include -#include "tools-common.h" - +#include #include #include -#include -#include + +#include "tools-common.h" static const struct option longopts[] = { { "help", no_argument, NULL, 'h' }, diff --git a/src/tools/gpioinfo.c b/src/tools/gpioinfo.c index 73dc4e5..bb17262 100644 --- a/src/tools/gpioinfo.c +++ b/src/tools/gpioinfo.c @@ -5,14 +5,14 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include +#include #include -#include "tools-common.h" - +#include #include #include -#include -#include -#include + +#include "tools-common.h" typedef bool (*is_set_func)(struct gpiod_line *); diff --git a/src/tools/gpiomon.c b/src/tools/gpiomon.c index 5dfb388..0d5fcbd 100644 --- a/src/tools/gpiomon.c +++ b/src/tools/gpiomon.c @@ -5,19 +5,19 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include +#include #include -#include "tools-common.h" - +#include +#include +#include #include #include -#include -#include #include -#include -#include -#include #include +#include "tools-common.h" + static const struct option longopts[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'v' }, diff --git a/src/tools/gpioset.c b/src/tools/gpioset.c index bbd9fd1..d9977a7 100644 --- a/src/tools/gpioset.c +++ b/src/tools/gpioset.c @@ -5,20 +5,20 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ +#include #include -#include "tools-common.h" - +#include +#include +#include +#include #include #include -#include #include -#include #include -#include -#include -#include #include +#include "tools-common.h" + static const struct option longopts[] = { { "help", no_argument, NULL, 'h' }, { "version", no_argument, NULL, 'v' }, diff --git a/src/tools/tools-common.c b/src/tools/tools-common.c index 4a7a776..527be1e 100644 --- a/src/tools/tools-common.c +++ b/src/tools/tools-common.c @@ -7,15 +7,15 @@ /* Common code for GPIO tools. */ +#include #include -#include "tools-common.h" - -#include +#include +#include #include +#include #include -#include -#include -#include + +#include "tools-common.h" const char * get_progname(void) { diff --git a/tests/gpiod-test.c b/tests/gpiod-test.c index 8083f1c..c673143 100644 --- a/tests/gpiod-test.c +++ b/tests/gpiod-test.c @@ -5,27 +5,27 @@ * Copyright (C) 2017-2018 Bartosz Golaszewski */ -#include "gpiod-test.h" - -#include -#include -#include +#include #include -#include #include -#include -#include #include #include #include +#include #include #include -#include +#include +#include +#include +#include +#include #include -#include #include +#include #include -#include +#include + +#include "gpiod-test.h" #define NORETURN __attribute__((noreturn)) #define MALLOC __attribute__((malloc)) diff --git a/tests/tests-chip.c b/tests/tests-chip.c index e199ce7..0acb5c7 100644 --- a/tests/tests-chip.c +++ b/tests/tests-chip.c @@ -7,10 +7,10 @@ /* Test cases for GPIO chip handling. */ -#include "gpiod-test.h" - -#include #include +#include + +#include "gpiod-test.h" static void chip_open_good(void) { diff --git a/tests/tests-ctxless.c b/tests/tests-ctxless.c index 4daab48..638274f 100644 --- a/tests/tests-ctxless.c +++ b/tests/tests-ctxless.c @@ -7,10 +7,10 @@ /* Test cases for the high-level API. */ -#include "gpiod-test.h" - #include +#include "gpiod-test.h" + static void ctxless_set_get_value(void) { int rv; diff --git a/tests/tests-event.c b/tests/tests-event.c index f91d80f..93e53a4 100644 --- a/tests/tests-event.c +++ b/tests/tests-event.c @@ -7,10 +7,10 @@ /* Test cases for GPIO line events. */ -#include "gpiod-test.h" - -#include #include +#include + +#include "gpiod-test.h" static void event_rising_edge_good(void) { diff --git a/tests/tests-gpiodetect.c b/tests/tests-gpiodetect.c index d7e7f20..bd5eeb1 100644 --- a/tests/tests-gpiodetect.c +++ b/tests/tests-gpiodetect.c @@ -7,10 +7,10 @@ /* Test cases for the gpiodetect program. */ -#include "gpiod-test.h" - #include +#include "gpiod-test.h" + static void gpiodetect_simple(void) { test_tool_run("gpiodetect", (char *)NULL); diff --git a/tests/tests-gpiofind.c b/tests/tests-gpiofind.c index a5a23fe..6d8e12a 100644 --- a/tests/tests-gpiofind.c +++ b/tests/tests-gpiofind.c @@ -7,10 +7,10 @@ /* Test cases for the gpiofind program. */ -#include "gpiod-test.h" - #include +#include "gpiod-test.h" + static void gpiofind_found(void) { test_tool_run("gpiofind", "gpio-mockup-B-7", (char *)NULL); diff --git a/tests/tests-gpioinfo.c b/tests/tests-gpioinfo.c index a7e592c..162896f 100644 --- a/tests/tests-gpioinfo.c +++ b/tests/tests-gpioinfo.c @@ -7,10 +7,10 @@ /* Test cases for the gpioinfo program. */ -#include "gpiod-test.h" - #include +#include "gpiod-test.h" + static void gpioinfo_dump_all_chips(void) { test_tool_run("gpioinfo", (char *)NULL); diff --git a/tests/tests-gpiomon.c b/tests/tests-gpiomon.c index 615b7d3..fd21391 100644 --- a/tests/tests-gpiomon.c +++ b/tests/tests-gpiomon.c @@ -7,11 +7,11 @@ /* Test cases for the gpiomon program. */ -#include "gpiod-test.h" - #include #include +#include "gpiod-test.h" + static void gpiomon_single_rising_edge_event(void) { test_tool_run("gpiomon", "--rising-edge", "--num-events=1", diff --git a/tests/tests-gpioset.c b/tests/tests-gpioset.c index 64ca99a..ab7b514 100644 --- a/tests/tests-gpioset.c +++ b/tests/tests-gpioset.c @@ -7,11 +7,11 @@ /* Test cases for the gpioset program. */ -#include "gpiod-test.h" - #include #include +#include "gpiod-test.h" + static void gpioset_set_lines_and_exit(void) { unsigned int offsets[8]; diff --git a/tests/tests-line.c b/tests/tests-line.c index 1385381..32b575a 100644 --- a/tests/tests-line.c +++ b/tests/tests-line.c @@ -7,10 +7,10 @@ /* GPIO line test cases. */ -#include "gpiod-test.h" - #include +#include "gpiod-test.h" + static void line_request_output(void) { TEST_CLEANUP_CHIP struct gpiod_chip *chip = NULL; diff --git a/tests/tests-misc.c b/tests/tests-misc.c index 89ec64a..99a80a7 100644 --- a/tests/tests-misc.c +++ b/tests/tests-misc.c @@ -7,10 +7,10 @@ /* Misc test cases. */ -#include "gpiod-test.h" - #include +#include "gpiod-test.h" + static void version_string(void) { /* Check that gpiod_version_string() returns an actual string. */