diff options
author | Philip Withnall <pwithnall@gnome.org> | 2023-12-04 12:49:20 +0000 |
---|---|---|
committer | Philip Withnall <pwithnall@gnome.org> | 2023-12-04 12:49:20 +0000 |
commit | b17a65bc945e32e23f02d6bcfeee3ff4b7abc27a (patch) | |
tree | 81fd94ca532aef86be2352f1c59281904d48aa7c | |
parent | 7894bf3f6f80bc08321655a55af73e4ea2bf1998 (diff) |
xdgmimecache: Clarify operator precedence in OUT_OF_BOUNDS macro
If the arguments are expressions rather than single variables, the
compiler spews warnings suggesting to add parentheses to clarify
operator precedence between `+` and `&` operators.
Add those parentheses.
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
-rw-r--r-- | src/xdgmimecache.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xdgmimecache.c b/src/xdgmimecache.c index 5677481..6d89f10 100644 --- a/src/xdgmimecache.c +++ b/src/xdgmimecache.c @@ -81,7 +81,7 @@ struct _XdgMimeCache // a 4-byte boundary, and that offset+(n*record_size) does not overflow. // `record_size` values are known constants and never 0. #define OUT_OF_BOUNDS(offset,n,record_size,max) \ - ((offset & 0x3) || offset > max || n > (max - offset) / record_size) + (((offset) & 0x3) || (offset) > (max) || (n) > ((max) - (offset)) / (record_size)) XdgMimeCache * _xdg_mime_cache_ref (XdgMimeCache *cache) |