From: martin-s Date: Mon, 5 Nov 2007 19:37:01 +0000 (+0000) Subject: Fixed this vs this_ X-Git-Tag: navit-0.5.0.5194svn~4615 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba6dc08efddde9fd5421c21b7dd8b9052e3b04a3;p=profile%2Fivi%2Fnavit.git Fixed this vs this_ git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@534 ffa7fe5e-494d-0410-b361-a75ebd5db220 --- diff --git a/navit/src/country.c b/navit/src/country.c index 7373f99..d764e4a 100644 --- a/navit/src/country.c +++ b/navit/src/country.c @@ -99,40 +99,40 @@ struct country_search { static int country_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr) { - struct country_search *this=priv_data; - struct country *country=this->country; + struct country_search *this_=priv_data; + struct country *country=this_->country; attr->type=attr_type; switch (attr_type) { case attr_any: - while (this->attr_next != attr_none) { - if (country_attr_get(this, this->attr_next, attr)) + while (this_->attr_next != attr_none) { + if (country_attr_get(this_, this_->attr_next, attr)) return 1; } return 0; case attr_label: attr->u.str=gettext(country->name); - this->attr_next=attr_country_id; + this_->attr_next=attr_country_id; return 1; case attr_country_id: attr->u.num=country->id; - this->attr_next=country->car ? attr_country_car : attr_country_iso2; + this_->attr_next=country->car ? attr_country_car : attr_country_iso2; return 1; case attr_country_car: attr->u.str=country->car; - this->attr_next=attr_country_iso2; + this_->attr_next=attr_country_iso2; return attr->u.str ? 1 : 0; case attr_country_iso2: attr->u.str=country->iso2; - this->attr_next=attr_country_iso3; + this_->attr_next=attr_country_iso3; return 1; case attr_country_iso3: attr->u.str=country->iso3; - this->attr_next=attr_country_name; + this_->attr_next=attr_country_name; return 1; case attr_country_name: attr->u.str=gettext(country->name); - this->attr_next=attr_none; + this_->attr_next=attr_none; return 1; default: return 0; @@ -170,36 +170,36 @@ country_search_new(struct attr *search, int partial) } static int -match(struct country_search *this, enum attr_type type, const char *name) +match(struct country_search *this_, enum attr_type type, const char *name) { int ret; if (!name) return 0; - if (this->search.type != type && this->search.type != attr_country_all) + if (this_->search.type != type && this_->search.type != attr_country_all) return 0; - if (this->partial) - ret=(strncasecmp(this->search.u.str, name, this->len) == 0); + if (this_->partial) + ret=(strncasecmp(this_->search.u.str, name, this_->len) == 0); else - ret=(strcasecmp(this->search.u.str, name) == 0); + ret=(strcasecmp(this_->search.u.str, name) == 0); return ret; } struct item * -country_search_get_item(struct country_search *this) +country_search_get_item(struct country_search *this_) { for (;;) { - if (this->count >= sizeof(country)/sizeof(struct country)) + if (this_->count >= sizeof(country)/sizeof(struct country)) return NULL; - this->country=&country[this->count++]; - if ((this->search.type == attr_country_id && this->search.u.num == this->country->id) || - match(this, attr_country_iso3, this->country->iso3) || - match(this, attr_country_iso2, this->country->iso2) || - match(this, attr_country_car, this->country->car) || - match(this, attr_country_name, gettext(this->country->name))) { - this->item.id_lo=this->country->id; - return &this->item; + this_->country=&country[this_->count++]; + if ((this_->search.type == attr_country_id && this_->search.u.num == this_->country->id) || + match(this_, attr_country_iso3, this_->country->iso3) || + match(this_, attr_country_iso2, this_->country->iso2) || + match(this_, attr_country_car, this_->country->car) || + match(this_, attr_country_name, gettext(this_->country->name))) { + this_->item.id_lo=this_->country->id; + return &this_->item; } } } @@ -223,7 +223,7 @@ country_default(void) } void -country_search_destroy(struct country_search *this) +country_search_destroy(struct country_search *this_) { - g_free(this); + g_free(this_); } diff --git a/navit/src/country.h b/navit/src/country.h index 465c305..8e435f3 100644 --- a/navit/src/country.h +++ b/navit/src/country.h @@ -10,9 +10,9 @@ struct attr; struct country_search; struct item; struct country_search *country_search_new(struct attr *search, int partial); -struct item *country_search_get_item(struct country_search *this); +struct item *country_search_get_item(struct country_search *this_); struct attr *country_default(void); -void country_search_destroy(struct country_search *this); +void country_search_destroy(struct country_search *this_); /* end of prototypes */ #ifdef __cplusplus