diff --git a/upb/decode.c b/upb/decode.c
index cecd68a8e74..d1eec474dfd 100644
--- a/upb/decode.c
+++ b/upb/decode.c
@@ -222,7 +222,7 @@ static void decode_munge(int type, wireval *val) {
 
 static const upb_msglayout_field *upb_find_field(const upb_msglayout *l,
                                                  uint32_t field_number) {
-  static upb_msglayout_field none = {0};
+  static upb_msglayout_field none = {0, 0, 0, 0, 0, 0};
 
   /* Lots of optimization opportunities here. */
   int i;
diff --git a/upb/msg.h b/upb/msg.h
index 1ded2cf3e25..b321748ec05 100644
--- a/upb/msg.h
+++ b/upb/msg.h
@@ -141,7 +141,7 @@ UPB_INLINE uint32_t _upb_getoneofcase(const void *msg, size_t case_ofs) {
 
 UPB_INLINE size_t _upb_oneofcase_ofs(const upb_msglayout_field *f) {
   UPB_ASSERT(f->presence < 0);
-  return ~(int64_t)f->presence;
+  return ~(ptrdiff_t)f->presence;
 }
 
 UPB_INLINE uint32_t *_upb_oneofcase_field(upb_msg *msg,