From 2218f747d70d4376a543cd3d680bea04003401de Mon Sep 17 00:00:00 2001
From: Florian Fischer <florian.fischer@muhq.space>
Date: Tue, 11 Jan 2022 20:55:10 +0100
Subject: [PATCH] [IoContext] fix types when tracking request in flight

The count used to track the requests is unsigned and negating it before
using it as long does not what we want.

Fixes: 799e505534f0dcda5412d538768edb0f2add5b6a
---
 emper/io/IoContext.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/emper/io/IoContext.cpp b/emper/io/IoContext.cpp
index 850a00bd..4f6d7464 100644
--- a/emper/io/IoContext.cpp
+++ b/emper/io/IoContext.cpp
@@ -334,7 +334,7 @@ auto IoContext::reapCompletionsLockless(Fiber **continuations) -> unsigned {
 
 	LOGD("got " << count << " cqes from worker " << worker->getWorkerId() << "'s io_uring");
 
-	trackReqsInUring(-count);
+	trackReqsInUring(-static_cast<long>(count));
 
 	// Reaps done by other worker threads are counted in the AbstractWorkStealingStats
 	// as stolenIoFibers.
@@ -469,7 +469,7 @@ reap_cqes:
 
 	LOGD("got " << count << " cqes from worker " << worker->getWorkerId() << "'s io_uring");
 
-	trackReqsInUring(-count);
+	trackReqsInUring(-static_cast<long>(count));
 
 	// Reaps done by other worker threads are counted in the AbstractWorkStealingStats
 	// as stolenIoFibers.
-- 
GitLab