Merge pull request #194 from veblush/conversion-warning

Added explicit type casting to char
pull/13171/head
Nicolas Noble 5 years ago committed by GitHub
commit 423ea5ca9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      upb/generated_util.h

@ -87,11 +87,11 @@ UPB_INLINE bool _upb_has_field(const void *msg, size_t idx) {
}
UPB_INLINE bool _upb_sethas(const void *msg, size_t idx) {
return (*PTR_AT(msg, idx / 8, char)) |= (1 << (idx % 8));
return (*PTR_AT(msg, idx / 8, char)) |= (char)(1 << (idx % 8));
}
UPB_INLINE bool _upb_clearhas(const void *msg, size_t idx) {
return (*PTR_AT(msg, idx / 8, char)) &= ~(1 << (idx % 8));
return (*PTR_AT(msg, idx / 8, char)) &= (char)(~(1 << (idx % 8)));
}
UPB_INLINE bool _upb_has_oneof_field(const void *msg, size_t case_ofs, int32_t num) {

Loading…
Cancel
Save