Nux

Merge lp:~mc-return/nux/nux.merge-fix-deprecated-warnings into lp:nux

Proposed by MC Return on 2012-09-02
Status: Work in progress
Proposed branch: lp:~mc-return/nux/nux.merge-fix-deprecated-warnings
Merge into: lp:nux
Diff against target: 26 lines (+2/-7)
1 file modified
Nux/MainLoopGLib.cpp (+2/-7)
To merge this branch: bzr merge lp:~mc-return/nux/nux.merge-fix-deprecated-warnings
Reviewer Review Type Date Requested Status
Unity Team 2012-09-02 Pending
Review via email: mp+122408@code.launchpad.net

Commit message

Fixed [-Wdeprecated-declarations] warnings in MainLoopGLib.cpp by replacing 'g_source_get_current_time(source, &time_val);' with 'g_get_current_time(&time_val);' and 'g_thread_init (NULL);' with 'g_type_init();'.

Description of the change

Fixes [-Wdeprecated-declarations] warnings in MainLoopGLib.cpp by replacing 'g_source_get_current_time(source, &time_val);' with 'g_get_current_time(&time_val);' and 'g_thread_init (NULL);' with 'g_type_init();'.

To post a comment you must log in.
655. By MC Return on 2012-09-02

Fixed indentation

Martin Pitt (pitti) wrote :

Looks good to me. However, g_type_init() does not have the same semantics as g_thread_init(NULL), you *always* have to call it exactly once. So I suggest to drop the "static bool gthread_initialized" bit as well. Does your configure.ac ensure you require at least glib 2.24 for this?

MC Return (mc-return) wrote :

> Looks good to me. However, g_type_init() does not have the same semantics as
> g_thread_init(NULL), you *always* have to call it exactly once. So I suggest
> to drop the "static bool gthread_initialized" bit as well.

Done in r656.

> Does your
> configure.ac ensure you require at least glib 2.24 for this?

Yep. configure.ac says:

glib-2.0 >= 2.25.14

656. By MC Return on 2012-09-04

Removed the static bool gthread_initialized

Unmerged revisions

656. By MC Return on 2012-09-04

Removed the static bool gthread_initialized

655. By MC Return on 2012-09-02

Fixed indentation

654. By MC Return on 2012-09-02

Hopefully fixed deprecated g_source_get_current_time correctly this time

653. By MC Return on 2012-09-02

Hopefully fixed g_source_get_time

652. By MC Return on 2012-09-02

Fixed [-Wdeprecated-declarations] warnings in MainLoopGLib.cpp and replaced 'void g_source_get_current_time(GSource*, GTimeVal*)' with 'void g_source_get_time(GSource*, GTimeVal*)' and 'g_thread_init (NULL);' with 'g_type_init();'

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'Nux/MainLoopGLib.cpp'
2--- Nux/MainLoopGLib.cpp 2012-05-31 21:40:37 +0000
3+++ Nux/MainLoopGLib.cpp 2012-09-04 09:41:26 +0000
4@@ -171,7 +171,7 @@
5 GTimeVal time_val;
6 bool has_timelines_left = false;
7 nux_glib_threads_lock();
8- g_source_get_current_time(source, &time_val);
9+ g_get_current_time(&time_val);
10 WindowThread *window_thread = NUX_STATIC_CAST(WindowThread *, user_data);
11
12 // pump the timelines
13@@ -202,12 +202,7 @@
14
15 if (!IsEmbeddedWindow())
16 {
17- static bool gthread_initialized = false;
18-
19- if (!gthread_initialized)
20- g_thread_init(NULL);
21-
22- gthread_initialized = true;
23+ g_type_init();
24
25 if (((main_loop_glib_context_ == 0) || (main_loop_glib_ == 0)) && (main_context_created == false))
26 {

Subscribers

People subscribed via source and target branches