diff options
author | David Robillard <d@drobilla.net> | 2022-04-22 18:16:49 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-04-23 21:19:22 -0400 |
commit | b0759696d15d24f9e82318d9c27cb794a4787c9c (patch) | |
tree | f3d01521770bb1195c940f0b32da4f81558e315b | |
parent | 7feb9000f640d9d6f05f5d0f80a2177db920af49 (diff) | |
download | pugl-b0759696d15d24f9e82318d9c27cb794a4787c9c.tar.gz pugl-b0759696d15d24f9e82318d9c27cb794a4787c9c.tar.bz2 pugl-b0759696d15d24f9e82318d9c27cb794a4787c9c.zip |
Fix IWYU warnings
I suspect that using the same configuration across both C and C++ is starting
to wear a bit thin, but this will do for now.
-rw-r--r-- | .includes.imp | 12 | ||||
-rw-r--r-- | bindings/cpp/include/pugl/pugl.hpp | 6 | ||||
-rw-r--r-- | include/pugl/pugl.h | 5 | ||||
-rw-r--r-- | src/x11.c | 1 | ||||
-rw-r--r-- | test/test_redisplay.c | 1 |
5 files changed, 9 insertions, 16 deletions
diff --git a/.includes.imp b/.includes.imp index 64472e0..f13dbd9 100644 --- a/.includes.imp +++ b/.includes.imp @@ -1,15 +1,7 @@ [ { "include": [ "<ext/alloc_traits.h>", "private", "<string>", "public", ] }, { "include": [ "<ext/alloc_traits.h>", "private", "<vector>", "public", ] }, - { "symbol": [ "bool", "private", "<stdbool.h>", "public" ] }, - { "symbol": [ "int32_t", "private", "<stdint.h>", "public" ] }, - { "symbol": [ "int64_t", "private", "<stdint.h>", "public" ] }, + { "symbol": [ "std::uintptr_t", "private", "<cstdint>", "public" ] }, { "symbol": [ "timespec", "private", "<time.h>", "public" ] }, - { "symbol": [ "timeval", "private", "<time.h>", "public" ] }, - { "symbol": [ "uint32_t", "private", "<stdint.h>", "public" ] }, - { "symbol": [ "uint64_t", "private", "<stdint.h>", "public" ] }, - { "symbol": [ "uint8_t", "private", "<stdint.h>", "public" ] }, - { "symbol": [ "uintptr_t", "private", "<stdint.h>", "public" ] }, - - { "symbol": [ "uintptr_t", "private", "<cstdint>", "public" ] } + { "symbol": [ "timeval", "private", "<time.h>", "public" ] } ] diff --git a/bindings/cpp/include/pugl/pugl.hpp b/bindings/cpp/include/pugl/pugl.hpp index 98b0108..743d37f 100644 --- a/bindings/cpp/include/pugl/pugl.hpp +++ b/bindings/cpp/include/pugl/pugl.hpp @@ -6,7 +6,7 @@ #include "pugl/pugl.h" -#include <cstdint> +#include <cstdint> // IWYU pragma: keep #if defined(PUGL_HPP_THROW_FAILED_CONSTRUCTION) # include <exception> @@ -599,7 +599,7 @@ public: @return #PUGL_FAILURE if timers are not supported by the system, #PUGL_UNKNOWN_ERROR if setting the timer failed. */ - Status startTimer(const uintptr_t id, const double timeout) noexcept + Status startTimer(const std::uintptr_t id, const double timeout) noexcept { return static_cast<Status>(puglStartTimer(cobj(), id, timeout)); } @@ -612,7 +612,7 @@ public: @return #PUGL_FAILURE if timers are not supported by this system, #PUGL_UNKNOWN_ERROR if stopping the timer failed. */ - Status stopTimer(const uintptr_t id) noexcept + Status stopTimer(const std::uintptr_t id) noexcept { return static_cast<Status>(puglStopTimer(cobj(), id)); } diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index ce796d1..4f30348 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -4,10 +4,13 @@ #ifndef PUGL_PUGL_H #define PUGL_PUGL_H -#include <stdbool.h> #include <stddef.h> #include <stdint.h> +#ifndef __cplusplus +# include <stdbool.h> +#endif + #ifndef PUGL_API # if defined(_WIN32) && !defined(PUGL_STATIC) && defined(PUGL_INTERNAL) # define PUGL_API __declspec(dllexport) @@ -32,7 +32,6 @@ #endif #include <sys/select.h> -#include <sys/time.h> #include <limits.h> #include <math.h> diff --git a/test/test_redisplay.c b/test/test_redisplay.c index cf30204..5a0de4d 100644 --- a/test/test_redisplay.c +++ b/test/test_redisplay.c @@ -15,7 +15,6 @@ #include <assert.h> #include <stdbool.h> -#include <stddef.h> #include <stdint.h> #include <stdio.h> |