[PATCH] glib: remove invocations of g_type_init()
Aleksander Morgado
aleksander at aleksander.es
Fri Feb 3 09:01:14 UTC 2017
On 03/02/17 01:45, Ben Chan wrote:
> g_type_init() has been deprecated (and also marked with the attribute
> 'deprecated') since glib 2.36 as the type system is automatically
> initialized. Since the minimum version of glib required by libqmi is
> 2.36, calling g_type_init() isn't necessarily in the libqmi code.
> ---
Thanks, pushed to git master. I've also written a backport guarding
g_type_init() with #ifdefs for qmi-1-16 and qmi-1-14.
> src/libqmi-glib/test/test-generated.c | 1 -
> src/libqmi-glib/test/test-message.c | 1 -
> src/libqmi-glib/test/test-utils.c | 1 -
> src/qmi-firmware-update/qfu-main.c | 2 --
> src/qmi-firmware-update/test/test-utils.c | 1 -
> src/qmi-proxy/qmi-proxy.c | 2 --
> src/qmicli/qmicli.c | 2 --
> 7 files changed, 10 deletions(-)
>
> diff --git a/src/libqmi-glib/test/test-generated.c b/src/libqmi-glib/test/test-generated.c
> index 39734c2..164d9c5 100644
> --- a/src/libqmi-glib/test/test-generated.c
> +++ b/src/libqmi-glib/test/test-generated.c
> @@ -648,7 +648,6 @@ test_generated_nas_get_cell_location_info (TestFixture *fixture)
>
> int main (int argc, char **argv)
> {
> - g_type_init ();
> g_test_init (&argc, &argv, NULL);
>
> /* Test the setup/teardown test methods */
> diff --git a/src/libqmi-glib/test/test-message.c b/src/libqmi-glib/test/test-message.c
> index e058343..cee6838 100644
> --- a/src/libqmi-glib/test/test-message.c
> +++ b/src/libqmi-glib/test/test-message.c
> @@ -1505,7 +1505,6 @@ test_message_set_transaction_id_services (void)
>
> int main (int argc, char **argv)
> {
> - g_type_init ();
> g_test_init (&argc, &argv, NULL);
>
> g_test_add_func ("/libqmi-glib/message/parse/short", test_message_parse_short);
> diff --git a/src/libqmi-glib/test/test-utils.c b/src/libqmi-glib/test/test-utils.c
> index 04f552f..c15cd70 100644
> --- a/src/libqmi-glib/test/test-utils.c
> +++ b/src/libqmi-glib/test/test-utils.c
> @@ -1211,7 +1211,6 @@ test_utils_uint_sized_8_unaligned_be (void)
>
> int main (int argc, char **argv)
> {
> - g_type_init ();
> g_test_init (&argc, &argv, NULL);
>
> g_test_add_func ("/libqmi-glib/utils/uint8", test_utils_uint8);
> diff --git a/src/qmi-firmware-update/qfu-main.c b/src/qmi-firmware-update/qfu-main.c
> index 331b36b..f8cb144 100644
> --- a/src/qmi-firmware-update/qfu-main.c
> +++ b/src/qmi-firmware-update/qfu-main.c
> @@ -469,8 +469,6 @@ int main (int argc, char **argv)
>
> setlocale (LC_ALL, "");
>
> - g_type_init ();
> -
> /* Setup option context, process it and destroy it */
> context = g_option_context_new ("- Update firmware in QMI devices");
> g_option_context_set_description (context, context_description);
> diff --git a/src/qmi-firmware-update/test/test-utils.c b/src/qmi-firmware-update/test/test-utils.c
> index 7a77eeb..094ef8c 100644
> --- a/src/qmi-firmware-update/test/test-utils.c
> +++ b/src/qmi-firmware-update/test/test-utils.c
> @@ -92,7 +92,6 @@ test_cwe_version_parser_mc7354b_spk (void)
>
> int main (int argc, char **argv)
> {
> - g_type_init ();
> g_test_init (&argc, &argv, NULL);
>
> g_test_add_func ("/qmi-firmware-update/cwe-version-parser/mc7700", test_cwe_version_parser_mc7700);
> diff --git a/src/qmi-proxy/qmi-proxy.c b/src/qmi-proxy/qmi-proxy.c
> index fe51075..c936fb2 100644
> --- a/src/qmi-proxy/qmi-proxy.c
> +++ b/src/qmi-proxy/qmi-proxy.c
> @@ -174,8 +174,6 @@ int main (int argc, char **argv)
>
> setlocale (LC_ALL, "");
>
> - g_type_init ();
> -
> /* Setup option context, process it and destroy it */
> context = g_option_context_new ("- Proxy for QMI devices");
> g_option_context_add_main_entries (context, main_entries, NULL);
> diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c
> index 630fd9c..a2a5560 100644
> --- a/src/qmicli/qmicli.c
> +++ b/src/qmicli/qmicli.c
> @@ -722,8 +722,6 @@ int main (int argc, char **argv)
>
> setlocale (LC_ALL, "");
>
> - g_type_init ();
> -
> /* Setup option context, process it and destroy it */
> context = g_option_context_new ("- Control QMI devices");
> g_option_context_add_group (context,
>
--
Aleksander
https://aleksander.es
More information about the libqmi-devel
mailing list