From b214de4e1e53f14354db36b8f199db6177a63744 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Mon, 3 Sep 2012 17:35:14 +0300 Subject: Enable -Wconversion for core and fix the warnings. This should help avoid issue 33 in the future. --- pb.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pb.h') diff --git a/pb.h b/pb.h index f894a9a5..dce8df30 100644 --- a/pb.h +++ b/pb.h @@ -75,6 +75,7 @@ typedef enum { /* Number of declared LTYPES */ PB_LTYPES_COUNT = 7, + PB_LTYPE_MASK = 0x0F, /****************** * Modifier flags * @@ -95,11 +96,13 @@ typedef enum { * data_offset points to pb_callback_t structure. * LTYPE should be 0 (it is ignored, but sometimes * used to speculatively index an array). */ - PB_HTYPE_CALLBACK = 0x30 + PB_HTYPE_CALLBACK = 0x30, + + PB_HTYPE_MASK = 0xF0 } pb_packed pb_type_t; -#define PB_HTYPE(x) ((x) & 0xF0) -#define PB_LTYPE(x) ((x) & 0x0F) +#define PB_HTYPE(x) ((x) & PB_HTYPE_MASK) +#define PB_LTYPE(x) ((x) & PB_LTYPE_MASK) /* This structure is used in auto-generated constants * to specify struct fields. -- cgit 1.2.3-korg