Fix build with -Werror=format
authorMatthias Clasen <mclasen@redhat.com>
Sat, 19 Jan 2013 19:30:05 +0000 (14:30 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 19 Jan 2013 19:30:05 +0000 (14:30 -0500)
There were a few places in gmarkup.c where we were giving
pointer differences when integers are expected. Fix that
by explicitly casting to int.

https://bugzilla.gnome.org/show_bug.cgi?id=692079

glib/gmarkup.c

index bf7c008..552773f 100644 (file)
@@ -684,7 +684,7 @@ unescape_gstring_inplace (GMarkupParseContext  *context,
                                         "inside a character reference "
                                         "(&#234; for example) - perhaps "
                                         "the digit is too large"),
-                                      end - from, from);
+                                      (int)(end - from), from);
                   return FALSE;
                 }
               else if (*end != ';')
@@ -719,7 +719,7 @@ unescape_gstring_inplace (GMarkupParseContext  *context,
                                           from, G_MARKUP_ERROR_PARSE,
                                           _("Character reference '%-.*s' does not "
                                             "encode a permitted character"),
-                                          end - from, from);
+                                          (int)(end - from), from);
                       return FALSE;
                     }
                 }
@@ -764,7 +764,7 @@ unescape_gstring_inplace (GMarkupParseContext  *context,
                     set_unescape_error (context, error,
                                         from, G_MARKUP_ERROR_PARSE,
                                         _("Entity name '%-.*s' is not known"),
-                                        end-from, from);
+                                        (int)(end - from), from);
                   else
                     set_unescape_error (context, error,
                                         from, G_MARKUP_ERROR_PARSE,