Refactoring the field encoder interface.

Replaced the confusing pb_enc_* functions with new pb_encode_* functions that
have a cleaner interface. Updated documentation.

Got rid of the endian_copy stuff in pb_encode.c, instead using C casts to do it automatically.
This makes the code safer and also reduces binary size by about 5%.

Fixes Issue 6.
This commit is contained in:
Petteri Aimonen
2012-03-01 13:46:52 +02:00
parent 0cdc623050
commit 9fbe9a5de3
6 changed files with 196 additions and 190 deletions

View File

@@ -38,7 +38,7 @@ bool listdir_callback(pb_ostream_t *stream, const pb_field_t *field, const void
if (!pb_encode_tag_for_field(stream, field))
return false;
if (!pb_enc_submessage(stream, field, &fileinfo))
if (!pb_encode_submessage(stream, FileInfo_fields, &fileinfo))
return false;
}