summaryrefslogtreecommitdiffstats
path: root/pb.h
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-09-03 17:35:14 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-09-03 17:35:14 +0300
commitb214de4e1e53f14354db36b8f199db6177a63744 (patch)
tree5b45b98c14a59d075d3ab939efc13ecb1ab9f8e5 /pb.h
parentbe78e3b4d0ff9839817b0eeef5d3e75056b53af1 (diff)
Enable -Wconversion for core and fix the warnings.
This should help avoid issue 33 in the future.
Diffstat (limited to 'pb.h')
-rw-r--r--pb.h9
1 files changed, 6 insertions, 3 deletions
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.