diff --git a/include/ntfs-3g/endians.h b/include/ntfs-3g/endians.h index f7eb6c4f..b93761d3 100644 --- a/include/ntfs-3g/endians.h +++ b/include/ntfs-3g/endians.h @@ -264,36 +264,36 @@ /* Constant endianness conversion defines. */ -#define const_le16_to_cpu(x) __constant_le16_to_cpu(x) -#define const_le32_to_cpu(x) __constant_le32_to_cpu(x) -#define const_le64_to_cpu(x) __constant_le64_to_cpu(x) +#define const_le16_to_cpu(x) ((u16) __constant_le16_to_cpu(x)) +#define const_le32_to_cpu(x) ((u32) __constant_le32_to_cpu(x)) +#define const_le64_to_cpu(x) ((u64) __constant_le64_to_cpu(x)) -#define const_cpu_to_le16(x) __constant_cpu_to_le16(x) -#define const_cpu_to_le32(x) __constant_cpu_to_le32(x) -#define const_cpu_to_le64(x) __constant_cpu_to_le64(x) +#define const_cpu_to_le16(x) ((le16) __constant_cpu_to_le16(x)) +#define const_cpu_to_le32(x) ((le32) __constant_cpu_to_le32(x)) +#define const_cpu_to_le64(x) ((le64) __constant_cpu_to_le64(x)) -#define const_sle16_to_cpu(x) __constant_le16_to_cpu((le16) x) -#define const_sle32_to_cpu(x) __constant_le32_to_cpu((le32) x) -#define const_sle64_to_cpu(x) __constant_le64_to_cpu((le64) x) +#define const_sle16_to_cpu(x) ((s16) __constant_le16_to_cpu((le16) x)) +#define const_sle32_to_cpu(x) ((s32) __constant_le32_to_cpu((le32) x)) +#define const_sle64_to_cpu(x) ((s64) __constant_le64_to_cpu((le64) x)) -#define const_cpu_to_sle16(x) __constant_cpu_to_le16((u16) x) -#define const_cpu_to_sle32(x) __constant_cpu_to_le32((u32) x) -#define const_cpu_to_sle64(x) __constant_cpu_to_le64((u64) x) +#define const_cpu_to_sle16(x) ((sle16) __constant_cpu_to_le16((u16) x)) +#define const_cpu_to_sle32(x) ((sle32) __constant_cpu_to_le32((u32) x)) +#define const_cpu_to_sle64(x) ((sle64) __constant_cpu_to_le64((u64) x)) -#define const_be16_to_cpu(x) __constant_be16_to_cpu(x) -#define const_be32_to_cpu(x) __constant_be32_to_cpu(x) -#define const_be64_to_cpu(x) __constant_be64_to_cpu(x) +#define const_be16_to_cpu(x) ((u16) __constant_be16_to_cpu(x))) +#define const_be32_to_cpu(x) ((u32) __constant_be32_to_cpu(x))) +#define const_be64_to_cpu(x) ((u64) __constant_be64_to_cpu(x))) -#define const_cpu_to_be16(x) __constant_cpu_to_be16(x) -#define const_cpu_to_be32(x) __constant_cpu_to_be32(x) -#define const_cpu_to_be64(x) __constant_cpu_to_be64(x) +#define const_cpu_to_be16(x) ((be16) __constant_cpu_to_be16(x)) +#define const_cpu_to_be32(x) ((be32) __constant_cpu_to_be32(x)) +#define const_cpu_to_be64(x) ((be64) __constant_cpu_to_be64(x)) -#define const_sbe16_to_cpu(x) __constant_be16_to_cpu((be16) x) -#define const_sbe32_to_cpu(x) __constant_be32_to_cpu((be32) x) -#define const_sbe64_to_cpu(x) __constant_be64_to_cpu((be64) x) +#define const_sbe16_to_cpu(x) ((s16) __constant_be16_to_cpu((be16) x)) +#define const_sbe32_to_cpu(x) ((s32) __constant_be32_to_cpu((be32) x)) +#define const_sbe64_to_cpu(x) ((s64) __constant_be64_to_cpu((be64) x)) -#define const_cpu_to_sbe16(x) __constant_cpu_to_be16((u16) x) -#define const_cpu_to_sbe32(x) __constant_cpu_to_be32((u32) x) -#define const_cpu_to_sbe64(x) __constant_cpu_to_be64((u64) x) +#define const_cpu_to_sbe16(x) ((sbe16) __constant_cpu_to_be16((u16) x)) +#define const_cpu_to_sbe32(x) ((sbe32) __constant_cpu_to_be32((u32) x)) +#define const_cpu_to_sbe64(x) ((sbe64) __constant_cpu_to_be64((u64) x)) #endif /* defined _NTFS_ENDIANS_H */