diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-12-22 11:37:01 -0800 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-12-22 11:37:01 -0800 |
commit | 1bcab1377de6afe8c0f9c895cdba04baacf3e4a5 (patch) | |
tree | 4d478ccff5da0dee3c217c01f815ee1764965501 /upb/msg.c | |
parent | b5f5ee867e6c91b77490dc8894236f17a47bde00 (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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) \ |