~foxtrotgps-team/foxtrotgps/trunk

« back to all changes in this revision

Viewing changes to src/friends.c

  • Committer: Paul Wise
  • Author(s): Charles Curley
  • Date: 2019-02-26 00:59:58 UTC
  • Revision ID: pabs3@bonedaddy.net-20190226005958-ohuong1xgfd6yd9d
Use current glib thread functions when available

Kept deprecated code for users of old glib by using version checks.

Documentation: https://developer.gnome.org/glib/2.34/glib-Deprecated-Thread-APIs.html
See-also: https://developer.gnome.org/glib/stable/glib-Version-Information.html#GLIB-CHECK-VERSION:CAPS
Fixes: warning: ‘g_static_mutex_get_mutex_impl’ is deprecated: Use 'GMutex' instead [-Wdeprecated-declarations]
Fixes: warning: ‘g_thread_create’ is deprecated: Use 'g_thread_new' instead [-Wdeprecated-declarations]
Fixes: warning: ‘g_type_init’ is deprecated [-Wdeprecated-declarations]
Cleanup-by: Paul Wise <pabs3@bonedaddy.net>

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
        label_msg = (GtkLabel *)lookup_widget(window1, "label51");
104
104
        gtk_label_set_label (label_msg, _("Connecting..."));
105
105
 
 
106
#if GLIB_CHECK_VERSION(2,34,0)
 
107
        if (!g_thread_new("friends thread", &update_position_thread, (gpointer) NULL) != 0)
 
108
#else
106
109
        if (!g_thread_create(&update_position_thread, NULL, FALSE, NULL) != 0)
 
110
#endif
107
111
                g_warning("### can't create friend thread\n");
108
112
 
109
113
        return TRUE;
468
472
        label_msg = (GtkLabel *)lookup_widget(window1, "label62");
469
473
        gtk_label_set_text (label_msg, _("Connecting..."));
470
474
 
 
475
#if GLIB_CHECK_VERSION(2,34,0)
 
476
        if (!g_thread_new("register nick thread", &register_nick_thread, (gpointer) NULL) != 0)
 
477
#else
471
478
        if (!g_thread_create(&register_nick_thread, NULL, FALSE, NULL) != 0)
 
479
#endif
472
480
                g_warning("### can't create register_nick() thread\n");
473
481
 
474
482
        return 0;
696
704
 
697
705
        postdata = create_msg_postdata(m);
698
706
 
 
707
#if GLIB_CHECK_VERSION(2,34,0)
 
708
        if (!g_thread_new("Mission thread", &thread_send_message, postdata) != 0)
 
709
#else
699
710
        if (!g_thread_create(&thread_send_message, postdata, FALSE, NULL) != 0)
 
711
#endif
700
712
                g_warning("### can't create mission thread\n");
701
713
 
702
714
        return TRUE;