Nux

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

Proposed by MC Return
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 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

Fixed indentation

Revision history for this message
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?

Revision history for this message
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

Removed the static bool gthread_initialized

Unmerged revisions

656. By MC Return

Removed the static bool gthread_initialized

655. By MC Return

Fixed indentation

654. By MC Return

Hopefully fixed deprecated g_source_get_current_time correctly this time

653. By MC Return

Hopefully fixed g_source_get_time

652. By MC Return

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
=== modified file 'Nux/MainLoopGLib.cpp'
--- Nux/MainLoopGLib.cpp 2012-05-31 21:40:37 +0000
+++ Nux/MainLoopGLib.cpp 2012-09-04 09:41:26 +0000
@@ -171,7 +171,7 @@
171 GTimeVal time_val;171 GTimeVal time_val;
172 bool has_timelines_left = false;172 bool has_timelines_left = false;
173 nux_glib_threads_lock();173 nux_glib_threads_lock();
174 g_source_get_current_time(source, &time_val);174 g_get_current_time(&time_val);
175 WindowThread *window_thread = NUX_STATIC_CAST(WindowThread *, user_data);175 WindowThread *window_thread = NUX_STATIC_CAST(WindowThread *, user_data);
176176
177 // pump the timelines177 // pump the timelines
@@ -202,12 +202,7 @@
202202
203 if (!IsEmbeddedWindow())203 if (!IsEmbeddedWindow())
204 {204 {
205 static bool gthread_initialized = false;205 g_type_init();
206
207 if (!gthread_initialized)
208 g_thread_init(NULL);
209
210 gthread_initialized = true;
211206
212 if (((main_loop_glib_context_ == 0) || (main_loop_glib_ == 0)) && (main_context_created == false))207 if (((main_loop_glib_context_ == 0) || (main_loop_glib_ == 0)) && (main_context_created == false))
213 {208 {

Subscribers

People subscribed via source and target branches