diff --git a/upb/mini_descriptor/decode.c b/upb/mini_descriptor/decode.c index c916f98c5a85..545f40c25434 100644 --- a/upb/mini_descriptor/decode.c +++ b/upb/mini_descriptor/decode.c @@ -49,15 +49,17 @@ typedef enum { kUpb_LayoutItemType_Max = kUpb_LayoutItemType_Field, } upb_LayoutItemType; -#define kUpb_LayoutItem_IndexSentinel ((uint16_t) - 1) +#define kUpb_LayoutItem_IndexSentinel ((uint16_t)-1) typedef struct { // Index of the corresponding field. When this is a oneof field, the field's // offset will be the index of the next field in a linked list. uint16_t field_index; uint16_t offset; - upb_FieldRep rep; - upb_LayoutItemType type; + // These two enums are stored in bytes to avoid trailing padding while + // preserving two-byte alignment. + uint8_t /* upb_FieldRep*/ rep; + uint8_t /* upb_LayoutItemType*/ type; } upb_LayoutItem; typedef struct {