summaryrefslogtreecommitdiff
path: root/upb/msg.c
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-12-22 11:37:01 -0800
committerJoshua Haberman <jhaberman@gmail.com>2011-12-22 11:37:01 -0800
commit1bcab1377de6afe8c0f9c895cdba04baacf3e4a5 (patch)
tree4d478ccff5da0dee3c217c01f815ee1764965501 /upb/msg.c
parentb5f5ee867e6c91b77490dc8894236f17a47bde00 (diff)
Sync with internal Google development.
This breaks the open-source build, will follow up with a change to fix it.
Diffstat (limited to 'upb/msg.c')
-rw-r--r--upb/msg.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/upb/msg.c b/upb/msg.c
index 78309cf..77521e5 100644
--- a/upb/msg.c
+++ b/upb/msg.c
@@ -86,14 +86,16 @@ void upb_stdmsg_sethas(void *_m, upb_value fval) {
assert(_m != NULL);
char *m = _m;
const upb_fielddef *f = upb_value_getfielddef(fval);
- if (f->hasbit >= 0) m[f->hasbit / 8] |= (1 << (f->hasbit % 8));
+ if (f->hasbit >= 0)
+ m[(uint32_t)f->hasbit / 8] |= (1 << ((uint32_t)f->hasbit % 8));
}
bool upb_stdmsg_has(const void *_m, upb_value fval) {
assert(_m != NULL);
const char *m = _m;
const upb_fielddef *f = upb_value_getfielddef(fval);
- return f->hasbit < 0 || (m[f->hasbit / 8] & (1 << (f->hasbit % 8)));
+ return f->hasbit < 0 ||
+ (m[(uint32_t)f->hasbit / 8] & (1 << ((uint32_t)f->hasbit % 8)));
}
#define UPB_ACCESSORS(type, ctype) \
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback