]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
lib/defines: analyzable implementation for kr_error()
authorMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 12 Jan 2018 06:01:34 +0000 (22:01 -0800)
committerMarek Vavruša <mvavrusa@cloudflare.com>
Fri, 12 Jan 2018 06:04:18 +0000 (22:04 -0800)
lib/defines.h

index 9fd45b6bd9fdbaa37d8c8b2fe1ccd953ae53b228..9585137286bb451e1753ecb66b1f15cf71491013 100644 (file)
@@ -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))