[retro-gtk] core: Remove unused extern functions



commit 0c43e51874317b18ca41e2732c3a387b02559b71
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Thu Jul 20 12:01:52 2017 +0200

    core: Remove unused extern functions
    
    Remove the extern prepare() and load_game() from the Vala code, also
    move the C implementations in the C code to avoid compilation warnings
    by using the functions before their declaration.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=777489

 retro-gtk/core.vala    |   17 --------
 retro-gtk/retro-core.c |  106 ++++++++++++++++++++++++------------------------
 2 files changed, 53 insertions(+), 70 deletions(-)
---
diff --git a/retro-gtk/core.vala b/retro-gtk/core.vala
index 4bb2d3a..bb63bcf 100644
--- a/retro-gtk/core.vala
+++ b/retro-gtk/core.vala
@@ -310,23 +310,6 @@ public class Core : Object {
        public extern void deserialize_state ([CCode (array_length_type = "gsize")] uint8[] data) throws 
Error;
 
        /**
-        * Load. a game.
-        *
-        * @param game information to load the game
-        * @return false if the loading failed, true otherwise
-        */
-       private extern bool load_game (GameInfo game);
-
-       /**
-        * Prepare the standalone core.
-        *
-        * This should be used instead of load_game() for standalone cores.
-        *
-        * @return false if the preparation failed, true otherwise
-        */
-       private extern bool prepare ();
-
-       /**
         * Gets the size of a region of memory.
         *
         * @param id the region of memory
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index 1a7048a..e30d14b 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -197,6 +197,59 @@ retro_core_load_discs (RetroCore  *self,
   }
 }
 
+static gboolean
+retro_core_load_game (RetroCore     *self,
+                      RetroGameInfo *game)
+{
+  RetroUnloadGame unload_game;
+  RetroLoadGame load_game;
+  RetroGetSystemAvInfo get_system_av_info;
+  gboolean game_loaded;
+  RetroSystemAvInfo info = {{ 0 }};
+
+  g_return_val_if_fail (self != NULL, FALSE);
+  g_return_val_if_fail (game != NULL, FALSE);
+
+  if (retro_core_get_game_loaded (self)) {
+    retro_core_push_cb_data (self);
+    unload_game = retro_module_get_unload_game (self->module);
+    unload_game ();
+    retro_core_pop_cb_data ();
+  }
+
+  retro_core_push_cb_data (self);
+  load_game = retro_module_get_load_game (self->module);
+  game_loaded = load_game (game);
+  retro_core_set_game_loaded (self, game_loaded);
+  get_system_av_info = retro_module_get_get_system_av_info (self->module);
+  get_system_av_info (&info);
+  retro_core_set_system_av_info (self, &info);
+  retro_core_pop_cb_data ();
+
+  return game_loaded;
+}
+
+static gboolean
+retro_core_prepare (RetroCore* self) {
+  RetroLoadGame load_game;
+  RetroGetSystemAvInfo get_system_av_info;
+  gboolean game_loaded;
+  RetroSystemAvInfo info = {{ 0 }};
+
+  g_return_val_if_fail (self != NULL, FALSE);
+
+  retro_core_push_cb_data (self);
+  load_game = retro_module_get_load_game (self->module);
+  game_loaded = load_game (NULL);
+  retro_core_set_game_loaded (self, game_loaded);
+  get_system_av_info = retro_module_get_get_system_av_info (self->module);
+  get_system_av_info (&info);
+  retro_core_set_system_av_info (self, &info);
+  retro_core_pop_cb_data ();
+
+  return game_loaded;
+}
+
 // FIXME Make static as soon as possible.
 void
 retro_core_load_medias (RetroCore* self,
@@ -494,59 +547,6 @@ retro_core_deserialize_state (RetroCore  *self,
   }
 }
 
-gboolean
-retro_core_load_game (RetroCore     *self,
-                      RetroGameInfo *game)
-{
-  RetroUnloadGame unload_game;
-  RetroLoadGame load_game;
-  RetroGetSystemAvInfo get_system_av_info;
-  gboolean game_loaded;
-  RetroSystemAvInfo info = {{ 0 }};
-
-  g_return_val_if_fail (self != NULL, FALSE);
-  g_return_val_if_fail (game != NULL, FALSE);
-
-  if (retro_core_get_game_loaded (self)) {
-    retro_core_push_cb_data (self);
-    unload_game = retro_module_get_unload_game (self->module);
-    unload_game ();
-    retro_core_pop_cb_data ();
-  }
-
-  retro_core_push_cb_data (self);
-  load_game = retro_module_get_load_game (self->module);
-  game_loaded = load_game (game);
-  retro_core_set_game_loaded (self, game_loaded);
-  get_system_av_info = retro_module_get_get_system_av_info (self->module);
-  get_system_av_info (&info);
-  retro_core_set_system_av_info (self, &info);
-  retro_core_pop_cb_data ();
-
-  return game_loaded;
-}
-
-gboolean
-retro_core_prepare (RetroCore* self) {
-  RetroLoadGame load_game;
-  RetroGetSystemAvInfo get_system_av_info;
-  gboolean game_loaded;
-  RetroSystemAvInfo info = {{ 0 }};
-
-  g_return_val_if_fail (self != NULL, FALSE);
-
-  retro_core_push_cb_data (self);
-  load_game = retro_module_get_load_game (self->module);
-  game_loaded = load_game (NULL);
-  retro_core_set_game_loaded (self, game_loaded);
-  get_system_av_info = retro_module_get_get_system_av_info (self->module);
-  get_system_av_info (&info);
-  retro_core_set_system_av_info (self, &info);
-  retro_core_pop_cb_data ();
-
-  return game_loaded;
-}
-
 gsize
 retro_core_get_memory_size (RetroCore       *self,
                             RetroMemoryType  id)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]