diff options
Diffstat (limited to 'src/location-corelocation.m')
-rw-r--r-- | src/location-corelocation.m | 14 |
1 files changed, 6 insertions, 8 deletions
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]; |