X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Flocation_bounds.c;h=d39ca3af8d06ace2892ce7e0991ee3670baa3009;hb=22ee13708a129fdf7fb7652e022df099384a1c4e;hp=3f16f6f3457b4de234dbb3a3e13a160fdc5b6b5f;hpb=2f1343b65fb8ced5fabd1c1e77fc4d1c6cde3d9f;p=platform%2Fcore%2Fapi%2Flocation-manager.git diff --git a/src/location_bounds.c b/src/location_bounds.c index 3f16f6f..d39ca3a 100644 --- a/src/location_bounds.c +++ b/src/location_bounds.c @@ -35,17 +35,17 @@ static location_bounds_type_e __convert_bounds_type(LocationBoundaryType type) { location_bounds_type_e ret; switch (type) { - case LOCATION_BOUNDARY_CIRCLE: - ret = LOCATION_BOUNDS_CIRCLE; - break; - case LOCATION_BOUNDARY_POLYGON: - ret = LOCATION_BOUNDS_POLYGON; - break; - case LOCATION_BOUNDARY_NONE: - case LOCATION_BOUNDARY_RECT: - default: - ret = LOCATION_BOUNDS_RECT; - break; + case LOCATION_BOUNDARY_CIRCLE: + ret = LOCATION_BOUNDS_CIRCLE; + break; + case LOCATION_BOUNDARY_POLYGON: + ret = LOCATION_BOUNDS_POLYGON; + break; + case LOCATION_BOUNDARY_NONE: + case LOCATION_BOUNDARY_RECT: + default: + ret = LOCATION_BOUNDS_RECT; + break; } return ret; } @@ -60,13 +60,11 @@ EXPORT_API int location_bounds_create_rect(location_coords_s top_left, location_ LOCATIONS_CHECK_CONDITION(bottom_right.longitude >= -180 && bottom_right.longitude <= 180, LOCATION_BOUNDS_ERROR_INVALID_PARAMETER, "LOCATION_BOUNDS_ERROR_INVALID_PARAMETER"); if ((bottom_right.longitude - top_left.longitude) < 180 && (bottom_right.longitude - top_left.longitude) > -180) { - if (bottom_right.longitude <= top_left.longitude || bottom_right.latitude >= top_left.latitude) { + if (bottom_right.longitude <= top_left.longitude || bottom_right.latitude >= top_left.latitude) return LOCATION_BOUNDS_ERROR_INVALID_PARAMETER; - } } else { - if (bottom_right.latitude >= top_left.latitude) { + if (bottom_right.latitude >= top_left.latitude) return LOCATION_BOUNDS_ERROR_INVALID_PARAMETER; - } } LocationPosition *lt = location_position_new(0, top_left.latitude, top_left.longitude, 0, LOCATION_STATUS_2D_FIX);