summaryrefslogtreecommitdiff
path: root/src/upb_data.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/upb_data.h')
-rw-r--r--src/upb_data.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/upb_data.h b/src/upb_data.h
index 2a7940e..6dc343b 100644
--- a/src/upb_data.h
+++ b/src/upb_data.h
@@ -374,14 +374,14 @@ void _upb_array_free(upb_array *a, struct upb_fielddef *f);
INLINE union upb_value_ptr _upb_array_getptr(upb_array *a,
struct upb_fielddef *f,
upb_arraylen_t elem) {
- assert(elem < upb_array_len(a));
size_t type_size = upb_type_info[f->type].size;
union upb_value_ptr p = {._void = &a->common.elements.uint8[elem * type_size]};
return p;
}
INLINE union upb_value upb_array_get(upb_array *a, struct upb_fielddef *f,
- int elem) {
+ upb_arraylen_t elem) {
+ assert(elem < upb_array_len(a));
return upb_value_read(_upb_array_getptr(a, f, elem), f->type);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback