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:
Petteri Aimonen
2013-02-20 21:58:18 +02:00
parent 258ba8335d
commit 69085d9387
5 changed files with 103 additions and 313 deletions

View File

@@ -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;