From 14b0697a59f51dd017038ca2bb79ba2c2f4034df Mon Sep 17 00:00:00 2001
From: Behdad Esfahbod <behdad@behdad.org>
Date: Fri, 30 Aug 2013 14:14:22 -0400
Subject: [PATCH] Bug 703995 - Compiler warnings about strict aliasing
Patch from Akira TAGOH.
---
pango/pango-context.c | 4 ++--
pango/pango-engine.c | 4 ++--
pango/pango-utils.c | 12 ++++++------
pango/pangocairo-fcfont.c | 4 ++--
pango/pangofc-fontmap.c | 4 ++--
pango/pangoft2-fontmap.c | 4 ++--
6 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/pango/pango-context.c b/pango/pango-context.c
index 8e96713..8bb6a86 100644
--- a/pango/pango-context.c
+++ b/pango/pango-context.c
@@ -1412,8 +1412,8 @@ string_from_script (PangoScript script)
{
static GEnumClass *class = NULL; /* MT-safe */
GEnumValue *value;
- if (g_once_init_enter ((gsize*)&class))
- g_once_init_leave((gsize*)&class, (gsize)g_type_class_ref (PANGO_TYPE_SCRIPT));
+ if (g_once_init_enter (&class))
+ g_once_init_leave(&class, (gpointer)g_type_class_ref (PANGO_TYPE_SCRIPT));
value = g_enum_get_value (class, script);
if (!value)
diff --git a/pango/pango-engine.c b/pango/pango-engine.c
index 994c722..04de3df 100644
--- a/pango/pango-engine.c
+++ b/pango/pango-engine.c
@@ -205,8 +205,8 @@ PangoEngineShape *
_pango_get_fallback_shaper (void)
{
static PangoEngineShape *fallback_shaper = NULL; /* MT-safe */
- if (g_once_init_enter ((gsize*)&fallback_shaper))
- g_once_init_leave((gsize*)&fallback_shaper, (gsize)g_object_new (pango_fallback_engine_get_type (), NULL));
+ if (g_once_init_enter (&fallback_shaper))
+ g_once_init_leave(&fallback_shaper, g_object_new (pango_fallback_engine_get_type (), NULL));
return fallback_shaper;
}
diff --git a/pango/pango-utils.c b/pango/pango-utils.c
index 18ffa26..1ca2de6 100644
--- a/pango/pango-utils.c
+++ b/pango/pango-utils.c
@@ -616,7 +616,7 @@ read_config (void)
{
static GHashTable *config_hash = NULL;
- if (g_once_init_enter ((gsize*)&config_hash))
+ if (g_once_init_enter (&config_hash))
{
GHashTable *tmp_hash;
char *filename;
@@ -635,7 +635,7 @@ read_config (void)
if (envvar)
read_config_file (envvar, TRUE, tmp_hash);
- g_once_init_leave ((gsize*)&config_hash, (gsize)tmp_hash);
+ g_once_init_leave (&config_hash, tmp_hash);
}
return config_hash;
@@ -728,7 +728,7 @@ pango_get_sysconf_subdirectory (void)
{
static const gchar *result = NULL; /* MT-safe */
- if (g_once_init_enter ((gsize*)&result))
+ if (g_once_init_enter (&result))
{
const char *tmp_result = NULL;
#ifdef G_OS_WIN32
@@ -742,7 +742,7 @@ pango_get_sysconf_subdirectory (void)
else
tmp_result = SYSCONFDIR "/pango";
#endif
- g_once_init_leave((gsize*)&result, (gsize)tmp_result);
+ g_once_init_leave(&result, tmp_result);
}
return result;
}
@@ -763,7 +763,7 @@ pango_get_lib_subdirectory (void)
{
static const gchar *result = NULL; /* MT-safe */
- if (g_once_init_enter ((gsize*)&result))
+ if (g_once_init_enter (&result))
{
const gchar *tmp_result = NULL;
#ifdef G_OS_WIN32
@@ -783,7 +783,7 @@ pango_get_lib_subdirectory (void)
else
tmp_result = LIBDIR "/pango";
#endif
- g_once_init_leave((gsize*)&result, (gsize)tmp_result);
+ g_once_init_leave(&result, tmp_result);
}
return result;
}
diff --git a/pango/pangocairo-fcfont.c b/pango/pangocairo-fcfont.c
index ee82675..7dde713 100644
--- a/pango/pangocairo-fcfont.c
+++ b/pango/pangocairo-fcfont.c
@@ -187,8 +187,8 @@ get_gravity_class (void)
{
static GEnumClass *class = NULL; /* MT-safe */
- if (g_once_init_enter ((gsize*)&class))
- g_once_init_leave((gsize*)&class, (gsize)g_type_class_ref (PANGO_TYPE_GRAVITY));
+ if (g_once_init_enter (&class))
+ g_once_init_leave(&class, (gpointer)g_type_class_ref (PANGO_TYPE_GRAVITY));
return class;
}
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index 992de4e..05fed2d 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -239,8 +239,8 @@ get_gravity_class (void)
{
static GEnumClass *class = NULL; /* MT-safe */
- if (g_once_init_enter ((gsize*)&class))
- g_once_init_leave ((gsize*)&class, (gsize)g_type_class_ref (PANGO_TYPE_GRAVITY));
+ if (g_once_init_enter (&class))
+ g_once_init_leave (&class, (gpointer)g_type_class_ref (PANGO_TYPE_GRAVITY));
return class;
}
diff --git a/pango/pangoft2-fontmap.c b/pango/pangoft2-fontmap.c
index aed5a23..3b43fbd 100644
--- a/pango/pangoft2-fontmap.c
+++ b/pango/pangoft2-fontmap.c
@@ -305,8 +305,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
PangoFontMap *
pango_ft2_font_map_for_display (void)
{
- if (g_once_init_enter ((gsize*)&pango_ft2_global_fontmap))
- g_once_init_leave((gsize*)&pango_ft2_global_fontmap, (gsize)pango_ft2_font_map_new ());
+ if (g_once_init_enter (&pango_ft2_global_fontmap))
+ g_once_init_leave(&pango_ft2_global_fontmap, PANGO_FT2_FONT_MAP (pango_ft2_font_map_new ()));
return PANGO_FONT_MAP (pango_ft2_global_fontmap);
}
--
1.8.3.1