mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-30 08:02:22 +00:00
(location_driver.c) Use rarch_system_info_get_ptr
This commit is contained in:
parent
ca405c077e
commit
abb19d7259
@ -20,6 +20,7 @@
|
|||||||
#include "../driver.h"
|
#include "../driver.h"
|
||||||
#include "../general.h"
|
#include "../general.h"
|
||||||
#include "../runloop.h"
|
#include "../runloop.h"
|
||||||
|
#include "../system.h"
|
||||||
|
|
||||||
static const location_driver_t *location_drivers[] = {
|
static const location_driver_t *location_drivers[] = {
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
@ -223,8 +224,8 @@ bool driver_location_get_position(double *lat, double *lon,
|
|||||||
|
|
||||||
void init_location(void)
|
void init_location(void)
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
/* Resource leaks will follow if location interface is initialized twice. */
|
/* Resource leaks will follow if location interface is initialized twice. */
|
||||||
if (driver->location_data)
|
if (driver->location_data)
|
||||||
@ -240,19 +241,19 @@ void init_location(void)
|
|||||||
driver->location_active = false;
|
driver->location_active = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (global->system.location_callback.initialized)
|
if (system->location_callback.initialized)
|
||||||
global->system.location_callback.initialized();
|
system->location_callback.initialized();
|
||||||
}
|
}
|
||||||
|
|
||||||
void uninit_location(void)
|
void uninit_location(void)
|
||||||
{
|
{
|
||||||
driver_t *driver = driver_get_ptr();
|
driver_t *driver = driver_get_ptr();
|
||||||
global_t *global = global_get_ptr();
|
rarch_system_info_t *system = rarch_system_info_get_ptr();
|
||||||
|
|
||||||
if (driver->location_data && driver->location)
|
if (driver->location_data && driver->location)
|
||||||
{
|
{
|
||||||
if (global->system.location_callback.deinitialized)
|
if (system->location_callback.deinitialized)
|
||||||
global->system.location_callback.deinitialized();
|
system->location_callback.deinitialized();
|
||||||
|
|
||||||
if (driver->location->free)
|
if (driver->location->free)
|
||||||
driver->location->free(driver->location_data);
|
driver->location->free(driver->location_data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user