[pango/compiler-warnings: 6/11] tests: Silence compiler warnings




commit 052482f6674ba6afdb08c3be33a8d6a562e276bf
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Aug 22 02:01:33 2021 -0400

    tests: Silence compiler warnings

 tests/test-itemize.c |  8 ++++----
 tests/test-shape.c   | 11 ++++++-----
 tests/testmisc.c     |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index 926eb3ae..185edbd2 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -55,7 +55,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:
@@ -72,11 +72,11 @@ affects_itemization (PangoAttribute *attr,
     case PANGO_ATTR_GRAVITY:
     case PANGO_ATTR_GRAVITY_HINT:
     /* These are part of ItemProperties, so need to break runs */
+    case PANGO_ATTR_LETTER_SPACING:
     case PANGO_ATTR_SHAPE:
     case PANGO_ATTR_RISE:
-    case PANGO_ATTR_UNDERLINE:
-    case PANGO_ATTR_STRIKETHROUGH:
-    case PANGO_ATTR_LETTER_SPACING:
+    case PANGO_ATTR_LINE_HEIGHT:
+    case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
       return TRUE;
     default:
       return FALSE;
diff --git a/tests/test-shape.c b/tests/test-shape.c
index a04291e4..9ce86834 100644
--- a/tests/test-shape.c
+++ b/tests/test-shape.c
@@ -57,7 +57,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:
@@ -74,11 +74,11 @@ affects_itemization (PangoAttribute *attr,
     case PANGO_ATTR_GRAVITY:
     case PANGO_ATTR_GRAVITY_HINT:
     /* These are part of ItemProperties, so need to break runs */
+    case PANGO_ATTR_LETTER_SPACING:
     case PANGO_ATTR_SHAPE:
     case PANGO_ATTR_RISE:
-    case PANGO_ATTR_UNDERLINE:
-    case PANGO_ATTR_STRIKETHROUGH:
-    case PANGO_ATTR_LETTER_SPACING:
+    case PANGO_ATTR_LINE_HEIGHT:
+    case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
       return TRUE;
     default:
       return FALSE;
@@ -89,11 +89,12 @@ 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:
     /* Affects shaping */
+    case PANGO_ATTR_INSERT_HYPHENS:
     case PANGO_ATTR_FONT_FEATURES:
     case PANGO_ATTR_SHOW:
       return TRUE;
diff --git a/tests/testmisc.c b/tests/testmisc.c
index da24388b..60694134 100644
--- a/tests/testmisc.c
+++ b/tests/testmisc.c
@@ -314,7 +314,7 @@ test_get_cursor_crash (void)
   PangoLayout *layout;
   int i;
 
-  char *string = "foo\n\rbar\r\nbaz\n\nqux\n\n..";
+  const char *string = "foo\n\rbar\r\nbaz\n\nqux\n\n..";
 
   context = pango_font_map_create_context (pango_cairo_font_map_get_default ());
 


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