summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-08-22 02:12:13 -0400
committerMatthias Clasen <mclasen@redhat.com>2021-08-22 02:36:48 -0400
commit16cee40516563ad198ef919e980aa11d4a3fc181 (patch)
treed9e90477da8f8b79ef012c91092b3be04da78983
parent33ab9c7a3f1183bbd9da00b4a86fb463619e8799 (diff)
downloadpango-16cee40516563ad198ef919e980aa11d4a3fc181.tar.gz
layout: Silence compiler warnings
-rw-r--r--pango/pango-layout.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c
index bf7a97e7..9114e9a1 100644
--- a/pango/pango-layout.c
+++ b/pango/pango-layout.c
@@ -2641,7 +2641,8 @@ direction_simple (PangoDirection d)
return -1;
case PANGO_DIRECTION_NEUTRAL :
return 0;
- /* no default, compiler should complain if a new values is added */
+ default:
+ break;
}
/* not reached */
return 0;
@@ -3661,7 +3662,7 @@ get_need_hyphen (PangoItem *item,
}
}
- switch (g_unichar_type (wc))
+ switch ((int)g_unichar_type (wc))
{
case G_UNICODE_SPACE_SEPARATOR:
case G_UNICODE_LINE_SEPARATOR:
@@ -4200,6 +4201,9 @@ process_line (PangoLayout *layout,
* justification */
wrapped = TRUE;
goto done;
+
+ default:
+ break;
}
}
@@ -4278,7 +4282,7 @@ static gboolean
affects_itemization (PangoAttribute *attr,
gpointer data)
{
- switch (attr->klass->type)
+ switch ((int)attr->klass->type)
{
/* These affect font selection */
case PANGO_ATTR_LANGUAGE:
@@ -4310,7 +4314,7 @@ static gboolean
affects_break_or_shape (PangoAttribute *attr,
gpointer data)
{
- switch (attr->klass->type)
+ switch ((int)attr->klass->type)
{
/* Affects breaks */
case PANGO_ATTR_ALLOW_BREAKS:
@@ -5322,30 +5326,27 @@ pango_layout_line_get_extents_and_height (PangoLayoutLine *line,
switch (private->cache_status)
{
case CACHED:
- {
- if (ink_rect)
- *ink_rect = private->ink_rect;
- if (logical_rect)
- *logical_rect = private->logical_rect;
- if (height)
- *height = private->height;
- return;
- }
+ if (ink_rect)
+ *ink_rect = private->ink_rect;
+ if (logical_rect)
+ *logical_rect = private->logical_rect;
+ if (height)
+ *height = private->height;
+ return;
+
case NOT_CACHED:
- {
- caching = TRUE;
- if (!ink_rect)
- ink_rect = &private->ink_rect;
- if (!logical_rect)
- logical_rect = &private->logical_rect;
- if (!height)
- height = &private->height;
- break;
- }
+ caching = TRUE;
+ if (!ink_rect)
+ ink_rect = &private->ink_rect;
+ if (!logical_rect)
+ logical_rect = &private->logical_rect;
+ if (!height)
+ height = &private->height;
+ break;
+
case LEAKED:
- {
- break;
- }
+ default:
+ break;
}
if (ink_rect)