[evince] dvi: Remove glib < 2.32 compat code



commit bfc10e3c480836d3970a470c10e93e6d39615eb5
Author: Christian Persch <chpe gnome org>
Date:   Fri Jun 8 18:31:17 2012 +0200

    dvi: Remove glib < 2.32 compat code

 backend/dvi/dvi-document.c |   23 ++++++-----------------
 1 files changed, 6 insertions(+), 17 deletions(-)
---
diff --git a/backend/dvi/dvi-document.c b/backend/dvi/dvi-document.c
index 345155a..74f91cb 100644
--- a/backend/dvi/dvi-document.c
+++ b/backend/dvi/dvi-document.c
@@ -40,18 +40,7 @@
 #endif
 #include <stdlib.h>
 
-#if (!GLIB_CHECK_VERSION(2,31,0))
-/* Remove this once we bump dependencies to glib >= 2.31.0 */
-GMutex *dvi_context_mutex = NULL;
-#define p_dvi_context_mutex ((dvi_context_mutex == NULL) ? dvi_context_mutex = g_mutex_new () : dvi_context_mutex)
-#else
 static GMutex dvi_context_mutex;
-/* Remove these defines once we bump dependencies to glib >= 2.31.0
-   and replace occurences in this file of p_dvi_context_mutex with 
-   &dvi_context_mutex.
- */
-#define p_dvi_context_mutex (&dvi_context_mutex)
-#endif
 
 enum {
 	PROP_0,
@@ -106,12 +95,12 @@ dvi_document_load (EvDocument  *document,
 	if (!filename)
         	return FALSE;
 	
-	g_mutex_lock (p_dvi_context_mutex);
+	g_mutex_lock (&dvi_context_mutex);
 	if (dvi_document->context)
 		mdvi_destroy_context (dvi_document->context);
 
 	dvi_document->context = mdvi_init_context(dvi_document->params, dvi_document->spec, filename);
-	g_mutex_unlock (p_dvi_context_mutex);
+	g_mutex_unlock (&dvi_context_mutex);
 	g_free (filename);
 	
 	if (!dvi_document->context) {
@@ -183,7 +172,7 @@ dvi_document_render (EvDocument      *document,
 	 * thread safe. The work to the future - 
 	 * let context render page independently
 	 */
-	g_mutex_lock (p_dvi_context_mutex);
+	g_mutex_lock (&dvi_context_mutex);
 	
 	mdvi_setpage (dvi_document->context, rc->page->index);
 	
@@ -206,7 +195,7 @@ dvi_document_render (EvDocument      *document,
 	mdvi_cairo_device_render (dvi_document->context);
 	surface = mdvi_cairo_device_get_surface (&dvi_document->context->device);
 
-	g_mutex_unlock (p_dvi_context_mutex);
+	g_mutex_unlock (&dvi_context_mutex);
 
 	rotated_surface = ev_document_misc_surface_rotate_and_scale (surface,
 								     required_width,
@@ -222,12 +211,12 @@ dvi_document_finalize (GObject *object)
 {	
 	DviDocument *dvi_document = DVI_DOCUMENT(object);
 	
-	g_mutex_lock (p_dvi_context_mutex);
+	g_mutex_lock (&dvi_context_mutex);
 	if (dvi_document->context) {
 		mdvi_cairo_device_free (&dvi_document->context->device);
 		mdvi_destroy_context (dvi_document->context);
 	}
-	g_mutex_unlock (p_dvi_context_mutex);
+	g_mutex_unlock (&dvi_context_mutex);
 
 	if (dvi_document->params)
 		g_free (dvi_document->params);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]