From 19080f4b91f054d6dc7c2b94d4da2f2aced5a674 Mon Sep 17 00:00:00 2001 From: seoz Date: Fri, 8 Apr 2011 12:13:29 +0000 Subject: [PATCH] Elementary map: Fixed map bug and added null check routine. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@58489 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_map.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_map.c b/src/lib/elm_map.c index 1eea5fa..7aaecf5 100644 --- a/src/lib/elm_map.c +++ b/src/lib/elm_map.c @@ -51,7 +51,7 @@ typedef struct _Route_Dump Route_Dump; #define DEST_DIR_ZOOM_PATH "/tmp/elm_map/%d/%d/" #define DEST_DIR_PATH DEST_DIR_ZOOM_PATH"%d/" #define DEST_FILE_PATH "%s%d.png" -#define DEST_XML_FILE "/tmp/elm_map-XXXXXX.xml" +#define DEST_XML_FILE "/tmp/elm_map-XXXXXX" #define ROUTE_YOURS_URL "http://www.yournavigation.org/api/dev/route.php" #define ROUTE_TYPE_MOTORCAR "motocar" @@ -4204,6 +4204,7 @@ elm_map_route_remove(Elm_Map_Route *route) EAPI void elm_map_route_color_set(Elm_Map_Route *route, int r, int g , int b, int a) { + EINA_SAFETY_ON_NULL_RETURN(route); route->color.r = r; route->color.g = g; route->color.b = b; @@ -4224,6 +4225,7 @@ elm_map_route_color_set(Elm_Map_Route *route, int r, int g , int b, int a) EAPI void elm_map_route_color_get(Elm_Map_Route *route, int *r, int *g , int *b, int *a) { + EINA_SAFETY_ON_NULL_RETURN(route); if (*r) *r = route->color.r; if (*g) *g = route->color.g; if (*b) *b = route->color.b; @@ -4241,6 +4243,7 @@ elm_map_route_color_get(Elm_Map_Route *route, int *r, int *g , int *b, int *a) EAPI double elm_map_route_distance_get(Elm_Map_Route *route) { + EINA_SAFETY_ON_NULL_RETURN_VAL(route, 0.0); return route->info.distance; } @@ -4256,6 +4259,7 @@ elm_map_route_distance_get(Elm_Map_Route *route) EAPI const char* elm_map_route_node_get(Elm_Map_Route *route) { + EINA_SAFETY_ON_NULL_RETURN_VAL(route, NULL); return route->info.nodes; } @@ -4271,6 +4275,7 @@ elm_map_route_node_get(Elm_Map_Route *route) EAPI const char* elm_map_route_waypoint_get(Elm_Map_Route *route) { + EINA_SAFETY_ON_NULL_RETURN_VAL(route, NULL); return route->info.waypoints; } -- 2.7.4