Fix to get precise value of distance in location_manager_get_distance 77/236677/1 accepted/tizen/unified/20200622.134517 submit/tizen/20200619.111507
authorchakradhar pogiri <v.pogiri@samsung.com>
Fri, 19 Jun 2020 08:18:08 +0000 (13:48 +0530)
committerchakradhar pogiri <v.pogiri@samsung.com>
Fri, 19 Jun 2020 08:18:08 +0000 (13:48 +0530)
Change-Id: I4a7685b62298e3d7588a521884e4df69a2e688c5

src/locations.c

index 942f4c1..18d86e7 100755 (executable)
@@ -1239,7 +1239,7 @@ EXPORT_API int location_manager_get_distance(double start_latitude, double start
        LOCATIONS_CHECK_CONDITION(end_longitude >= -180 && end_longitude <= 180, LOCATIONS_ERROR_INVALID_PARAMETER, "LOCATIONS_ERROR_INVALID_PARAMETER");
 
        int ret = LOCATION_ERROR_NONE;
-       ulong u_distance;
+       double u_distance;
 
        LocationPosition *start = location_position_new(0, start_latitude, start_longitude, 0, LOCATION_STATUS_2D_FIX);
        LocationPosition *end = location_position_new(0, end_latitude, end_longitude, 0, LOCATION_STATUS_2D_FIX);
@@ -1250,7 +1250,7 @@ EXPORT_API int location_manager_get_distance(double start_latitude, double start
        if (ret != LOCATION_ERROR_NONE)
                return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
-       *distance = (double)u_distance;
+       *distance = u_distance;
 
        return LOCATIONS_ERROR_NONE;
 }