From 64ddbc3c6172beec9861cad00bd936a2430d7544 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 18 Aug 2016 17:12:42 -0300 Subject: [PATCH] eeshow/misc/util.h (sign1): return sign of argument, return 1 for 0 --- eeshow/misc/util.h | 1 + 1 file changed, 1 insertion(+) diff --git a/eeshow/misc/util.h b/eeshow/misc/util.h index d0c5610..657c6d0 100644 --- a/eeshow/misc/util.h +++ b/eeshow/misc/util.h @@ -46,6 +46,7 @@ #define swap(a, b) \ ({ typeof(a) _tmp = (a); a = (b); b = _tmp; }) +#define sign1(x) ((x) < 0 ? -1 : 1) #define unsupported(s) \ fprintf(stderr, __FILE__ ":%d: unsupported: " s "\n", __LINE__)