From: Pierre-Luc Beaudoin Date: Sun, 8 Mar 2009 22:50:18 +0000 (+0200) Subject: Fix compiler warnings X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=777195b58229af7ba7f522fb43883c1765fe48a7;p=libchamplain Fix compiler warnings --- diff --git a/champlain/champlain-map-source.c b/champlain/champlain-map-source.c index 7ba3a76..9850b95 100644 --- a/champlain/champlain-map-source.c +++ b/champlain/champlain-map-source.c @@ -279,7 +279,7 @@ champlain_map_source_class_init (ChamplainMapSourceClass *klass) static void champlain_map_source_init (ChamplainMapSource *champlainMapSource) { - ChamplainMapSourcePrivate *priv = GET_PRIVATE (champlainMapSource); + //ChamplainMapSourcePrivate *priv = GET_PRIVATE (champlainMapSource); } gint @@ -329,7 +329,7 @@ guint champlain_map_source_get_row_count (ChamplainMapSource *map_source, gint zoom_level) { - ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); + //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); // FIXME: support other projections return pow (2, zoom_level); } @@ -338,7 +338,7 @@ guint champlain_map_source_get_column_count (ChamplainMapSource *map_source, gint zoom_level) { - ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); + //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); // FIXME: support other projections return pow (2, zoom_level); } @@ -357,7 +357,7 @@ champlain_map_source_get_longitude (ChamplainMapSource *map_source, gint zoom_level, guint x) { - ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); + //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); // FIXME: support other projections gdouble dx = (float)x / champlain_map_source_get_tile_size (map_source); return dx / pow (2.0, zoom_level) * 360.0 - 180; @@ -368,7 +368,7 @@ champlain_map_source_get_latitude (ChamplainMapSource *map_source, gint zoom_level, guint y) { - ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); + //ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); // FIXME: support other projections gdouble dy = (float)y / champlain_map_source_get_tile_size (map_source); double n = M_PI - 2.0 * M_PI * dy / pow (2.0, zoom_level); @@ -384,7 +384,7 @@ champlain_map_source_get_name (ChamplainMapSource *map_source) void champlain_map_source_set_name (ChamplainMapSource *map_source, - char *name) + const char *name) { ChamplainMapSourcePrivate *priv = GET_PRIVATE (map_source); diff --git a/champlain/champlain-map-source.h b/champlain/champlain-map-source.h index e70e97b..bcea848 100644 --- a/champlain/champlain-map-source.h +++ b/champlain/champlain-map-source.h @@ -92,4 +92,7 @@ guint champlain_map_source_get_column_count (ChamplainMapSource *map_source, void champlain_map_source_get_tile (ChamplainMapSource *map_source, ChamplainView *view, ChamplainZoomLevel *level, ChamplainTile *tile); +void champlain_map_source_set_name (ChamplainMapSource *map_source, + const char *name); + #endif diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c index 919586e..933209b 100644 --- a/champlain/champlain-network-map-source.c +++ b/champlain/champlain-network-map-source.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -271,7 +272,7 @@ champlain_network_map_source_set_tile_uri (ChamplainNetworkMapSource *network_ma } ChamplainMapSource * -champlain_map_source_new_osm_mapnik () +champlain_map_source_new_osm_mapnik (void) { return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("OpenStreetMap Mapnik", "(CC) BY 2.0 OpenStreetMap contributors", @@ -281,7 +282,7 @@ champlain_map_source_new_osm_mapnik () } ChamplainMapSource * -champlain_map_source_new_oam () +champlain_map_source_new_oam (void) { return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("OpenArialMap", "(CC) BY 3.0 OpenArialMap contributors", @@ -291,7 +292,7 @@ champlain_map_source_new_oam () } ChamplainMapSource * -champlain_map_source_new_mff_relief () +champlain_map_source_new_mff_relief (void) { return CHAMPLAIN_MAP_SOURCE (champlain_network_map_source_new_full ("MapsForFree Relief", "Map data available under GNU Free Documentation license, Version 1.2 or later", @@ -305,14 +306,13 @@ get_filename (ChamplainNetworkMapSource *network_map_source, ChamplainZoomLevel *level, ChamplainTile *tile) { - ChamplainNetworkMapSourcePrivate *priv = GET_PRIVATE (network_map_source); + //ChamplainNetworkMapSourcePrivate *priv = GET_PRIVATE (network_map_source); return g_strdup_printf ("%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "%s" G_DIR_SEPARATOR_S "%d" G_DIR_SEPARATOR_S "%d" G_DIR_SEPARATOR_S "%d.png", g_get_user_cache_dir (), CACHE_SUBDIR, champlain_map_source_get_name (CHAMPLAIN_MAP_SOURCE (network_map_source)), champlain_zoom_level_get_zoom_level (level), - champlain_tile_get_x (tile), champlain_tile_get_y (tile), - NULL); + champlain_tile_get_x (tile), champlain_tile_get_y (tile)); } typedef struct { @@ -343,7 +343,7 @@ file_loaded_cb (SoupSession *session, FileLoadedCallbackContext *ctx = (FileLoadedCallbackContext*) user_data; GdkPixbufLoader* loader; GError *error = NULL; - gchar* path, *filename; + gchar* path = NULL, *filename = NULL; if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { diff --git a/champlain/champlain-network-map-source.h b/champlain/champlain-network-map-source.h index 642d734..7893614 100644 --- a/champlain/champlain-network-map-source.h +++ b/champlain/champlain-network-map-source.h @@ -56,9 +56,9 @@ ChamplainNetworkMapSource* champlain_network_map_source_new_full (gchar *name, gchar *license, gchar *license_uri, guint min_zoom, guint map_zoom, guint tile_size, ChamplainMapProjection projection, gchar *uri_format); -ChamplainMapSource * champlain_map_source_new_osm_mapnik (); -ChamplainMapSource * champlain_map_source_new_oam (); -ChamplainMapSource * champlain_map_source_new_mff_relief (); +ChamplainMapSource * champlain_map_source_new_osm_mapnik (void); +ChamplainMapSource * champlain_map_source_new_oam (void); +ChamplainMapSource * champlain_map_source_new_mff_relief (void); gchar * champlain_network_map_source_get_tile_uri (ChamplainNetworkMapSource *source, gint x, gint y, gint z);