diff options
author | Behdad Esfahbod <behdad@gnome.org> | 2005-11-17 11:51:33 +0000 |
---|---|---|
committer | Behdad Esfahbod <behdad@src.gnome.org> | 2005-11-17 11:51:33 +0000 |
commit | c0f495618efe564a10139c3c953b1fb2d59a58e4 (patch) | |
tree | 5ed60c40f00d28ea2e0c046b90f2cf97f5265fb9 | |
parent | b9331c51d17a00fc7fe9a81dd1c1691dd23819be (diff) | |
download | pango-c0f495618efe564a10139c3c953b1fb2d59a58e4.tar.gz |
Remove g_utf8_strlen that was only used to give a warning.
2005-11-17 Behdad Esfahbod <behdad@gnome.org>
* pango/break.c (pango_get_log_attrs): Remove g_utf8_strlen that was
only used to give a warning.
* pango/break.c (pango_default_break): Add gcc-suggested parantheses
around boolean expression.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | pango/break.c | 11 |
2 files changed, 9 insertions, 10 deletions
@@ -1,5 +1,13 @@ 2005-11-17 Behdad Esfahbod <behdad@gnome.org> + * pango/break.c (pango_get_log_attrs): Remove g_utf8_strlen that was + only used to give a warning. + + * pango/break.c (pango_default_break): Add gcc-suggested parantheses + around boolean expression. + +2005-11-17 Behdad Esfahbod <behdad@gnome.org> + * docs/tmpl/coverage-maps.sgml docs/tmpl/fonts.sgml docs/tmpl/glyphs.sgml docs/tmpl/layout.sgml docs/tmpl/main.sgml docs/tmpl/scripts.sgml diff --git a/pango/break.c b/pango/break.c index bf50f349..4a7fcdef 100644 --- a/pango/break.c +++ b/pango/break.c @@ -593,7 +593,7 @@ pango_default_break (const gchar *text, { next = g_utf8_next_char (next); - if (length >= 0 && next == text + length || *next == '\0') + if ((length >= 0 && next >= text + length) || *next == '\0') { /* This is how we fill in the last element (end position) of the * attr array - assume there's a paragraph separators off the end @@ -1622,7 +1622,6 @@ pango_get_log_attrs (const char *text, PangoLogAttr *log_attrs, int attrs_len) { - int n_chars; PangoMap *lang_map; int chars_broken; const char *pos; @@ -1651,14 +1650,6 @@ pango_get_log_attrs (const char *text, render_type_id = g_quark_from_static_string (PANGO_RENDER_TYPE_NONE); } - n_chars = g_utf8_strlen (text, length); - - if (attrs_len < (n_chars + 1)) - { - g_warning ("pango_get_log_attrs(): length of PangoLogAttr array must be at least the number of chars in the text plus one more for the end position"); - return; - } - lang_map = pango_find_map (language, engine_type_id, render_type_id); range_start = text; |