Commit 99f6d79f authored by Philip Withnall's avatar Philip Withnall Committed by Philip Withnall
Browse files

geocode-glib: Fix various minor const-correctness issues

This fixes a load of compiler warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=756311
parent b3cb3323
......@@ -860,7 +860,7 @@ geo_uri_from_location (GeocodeLocation *loc)
char *uri;
char *coords;
char *params;
char *crs = "wgs84";
const char *crs = "wgs84";
char lat[G_ASCII_DTOSTR_BUF_SIZE];
char lon[G_ASCII_DTOSTR_BUF_SIZE];
char alt[G_ASCII_DTOSTR_BUF_SIZE];
......
......@@ -1122,10 +1122,10 @@ geocode_place_get_continent (GeocodePlace *place)
return place->priv->continent;
}
static char *
static const char *
get_icon_name (GeocodePlace *place)
{
char *icon_name;
const char *icon_name;
switch (place->priv->place_type) {
......@@ -1192,7 +1192,7 @@ get_icon_name (GeocodePlace *place)
GIcon *
geocode_place_get_icon (GeocodePlace *place)
{
char *icon_name;
const char *icon_name;
g_return_val_if_fail (GEOCODE_IS_PLACE (place), NULL);
......
......@@ -48,7 +48,7 @@ test_parse_uri (void)
{
GeocodeLocation *loc;
GError *error = NULL;
char *uri = "geo:1.2,2.3,4.5;crs=wgs84;u=67";
const char *uri = "geo:1.2,2.3,4.5;crs=wgs84;u=67";
loc = geocode_location_new (0, 0, 0);
......@@ -102,7 +102,7 @@ static void
test_unescape_uri (void)
{
GeocodeLocation *loc;
char *uri = "geo:0,0?q=57.038,12.3982(Parkvägen%202,%20Tvååker)";
const char *uri = "geo:0,0?q=57.038,12.3982(Parkvägen%202,%20Tvååker)";
loc = geocode_location_new (0, 0, 0);
g_assert (geocode_location_set_from_uri (loc, uri, NULL));
......@@ -122,7 +122,8 @@ test_convert_from_to_location (void)
gdouble altitude = 5;
gdouble accuracy = 40;
/* Karlskirche (from RFC) */
char *uri = "geo:48.198634,16.371648,5;crs=wgs84;u=40";
const char *uri = "geo:48.198634,16.371648,5;crs=wgs84;u=40";
g_autofree gchar *returned_uri = NULL;
loc = geocode_location_new (0, 0, 0);
g_assert (geocode_location_set_from_uri (loc, uri, &error));
......@@ -141,10 +142,10 @@ test_convert_from_to_location (void)
==,
accuracy);
uri = geocode_location_to_uri (loc, GEOCODE_LOCATION_URI_SCHEME_GEO);
returned_uri = geocode_location_to_uri (loc, GEOCODE_LOCATION_URI_SCHEME_GEO);
g_object_unref (loc);
loc = geocode_location_new (0, 0, 0);
g_assert (geocode_location_set_from_uri (loc, uri, &error));
g_assert (geocode_location_set_from_uri (loc, returned_uri, &error));
g_assert (error == NULL);
g_assert_cmpfloat (geocode_location_get_latitude (loc),
......@@ -159,7 +160,6 @@ test_convert_from_to_location (void)
g_assert_cmpfloat (geocode_location_get_accuracy (loc),
==,
accuracy);
g_free (uri);
g_object_unref (loc);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment