… | |
… | |
105 | /* put into if's if you are very sure that the expression */ |
105 | /* put into if's if you are very sure that the expression */ |
106 | /* is mostly true or mostly false. note that these return */ |
106 | /* is mostly true or mostly false. note that these return */ |
107 | /* booleans, not the expression. */ |
107 | /* booleans, not the expression. */ |
108 | #define ecb_expect_false(expr) ecb_expect (!!(expr), 0) |
108 | #define ecb_expect_false(expr) ecb_expect (!!(expr), 0) |
109 | #define ecb_expect_true(expr) ecb_expect (!!(expr), 1) |
109 | #define ecb_expect_true(expr) ecb_expect (!!(expr), 1) |
|
|
110 | /* for compatibility to the rest of the world */ |
110 | #define ecb_likely(expr) ecb_expect_true (expr) |
111 | #define ecb_likely(expr) ecb_expect_true (expr) |
111 | #define ecb_unlikely(expr) ecb_expect_false (expr) |
112 | #define ecb_unlikely(expr) ecb_expect_false (expr) |
112 | |
113 | |
113 | /* try to tell the compiler that some condition is definitely true */ |
114 | /* try to tell the compiler that some condition is definitely true */ |
114 | #define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0) |
115 | #define ecb_assume(cond) do { if (!(cond)) ecb_unreachable (); } while (0) |