Rename PB_HTYPE_ARRAY -> PB_HTYPE_REPEATED.
This is a more logical name in parallel with PB_HTYPE_REQUIRED and PB_HTYPE_OPTIONAL. Warning: This breaks backwards-compatibility of generated .pb.c files. You will have to regenerate the files and recompile.
This commit is contained in:
@@ -167,7 +167,7 @@ bool checkreturn pb_encode(pb_ostream_t *stream, const pb_field_t fields[], cons
|
||||
pSize = (const char*)pData + field->size_offset;
|
||||
|
||||
prev_size = field->data_size;
|
||||
if (PB_HTYPE(field->type) == PB_HTYPE_ARRAY)
|
||||
if (PB_HTYPE(field->type) == PB_HTYPE_REPEATED)
|
||||
prev_size *= field->array_size;
|
||||
|
||||
switch (PB_HTYPE(field->type))
|
||||
@@ -190,7 +190,7 @@ bool checkreturn pb_encode(pb_ostream_t *stream, const pb_field_t fields[], cons
|
||||
}
|
||||
break;
|
||||
|
||||
case PB_HTYPE_ARRAY:
|
||||
case PB_HTYPE_REPEATED:
|
||||
if (!encode_array(stream, field, pData, *(const size_t*)pSize, func))
|
||||
return false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user