Returns min(x + y, UBOUNDED_MAX) */
| 13 | |
| 14 | /* Returns min(x + y, UBOUNDED_MAX) */ |
| 15 | static inline ubounded bounded_add(ubounded x, ubounded y) { |
| 16 | return UBOUNDED_MAX < x ? UBOUNDED_MAX |
| 17 | : UBOUNDED_MAX - x < y ? UBOUNDED_MAX |
| 18 | : x + y; |
| 19 | } |
| 20 | |
| 21 | /* *x = min(*x + 1, UBOUNDED_MAX) */ |
| 22 | static inline void bounded_inc(ubounded* x) { |
no outgoing calls
no test coverage detected