0001-g_type_init-is-deprecated-for-glib-2.35.0.patch 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. From 5b859b6e7c82f49d967c25398a8e75b61af9bcc0 Mon Sep 17 00:00:00 2001
  2. From: Khem Raj <raj.khem@gmail.com>
  3. Date: Wed, 12 Jun 2013 20:58:51 -0700
  4. Subject: [PATCH] g_type_init() is deprecated for glib >= 2.35.0
  5. Call it for old versions.
  6. Signed-off-by: Khem Raj <raj.khem@gmail.com>
  7. Upstream-Status: Pending
  8. ---
  9. examples/list-known-gps-devices.c | 4 ++--
  10. examples/simple-gps-dbus.c | 3 ++-
  11. examples/simple-gps-gypsy.c | 4 ++--
  12. examples/simple-gps-satellites.c | 4 ++--
  13. gypsy/gypsy-marshal.c | 2 +-
  14. src/main.c | 4 ++--
  15. 6 files changed, 11 insertions(+), 10 deletions(-)
  16. diff --git a/examples/list-known-gps-devices.c b/examples/list-known-gps-devices.c
  17. index c7c4059..0a8b04b 100644
  18. --- a/examples/list-known-gps-devices.c
  19. +++ b/examples/list-known-gps-devices.c
  20. @@ -20,9 +20,9 @@ main (int argc,
  21. GError *error = NULL;
  22. GPtrArray *known_devices;
  23. int i;
  24. -
  25. +#if !GLIB_CHECK_VERSION(2,35,0)
  26. g_type_init ();
  27. -
  28. +#endif
  29. discovery = gypsy_discovery_new ();
  30. known_devices = gypsy_discovery_list_devices (discovery, &error);
  31. diff --git a/examples/simple-gps-dbus.c b/examples/simple-gps-dbus.c
  32. index f7044e6..76b18aa 100644
  33. --- a/examples/simple-gps-dbus.c
  34. +++ b/examples/simple-gps-dbus.c
  35. @@ -121,8 +121,9 @@ main (int argc,
  36. DBusConnection *conn;
  37. DBusError error;
  38. GMainLoop *mainloop;
  39. -
  40. +#if !GLIB_CHECK_VERSION(2,35,0)
  41. g_type_init ();
  42. +#endif
  43. conn = get_connection ();
  44. dbus_error_init (&error);
  45. diff --git a/examples/simple-gps-gypsy.c b/examples/simple-gps-gypsy.c
  46. index 0b6b7a6..86033d9 100644
  47. --- a/examples/simple-gps-gypsy.c
  48. +++ b/examples/simple-gps-gypsy.c
  49. @@ -67,9 +67,9 @@ main (int argc,
  50. g_print ("Usage: %s device\n", argv[0]);
  51. return 0;
  52. }
  53. -
  54. +#if !GLIB_CHECK_VERSION(2,35,0)
  55. g_type_init ();
  56. -
  57. +#endif
  58. control = gypsy_control_get_default ();
  59. path = gypsy_control_create (control, argv[1], &error);
  60. if (path == NULL) {
  61. diff --git a/examples/simple-gps-satellites.c b/examples/simple-gps-satellites.c
  62. index 140c98f..9a3f95a 100644
  63. --- a/examples/simple-gps-satellites.c
  64. +++ b/examples/simple-gps-satellites.c
  65. @@ -42,9 +42,9 @@ main (int argc,
  66. g_print ("Usage: %s device\n", argv[0]);
  67. return 0;
  68. }
  69. -
  70. +#if !GLIB_CHECK_VERSION(2,35,0)
  71. g_type_init ();
  72. -
  73. +#endif
  74. control = gypsy_control_get_default ();
  75. path = gypsy_control_create (control, argv[1], &error);
  76. if (path == NULL) {
  77. diff --git a/gypsy/gypsy-marshal.c b/gypsy/gypsy-marshal.c
  78. index 6964644..9ac0095 100644
  79. --- a/gypsy/gypsy-marshal.c
  80. +++ b/gypsy/gypsy-marshal.c
  81. @@ -5,7 +5,7 @@
  82. #ifdef G_ENABLE_DEBUG
  83. #define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
  84. -#define g_marshal_value_peek_char(v) g_value_get_char (v)
  85. +#define g_marshal_value_peek_char(v) g_value_get_schar (v)
  86. #define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
  87. #define g_marshal_value_peek_int(v) g_value_get_int (v)
  88. #define g_marshal_value_peek_uint(v) g_value_get_uint (v)
  89. diff --git a/src/main.c b/src/main.c
  90. index 3e8a794..ec980e5 100644
  91. --- a/src/main.c
  92. +++ b/src/main.c
  93. @@ -187,9 +187,9 @@ main (int argc,
  94. g_option_context_free (context);
  95. umask (022);
  96. -
  97. +#if !GLIB_CHECK_VERSION(2,35,0)
  98. g_type_init ();
  99. -
  100. +#endif
  101. mainloop = g_main_loop_new (NULL, FALSE);
  102. conn = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
  103. --
  104. 1.7.9.5