treewide: use C enum types explicitly
authorBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 30 Nov 2022 12:42:21 +0000 (13:42 +0100)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Wed, 7 Dec 2022 08:42:02 +0000 (09:42 +0100)
commite065ef962ab8cf7b66b62746abc9e0616db978bb
tree5bc92c52bf2cae3f8406fc095bc06f3bb424614b
parentee34050efbb3ad9c4f13c770954c3952b040f029
treewide: use C enum types explicitly

Use enum types explicitly across the entire C API. Modern compilers can
catch some bugs with enums and it also helps IDEs and general readability.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
[Viresh: make rust bindings work with negative enum values]
Co-authored-by: Viresh Kumar <viresh.kumar@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
29 files changed:
bindings/cxx/edge-event.cpp
bindings/cxx/info-event.cpp
bindings/cxx/internal.hpp
bindings/cxx/line-info.cpp
bindings/cxx/line-request.cpp
bindings/cxx/line-settings.cpp
bindings/cxx/tests/gpiosim.cpp
bindings/python/gpiod/ext/line-settings.c
bindings/python/gpiod/ext/request.c
bindings/rust/gpiosim-sys/src/lib.rs
bindings/rust/gpiosim-sys/src/sim.rs
bindings/rust/libgpiod/src/lib.rs
bindings/rust/libgpiod/src/line_info.rs
bindings/rust/libgpiod/src/line_settings.rs
include/gpiod.h
lib/edge-event.c
lib/info-event.c
lib/line-config.c
lib/line-info.c
lib/line-request.c
lib/line-settings.c
tests/gpiosim/gpiosim.c
tests/gpiosim/gpiosim.h
tests/tests-line-request.c
tools/gpioget.c
tools/gpiomon.c
tools/gpioset.c
tools/tools-common.c
tools/tools-common.h