From b0759696d15d24f9e82318d9c27cb794a4787c9c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 22 Apr 2022 18:16:49 -0400 Subject: 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. --- .includes.imp | 12 ++---------- bindings/cpp/include/pugl/pugl.hpp | 6 +++--- include/pugl/pugl.h | 5 ++++- src/x11.c | 1 - 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": [ "", "private", "", "public", ] }, { "include": [ "", "private", "", "public", ] }, - { "symbol": [ "bool", "private", "", "public" ] }, - { "symbol": [ "int32_t", "private", "", "public" ] }, - { "symbol": [ "int64_t", "private", "", "public" ] }, + { "symbol": [ "std::uintptr_t", "private", "", "public" ] }, { "symbol": [ "timespec", "private", "", "public" ] }, - { "symbol": [ "timeval", "private", "", "public" ] }, - { "symbol": [ "uint32_t", "private", "", "public" ] }, - { "symbol": [ "uint64_t", "private", "", "public" ] }, - { "symbol": [ "uint8_t", "private", "", "public" ] }, - { "symbol": [ "uintptr_t", "private", "", "public" ] }, - - { "symbol": [ "uintptr_t", "private", "", "public" ] } + { "symbol": [ "timeval", "private", "", "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 +#include // IWYU pragma: keep #if defined(PUGL_HPP_THROW_FAILED_CONSTRUCTION) # include @@ -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(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(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 #include #include +#ifndef __cplusplus +# include +#endif + #ifndef PUGL_API # if defined(_WIN32) && !defined(PUGL_STATIC) && defined(PUGL_INTERNAL) # define PUGL_API __declspec(dllexport) diff --git a/src/x11.c b/src/x11.c index 039c411..9504705 100644 --- a/src/x11.c +++ b/src/x11.c @@ -32,7 +32,6 @@ #endif #include -#include #include #include 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 #include -#include #include #include -- cgit v1.2.1