aboutsummaryrefslogtreecommitdiff
path: root/src/mm-error-helpers.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-30 18:54:23 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-31 15:18:35 +0100
commitbbeabb495e1bd2df3d938b850fbce4e61a61d9fa (patch)
treec2074f172166da03b5a20a4044a1ac2759523b2c /src/mm-error-helpers.c
parentb856f3625db670346a248967a53d6d0119e725b7 (diff)
helpers: new macro to CLAMP high threshold only
Useful when clamping a unsigned integer with low threshold set to 0, which would give us compiler warnings with -Wtype-limits when using CLAMP(), e.g.: via/mm-broadband-modem-via.c: In function ‘handle_evdo_quality_change’: /usr/include/glib-2.0/glib/gmacros.h:811:63: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits] 811 | #define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) | ^ via/mm-broadband-modem-via.c:284:19: note: in expansion of macro ‘CLAMP’ 284 | quality = CLAMP (quality, 0, 100); | ^~~~~
Diffstat (limited to 'src/mm-error-helpers.c')
0 files changed, 0 insertions, 0 deletions