+ continue; /* Array is empty, no need to initialize contents */
+ }
+
+ /* Initialize field contents to default value */
+ if (PB_HTYPE(iter.current->type) == PB_HTYPE_CALLBACK)
+ {
+ continue; /* Don't overwrite callback */
+ }
+ else if (PB_LTYPE(iter.current->type) == PB_LTYPE_SUBMESSAGE)
+ {
+ pb_message_set_to_defaults(iter.current->ptr, iter.pData);
+ }
+ else if (iter.current->ptr != NULL)
+ {
+ memcpy(iter.pData, iter.current->ptr, iter.current->data_size);
+ }
+ else
+ {
+ memset(iter.pData, 0, iter.current->data_size);