summaryrefslogtreecommitdiff
path: root/navit/country.c
diff options
context:
space:
mode:
authorsleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:26:52 +0000
committersleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>2013-08-11 20:26:52 +0000
commitc6dfffde863c67b6aba949497fbbde6c3b510ab9 (patch)
treeab45f2f2b318f03597ab33c9e452c1cfecd91947 /navit/country.c
parent63a714dd35d7b62ef37b959c6ce7a01df91df2e3 (diff)
downloadnavit-c6dfffde863c67b6aba949497fbbde6c3b510ab9.tar.gz
Fix:core:Fix last const warnings by casting. Ugly, but the best solution right now.|Concludes #1154. Now we build without warnings under -Wall, yeah!
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@5574 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/country.c')
-rw-r--r--navit/country.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/navit/country.c b/navit/country.c
index 0618b7eb4..86043b4dd 100644
--- a/navit/country.c
+++ b/navit/country.c
@@ -30,10 +30,10 @@
struct country {
int id;
- char *car;
- char *iso2;
- char *iso3;
- char *name;
+ const char *car;
+ const char *iso2;
+ const char *iso3;
+ const char *name;
};
/* List of all known countries and their codes.
@@ -317,8 +317,10 @@ country_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
return 1;
}
return 0;
+ // Cast to char* necessary but safe, because our callers know
+ // not to modify attr->u.str (hopefully).
case attr_label:
- attr->u.str=navit_nls_gettext(country->name);
+ attr->u.str=(char*)navit_nls_gettext(country->name);
this_->attr_next=attr_country_id;
return 1;
case attr_country_id:
@@ -326,19 +328,19 @@ country_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
this_->attr_next=country->car ? attr_country_car : attr_country_iso2;
return 1;
case attr_country_car:
- attr->u.str=country->car;
+ attr->u.str=(char*)country->car;
this_->attr_next=attr_country_iso2;
return attr->u.str ? 1 : 0;
case attr_country_iso2:
- attr->u.str=country->iso2;
+ attr->u.str=(char*)country->iso2;
this_->attr_next=attr_country_iso3;
return 1;
case attr_country_iso3:
- attr->u.str=country->iso3;
+ attr->u.str=(char*)country->iso3;
this_->attr_next=attr_country_name;
return 1;
case attr_country_name:
- attr->u.str=navit_nls_gettext(country->name);
+ attr->u.str=(char*)navit_nls_gettext(country->name);
this_->attr_next=attr_none;
return 1;
default: