From 496364fdbfcd20f3c25b275075aca26215e6b4a9 Mon Sep 17 00:00:00 2001 From: lbonn Date: Sat, 10 Apr 2021 14:17:00 +0200 Subject: [PATCH] ipc: return signed int for container positions If we use json as a language-agnostic representation, it makes sense to use proper signed integers here. --- RELEASE-NOTES-next | 2 ++ src/ipc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES-next b/RELEASE-NOTES-next index 928f276a1..2f3c28d7c 100644 --- a/RELEASE-NOTES-next +++ b/RELEASE-NOTES-next @@ -34,3 +34,5 @@ strongly encouraged to upgrade. • i3bar: exit with 1 when a wrong command line argument is used • fix commented-out rofi call in default i3 config • clear pixmap before drawing to prevent visual garbage + • ipc: return proper signed int for container positions: negative values were + returned as large 32 bits integers diff --git a/src/ipc.c b/src/ipc.c index 1ebe15d0e..a7ea84943 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -235,9 +235,9 @@ static void dump_rect(yajl_gen gen, const char *name, Rect r) { ystr(name); y(map_open); ystr("x"); - y(integer, r.x); + y(integer, (int32_t)r.x); ystr("y"); - y(integer, r.y); + y(integer, (int32_t)r.y); ystr("width"); y(integer, r.width); ystr("height");