Turn overlay_state_ptr into non-pointer

This commit is contained in:
Twinaphex 2015-07-11 18:22:23 +02:00
parent c3f5ea0fcc
commit 70607acb6b
2 changed files with 11 additions and 20 deletions

View File

@ -7,7 +7,7 @@
<key>IDESourceControlProjectIdentifier</key>
<string>6D7FAF49-495D-480E-B0C9-8C39AC77CE3C</string>
<key>IDESourceControlProjectName</key>
<string>RetroArch_iOS</string>
<string>project</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>6B9F0B13E5864452B91F13C09B7ED9EB989E82AD</key>
@ -24,21 +24,21 @@
<string>https://github.com/libretro/common-overlays.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>apple/iOS/RetroArch_iOS.xcodeproj</string>
<string>apple/iOS/RetroArch_iOS.xcodeproj/project.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>6B9F0B13E5864452B91F13C09B7ED9EB989E82AD</key>
<string>../../../../media/autoconfig</string>
<string>../../../..media/autoconfig</string>
<key>76200F0D6584D865E96F58DE862E738E88B23A3C</key>
<string>../../../../..</string>
<key>A267D9543F572B4C32EC6E1B876E3B9BFE4DE8F6</key>
<string>../../../../media/assets</string>
<string>../../../..media/assets</string>
<key>C3AEE01BDA902108663DB5DB9CD7916436919463</key>
<string>../../../../media/libretrodb</string>
<string>../../../..media/libretrodb</string>
<key>C7C12374C7051F8843B3EFA1ACCAF2907102CCF7</key>
<string>../../../..</string>
<key>EF363D58F01B3FB341FA6C851870E60E4F080E97</key>
<string>../../../../media/overlays</string>
<string>../../../..media/overlays</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/libretro/RetroArch.git</string>

View File

@ -157,7 +157,7 @@ struct input_overlay
};
static input_overlay_t *overlay_ptr;
static input_overlay_state_t *overlay_state_ptr;
static input_overlay_state_t overlay_state_ptr;
static config_file_t *overlay_conf;
input_overlay_t *input_overlay_get_ptr(void)
@ -167,7 +167,7 @@ input_overlay_t *input_overlay_get_ptr(void)
input_overlay_state_t *input_overlay_get_state_ptr(void)
{
return overlay_state_ptr;
return &overlay_state_ptr;
}
bool input_overlay_is_active(void)
@ -1307,12 +1307,11 @@ void input_overlay_free(input_overlay_t *ol)
void input_overlay_free_ptr(void)
{
input_overlay_free(overlay_ptr);
if (overlay_ptr)
input_overlay_free(overlay_ptr);
overlay_ptr = NULL;
if (overlay_state_ptr)
free(overlay_state_ptr);
overlay_state_ptr = NULL;
memset(&overlay_state_ptr, 0, sizeof(overlay_state_ptr));
}
int input_overlay_new_ptr(void)
@ -1331,11 +1330,6 @@ int input_overlay_new_ptr(void)
return 1;
}
overlay_state_ptr = (input_overlay_state_t *)calloc(1, sizeof(*overlay_state_ptr));
if (!overlay_state_ptr)
return -1;
overlay_ptr = input_overlay_new(
driver->osk_enable ?
settings->osk.overlay : settings->input.overlay,
@ -1345,10 +1339,7 @@ int input_overlay_new_ptr(void)
settings->input.overlay_scale);
if (!overlay_ptr)
{
free(overlay_state_ptr);
return -1;
}
return 0;
}