From 8efee5bc91e37eaed81d6f70b71c2720e208987c Mon Sep 17 00:00:00 2001 From: mox Date: Mon, 24 Apr 2017 12:43:03 +0200 Subject: [PATCH 1/2] Fixing member data type for rect_t to uin32_t as the geometry type in xcb seems to consist of unsigned 32-bit integral numbers. --- include/i3ipc++/ipc.hpp | 8 ++++---- src/ipc.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/i3ipc++/ipc.hpp b/include/i3ipc++/ipc.hpp index daa84bb..0d76a4d 100644 --- a/include/i3ipc++/ipc.hpp +++ b/include/i3ipc++/ipc.hpp @@ -28,10 +28,10 @@ std::string get_socketpath(); * Primitive of rectangle */ struct rect_t { - int x; ///< Position on X axis - int y; ///< Position on Y axis - int width; ///< Width of rectangle - int height; ///< Height of rectangle + uint32_t x; ///< Position on X axis + uint32_t y; ///< Position on Y axis + uint32_t width; ///< Width of rectangle + uint32_t height; ///< Height of rectangle }; /** diff --git a/src/ipc.cpp b/src/ipc.cpp index ecd823a..7bc13a7 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -42,10 +42,10 @@ std::vector g_logging_err_outs = { inline rect_t parse_rect_from_json(const Json::Value& value) { return { - .x = value["x"].asInt(), - .y = value["y"].asInt(), - .width = value["width"].asInt(), - .height = value["height"].asInt(), + .x = value["x"].asUInt(), + .y = value["y"].asUInt(), + .width = value["width"].asUInt(), + .height = value["height"].asUInt(), }; } From a26459f4ec595f68cd830f28df63a4a434676de7 Mon Sep 17 00:00:00 2001 From: mox Date: Thu, 27 Apr 2017 17:36:19 +0200 Subject: [PATCH 2/2] Changed compile options for i3ipcpp target to private, so code using it can use newer standards. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a34c5e2..404e9e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ target_link_libraries(i3ipc++ ) target_compile_options(i3ipc++ - PUBLIC -std=c++11 -Wall -Wextra -Wno-unused-parameter + PRIVATE -std=c++11 -Wall -Wextra -Wno-unused-parameter ) target_compile_definitions(i3ipc++