spa: Fix sign conversion in SPA_IS_ALIGNED
Fix the following compiler warning: | In file included from /usr/include/spa-0.2/spa/utils/dict.h:14, | from ../src/util_pipewire_objects.c:15: | /usr/include/spa-0.2/spa/utils/defs.h: In function 'spa_ptr_inside_and_aligned': | /usr/include/spa-0.2/spa/utils/defs.h:275:56: error: conversion to 'long unsigned int' from 'long int' may change the sign of the result [-Werror=sign-conversion] | 275 | #define SPA_PTR_ALIGNMENT(p,align) ((intptr_t)(p) & ((align)-1)) | | ^ | /usr/include/spa-0.2/spa/utils/defs.h:276:42: note: in expansion of macro 'SPA_PTR_ALIGNMENT' | 276 | #define SPA_IS_ALIGNED(p,align) (SPA_PTR_ALIGNMENT(p,align) == 0) | | ^~~~~~~~~~~~~~~~~ | /usr/include/spa-0.2/spa/utils/defs.h:308:13: note: in expansion of macro 'SPA_IS_ALIGNED' | 308 | if (SPA_IS_ALIGNED(p2, align)) { | | ^~~~~~~~~~~~~~
This commit is contained in:
parent
e2d3f9140b
commit
3b01205585
|
@ -272,7 +272,7 @@ struct spa_fraction {
|
|||
})
|
||||
|
||||
|
||||
#define SPA_PTR_ALIGNMENT(p,align) ((intptr_t)(p) & ((align)-1))
|
||||
#define SPA_PTR_ALIGNMENT(p,align) ((uintptr_t)(p) & ((align)-1))
|
||||
#define SPA_IS_ALIGNED(p,align) (SPA_PTR_ALIGNMENT(p,align) == 0)
|
||||
#define SPA_PTR_ALIGN(p,align,type) ((type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align)))
|
||||
|
||||
|
|
Loading…
Reference in New Issue