[fix] enum value conflicted with existing name
This commit is contained in:
@@ -500,7 +500,7 @@ bool geonames_generic_serialize(geonames_generic_t *gn, char_array *str) {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gn->type == GEONAMES_NAME) {
|
if (gn->type == GEONAMES_PLACE) {
|
||||||
return geoname_serialize_ctx(gn->geoname, &ctx);
|
return geoname_serialize_ctx(gn->geoname, &ctx);
|
||||||
} else if (gn->type == GEONAMES_POSTAL_CODE) {
|
} else if (gn->type == GEONAMES_POSTAL_CODE) {
|
||||||
return gn_postal_code_serialize_ctx(gn->postal_code, &ctx);
|
return gn_postal_code_serialize_ctx(gn->postal_code, &ctx);
|
||||||
@@ -522,7 +522,7 @@ bool geonames_generic_deserialize(gn_type *type, geoname_t *geoname, gn_postal_c
|
|||||||
|
|
||||||
*type = geonames_type;
|
*type = geonames_type;
|
||||||
|
|
||||||
if (geonames_type == GEONAMES_NAME) {
|
if (geonames_type == GEONAMES_PLACE) {
|
||||||
return geoname_deserialize_ctx(geoname, &ctx);
|
return geoname_deserialize_ctx(geoname, &ctx);
|
||||||
} else if (geonames_type == GEONAMES_POSTAL_CODE) {
|
} else if (geonames_type == GEONAMES_POSTAL_CODE) {
|
||||||
return gn_postal_code_deserialize_ctx(postal_code, &ctx);
|
return gn_postal_code_deserialize_ctx(postal_code, &ctx);
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ void gn_postal_code_clear(gn_postal_code_t *self);
|
|||||||
void gn_postal_code_destroy(gn_postal_code_t *self);
|
void gn_postal_code_destroy(gn_postal_code_t *self);
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
GEONAMES_NAME,
|
GEONAMES_PLACE,
|
||||||
GEONAMES_POSTAL_CODE
|
GEONAMES_POSTAL_CODE
|
||||||
} gn_type;
|
} gn_type;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user