From 112f9fef0e9fb5c89021ca45b5b505e050a378a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Vavrus=CC=8Ca?= Date: Thu, 11 Jan 2018 22:01:34 -0800 Subject: [PATCH] lib/defines: analyzable implementation for kr_error() --- lib/defines.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/defines.h b/lib/defines.h index 9fd45b6bd..958513728 100644 --- a/lib/defines.h +++ b/lib/defines.h @@ -47,7 +47,7 @@ typedef unsigned int uint; #define kr_ok() 0 /* Mark as cold to mark all branches as unlikely. */ static inline int KR_COLD kr_error(int x) { - return -abs(x); + return x <= 0 ? x : -x; } #define kr_strerror(x) strerror(abs(x)) -- 2.47.3