clang complains with:
fsys_zfs.c:826:2: error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
VERIFY_DN_TYPE(dn, DMU_OT_PLAIN_FILE_CONTENTS);
^
/wrkdirs/usr/ports/sysutils/xen-tools/work/xen-4.13.0/tools/libfsimage/zfs/../../../tools/libfsimage/zfs/fsys_zfs.h:74:11: note: expanded from macro 'VERIFY_DN_TYPE'
if (type && (dnp)->dn_type != type) { \
^
1 error generated.
Fix this by not forcing an implicit conversion of the enum into a
boolean and instead comparing with the 0 enumerator.
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
* Can only be used in functions returning non-0 for failure.
*/
#define VERIFY_DN_TYPE(dnp, type) \
- if (type && (dnp)->dn_type != type) { \
+ if (type != DMU_OT_NONE && (dnp)->dn_type != type) { \
return (ERR_FSYS_CORRUPT); \
}
* Can only be used in functions returning 0 for failure.
*/
#define VERIFY_OS_TYPE(osp, type) \
- if (type && (osp)->os_type != type) { \
+ if (type != DMU_OST_NONE && (osp)->os_type != type) { \
errnum = ERR_FSYS_CORRUPT; \
return (0); \
}