From f0b7fc1ecb80cb34a45e60d07e9c53745b251686 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 5 Mar 2025 20:02:05 +0100 Subject: Just use double, no mixing in float MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/location-corelocation.m | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/location-corelocation.m') diff --git a/src/location-corelocation.m b/src/location-corelocation.m index 87eb0de..bf899ee 100644 --- a/src/location-corelocation.m +++ b/src/location-corelocation.m @@ -29,8 +29,7 @@ struct location_state { int pipe_fd_write; int available; int error; - float latitude; - float longitude; + struct location location; }; @@ -90,8 +89,8 @@ struct location_state { [self.state->lock lock]; - self.state->latitude = newLocation.coordinate.latitude; - self.state->longitude = newLocation.coordinate.longitude; + self.state->location.lat = newLocation.coordinate.latitude; + self.state->location.lon = newLocation.coordinate.longitude; self.state->available = 1; [self.state->lock unlock]; @@ -192,8 +191,8 @@ location_corelocation_start(struct location_state *state) state->available = 0; state->error = 0; - state->latitude = 0; - state->longitude = 0; + state->location.lat = 0; + state->location.lon = 0; int pipefds[2]; int r = pipeutils_create_nonblocking(pipefds); @@ -258,8 +257,7 @@ location_corelocation_handle( [state->lock lock]; int error = state->error; - location->lat = state->latitude; - location->lon = state->longitude; + *location->lat = state->location; *available = state->available; [state->lock unlock]; -- cgit v1.2.3-70-g09d2