[retro-gtk/wip/aplazas/input: 1/3] Define error quarks with G_DEFINE_QUARK



commit 228f7c32d984f19cdac0de1e90ac5d4853a23105
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Mon Oct 16 19:35:48 2017 +0200

    Define error quarks with G_DEFINE_QUARK
    
    This makes the code simpler.

 retro-gtk/retro-core-descriptor.c |    8 ++------
 retro-gtk/retro-core.c            |    8 ++------
 retro-gtk/retro-option.c          |    8 ++------
 3 files changed, 6 insertions(+), 18 deletions(-)
---
diff --git a/retro-gtk/retro-core-descriptor.c b/retro-gtk/retro-core-descriptor.c
index 995a5b2..1759e6c 100644
--- a/retro-gtk/retro-core-descriptor.c
+++ b/retro-gtk/retro-core-descriptor.c
@@ -19,6 +19,8 @@ enum {
   RETRO_CORE_DESCRIPTOR_ERROR_FIRMWARE_NOT_FOUND
 };
 
+G_DEFINE_QUARK (retro-core-descriptor-error, retro_core_descriptor_error)
+
 #define RETRO_CORE_DESCRIPTOR_LIBRETRO_GROUP "Libretro"
 #define RETRO_CORE_DESCRIPTOR_PLATFORM_GROUP_PREFIX "Platform:"
 #define RETRO_CORE_DESCRIPTOR_FIRMWARE_GROUP_PREFIX "Firmware:"
@@ -42,12 +44,6 @@ enum {
 
 /* Private */
 
-static GQuark
-retro_core_descriptor_error_quark (void)
-{
-  return g_quark_from_static_string ("retro-core-descriptor-error-quark");
-}
-
 static void
 retro_core_descriptor_finalize (GObject *object)
 {
diff --git a/retro-gtk/retro-core.c b/retro-gtk/retro-core.c
index e24693a..3758ce2 100644
--- a/retro-gtk/retro-core.c
+++ b/retro-gtk/retro-core.c
@@ -16,6 +16,8 @@ enum {
   RETRO_CORE_ERROR_NO_CALLBACK,
 };
 
+G_DEFINE_QUARK (retro-core-error, retro_core_error)
+
 G_DEFINE_TYPE (RetroCore, retro_core, G_TYPE_OBJECT)
 
 enum {
@@ -61,12 +63,6 @@ static void retro_core_set_game_loaded (RetroCore *self,
 
 /* Private */
 
-static GQuark
-retro_core_error_quark (void)
-{
-  return g_quark_from_static_string ("retro-core-error-quark");
-}
-
 void
 retro_core_push_cb_data (RetroCore *self)
 {
diff --git a/retro-gtk/retro-option.c b/retro-gtk/retro-option.c
index e56f6ce..525dd60 100644
--- a/retro-gtk/retro-option.c
+++ b/retro-gtk/retro-option.c
@@ -21,13 +21,9 @@ enum {
   RETRO_OPTION_ERROR_INVALID_VALUE,
 };
 
-/* Private */
+G_DEFINE_QUARK (retro-option-error, retro_option_error)
 
-static GQuark
-retro_option_error_quark (void)
-{
-  return g_quark_from_static_string ("retro-option-error-quark");
-}
+/* Private */
 
 static void
 retro_option_finalize (GObject *object)


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