@@ -1199,26 +1199,36 @@ PB_API const pb_Name *pb_oneofname(const pb_Type *t, int idx) {
1199
1199
}
1200
1200
1201
1201
PB_API int pb_nexttype (const pb_State * S , const pb_Type * * ptype ) {
1202
- const pb_TypeEntry * e = NULL ;
1203
1202
if (S != NULL ) {
1204
- if (* ptype != NULL )
1205
- e = (pb_TypeEntry * )pb_gettable (& S -> types , (pb_Key )(* ptype )-> name );
1206
- while (pb_nextentry (& S -> types , (const pb_Entry * * )& e ))
1203
+ const pb_Entry * ent = NULL ;
1204
+ if (* ptype != NULL ) {
1205
+ const pb_TypeEntry * e = (pb_TypeEntry * )
1206
+ pb_gettable (& S -> types , (pb_Key )(* ptype )-> name );
1207
+ ent = & e -> entry ;
1208
+ }
1209
+ while (pb_nextentry (& S -> types , & ent )) {
1210
+ const pb_TypeEntry * e = (pb_TypeEntry * )ent ;
1207
1211
if ((* ptype = e -> value ) != NULL && !(* ptype )-> is_dead )
1208
1212
return 1 ;
1213
+ }
1209
1214
}
1210
1215
* ptype = NULL ;
1211
1216
return 0 ;
1212
1217
}
1213
1218
1214
1219
PB_API int pb_nextfield (const pb_Type * t , const pb_Field * * pfield ) {
1215
- const pb_FieldEntry * e = NULL ;
1216
1220
if (t != NULL ) {
1217
- if (* pfield != NULL )
1218
- e = (pb_FieldEntry * )pb_gettable (& t -> field_tags , (* pfield )-> number );
1219
- while (pb_nextentry (& t -> field_tags , (const pb_Entry * * )& e ))
1221
+ const pb_Entry * ent = NULL ;
1222
+ if (* pfield != NULL ) {
1223
+ const pb_FieldEntry * e = (pb_FieldEntry * )
1224
+ pb_gettable (& t -> field_tags , (* pfield )-> number );
1225
+ ent = & e -> entry ;
1226
+ }
1227
+ while (pb_nextentry (& t -> field_tags , & ent )) {
1228
+ const pb_FieldEntry * e = (pb_FieldEntry * )ent ;
1220
1229
if ((* pfield = e -> value ) != NULL )
1221
1230
return 1 ;
1231
+ }
1222
1232
}
1223
1233
* pfield = NULL ;
1224
1234
return 0 ;
0 commit comments