pango patch -- fix some warnings, at least one bug



I fixed a bunch of warnings. In one case, I had to do a bit of research, since the warning indicated a missing non-obvious line of code.

OK to commit?

Index: modules/arabic/arabic-x.c
===================================================================
RCS file: /cvs/gnome/pango/modules/arabic/arabic-x.c,v
retrieving revision 1.21
diff -p -u -r1.21 arabic-x.c
--- modules/arabic/arabic-x.c	2001/06/25 15:09:39	1.21
+++ modules/arabic/arabic-x.c	2001/07/11 23:39:32
@@ -178,7 +178,7 @@ arabic_engine_shape (PangoFont        *f
                      PangoGlyphString *glyphs)
 {
     PangoXSubfont   subfont;
-    long            n_chars;
+    int             n_chars;
     int             i;
     ArabicFontInfo *fs;
     const char     *p;
Index: modules/indic/bengali-x.c
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/bengali-x.c,v
retrieving revision 1.7
diff -p -u -r1.7 bengali-x.c
--- modules/indic/bengali-x.c	2001/06/14 20:38:22	1.7
+++ modules/indic/bengali-x.c	2001/07/11 23:39:32
@@ -40,6 +40,7 @@

 #include <glib.h>
 #include <stdio.h>
+#include <string.h>

 #include "pangox.h"
 #include "pango-indic.h"
@@ -162,11 +163,10 @@ pango_indic_make_ligs (gunichar * start,
   int num = end - start;
   int i;

-  for (i = 0; i < (end - start); i++)
+  for (i = 0; i < num; i++)
     {
       gunichar t0 = pango_indic_get_char (start + i, end);
       gunichar t1 = pango_indic_get_char (start + 1 + i, end);
-      gunichar t2 = pango_indic_get_char (start + 2 + i, end);

        if ((t0 == VIRAMA) && (t1 == 0x9af))
 	 {
@@ -182,7 +182,7 @@ pango_indic_make_ligs (gunichar * start,
        start[2] = RA_SUPERSCRIPT;
      }

-   for (i = 0; i < (end - start - 1); i++)
+   for (i = 0; i < (num - 1); i++)
      {
        if (start[i] == VIRAMA)
 	 {
@@ -207,8 +207,7 @@ pango_indic_engine_shape (PangoFont * fo

   int n_chars, n_glyph;
   int lvl;
-  const char *p;
-  int i, k;
+  int i;
   gunichar *wc;
   int sb;
   int n_syls;
Index: modules/indic/devanagari-x.c
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/devanagari-x.c,v
retrieving revision 1.7
diff -p -u -r1.7 devanagari-x.c
--- modules/indic/devanagari-x.c	2001/06/14 20:38:22	1.7
+++ modules/indic/devanagari-x.c	2001/07/11 23:39:32
@@ -37,6 +37,7 @@

 #include <glib.h>
 #include <stdio.h>
+#include <string.h>

 #include "pangox.h"
 #include "pango-engine.h"
@@ -248,7 +249,6 @@ pango_indic_engine_shape (PangoFont * fo

   int n_chars, n_glyph;
   int lvl;
-  const char *p;
   int i;
   gunichar *wc;
   int sb;
Index: modules/indic/gujarati-x.c
===================================================================
RCS file: /cvs/gnome/pango/modules/indic/gujarati-x.c,v
retrieving revision 1.7
diff -p -u -r1.7 gujarati-x.c
--- modules/indic/gujarati-x.c	2001/06/14 20:38:22	1.7
+++ modules/indic/gujarati-x.c	2001/07/11 23:39:32
@@ -25,6 +25,7 @@

 #include <glib.h>
 #include <stdio.h>
+#include <string.h>

 #include "pangox.h"

@@ -232,7 +233,6 @@ pango_indic_engine_shape (PangoFont * fo

   int n_chars, n_glyph;
   int lvl;
-  const char *p;
   int i;
   gunichar *wc;
   int sb;
Index: modules/tamil/tamil-x.c
===================================================================
RCS file: /cvs/gnome/pango/modules/tamil/tamil-x.c,v
retrieving revision 1.13
diff -p -u -r1.13 tamil-x.c
--- modules/tamil/tamil-x.c	2001/06/14 20:38:22	1.13
+++ modules/tamil/tamil-x.c	2001/07/11 23:39:33
@@ -232,7 +232,7 @@ tamil_engine_shape (PangoFont        *fo
   wc = (gunichar *)g_malloc (sizeof(gunichar) * n_chars * 2);

   p = text;
-  prevchar = 0;complete = 1;/* One character look behind */
+  prevchar = 0;currchar = 0;complete = 1;/* One character look behind */
   n_glyph = 0;
   cluster_start = text;

Index: pango/pango-attributes.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pango-attributes.c,v
retrieving revision 1.27
diff -p -u -r1.27 pango-attributes.c
--- pango/pango-attributes.c	2001/06/14 20:38:25	1.27
+++ pango/pango-attributes.c	2001/07/11 23:39:38
@@ -718,8 +718,8 @@ pango_attr_list_get_type (void)
   if (our_type == 0)
     our_type = g_boxed_type_register_static ("PangoAttrList",
 					     NULL,
-					     pango_attr_list_copy,
-					     pango_attr_list_unref,
+					     (GBoxedCopyFunc) pango_attr_list_copy,
+					     (GBoxedFreeFunc) pango_attr_list_unref,
 					     FALSE);

   return our_type;
@@ -1548,8 +1548,8 @@ pango_color_get_type (void)
   if (our_type == 0)
     our_type = g_boxed_type_register_static ("PangoColor",
 					     NULL,
-					     pango_color_copy,
-					     pango_color_free,
+					     (GBoxedCopyFunc) pango_color_copy,
+					     (GBoxedFreeFunc) pango_color_free,
 					     FALSE);

   return our_type;
Index: pango/pangoxft-font.c
===================================================================
RCS file: /cvs/gnome/pango/pango/pangoxft-font.c,v
retrieving revision 1.7
diff -p -u -r1.7 pangoxft-font.c
--- pango/pangoxft-font.c	2001/07/02 05:02:25	1.7
+++ pango/pangoxft-font.c	2001/07/11 23:39:41
@@ -46,16 +46,16 @@ static void pango_xft_font_finalize   (G

static PangoFontDescription *pango_xft_font_describe (PangoFont *font); static PangoCoverage * pango_xft_font_get_coverage (PangoFont *font,
-							       const char       *lang);
+							       PangoLanguage    *language);
static PangoEngineShape * pango_xft_font_find_shaper (PangoFont *font,
-							       const char       *lang,
+							       PangoLanguage    *language,
 							       guint32           ch);
static void pango_xft_font_get_glyph_extents (PangoFont *font,
 							       PangoGlyph        glyph,
 							       PangoRectangle   *ink_rect,
 							       PangoRectangle   *logical_rect);
static void pango_xft_font_get_metrics (PangoFont *font,
-							       const gchar      *lang,
+							       PangoLanguage    *language,
 							       PangoFontMetrics *metrics);


@@ -282,7 +282,7 @@ pango_xft_render (XftDraw          *draw

 static void
 pango_xft_font_get_metrics (PangoFont        *font,
-			    const gchar      *lang,
+			    PangoLanguage    *language,
 			    PangoFontMetrics *metrics)
 {
   PangoXftFont *xfont = (PangoXftFont *)font;
@@ -291,8 +291,6 @@ pango_xft_font_get_metrics (PangoFont
   metrics->descent = PANGO_SCALE * xfont->xft_font->descent;
metrics->approximate_digit_width = PANGO_SCALE * xfont->xft_font->max_advance_width; metrics->approximate_char_width = PANGO_SCALE * xfont->xft_font->max_advance_width;
-
-  return;
 }

 static void
@@ -335,8 +333,8 @@ pango_xft_font_describe (PangoFont *font
 }

 static PangoCoverage *
-pango_xft_font_get_coverage (PangoFont  *font,
-			     const char *lang)
+pango_xft_font_get_coverage (PangoFont     *font,
+			     PangoLanguage *language)
 {
   PangoXftFont *xfont = (PangoXftFont *)font;
   FT_Face face;
@@ -428,7 +426,7 @@ pango_xft_font_get_glyph_extents (PangoF
 }

 static PangoMap *
-pango_xft_get_shaper_map (const char *lang)
+pango_xft_get_shaper_map (PangoLanguage *language)
 {
   static guint engine_type_id = 0;
   static guint render_type_id = 0;
@@ -439,17 +437,17 @@ pango_xft_get_shaper_map (const char *la
       render_type_id = g_quark_from_static_string (PANGO_RENDER_TYPE_XFT)
;
     }

-  return pango_find_map (lang, engine_type_id, render_type_id);
+  return pango_find_map (language, engine_type_id, render_type_id);
 }

 static PangoEngineShape *
-pango_xft_font_find_shaper (PangoFont   *font,
-			  const gchar *lang,
-			  guint32      ch)
+pango_xft_font_find_shaper (PangoFont     *font,
+			    PangoLanguage *language,
+			    guint32        ch)
 {
   PangoMap *shape_map = NULL;

-  shape_map = pango_xft_get_shaper_map (lang);
+  shape_map = pango_xft_get_shaper_map (language);
   return (PangoEngineShape *)pango_map_get_engine (shape_map, ch);
 }

Index: pango/opentype/ftxgpos.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxgpos.c,v
retrieving revision 1.1
diff -p -u -r1.1 ftxgpos.c
--- pango/opentype/ftxgpos.c	2000/12/20 04:41:36	1.1
+++ pango/opentype/ftxgpos.c	2001/07/11 23:39:45
@@ -873,6 +873,8 @@

 	if ( gpi->face->glyph->format != ft_glyph_format_outline )
           return TTO_Err_Invalid_GPOS_SubTable;	
+
+	ap = an->af.af2.AnchorPoint;
 	
 	outline = gpi->face->glyph->outline;

Index: pango/opentype/ftxopen.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/ftxopen.c,v
retrieving revision 1.1
diff -p -u -r1.1 ftxopen.c
--- pango/opentype/ftxopen.c	2000/12/20 04:41:36	1.1
+++ pango/opentype/ftxopen.c	2001/07/11 23:39:46
@@ -851,7 +851,6 @@
 			   FT_Stream      stream )
   {
     FT_Error   error;
-    FT_Memory  memory = stream->memory;

     if ( ACCESS_Frame( 2L ) )
       return error;
Index: pango/opentype/pango-ot-ruleset.c
===================================================================
RCS file: /cvs/gnome/pango/pango/opentype/pango-ot-ruleset.c,v
retrieving revision 1.1
diff -p -u -r1.1 pango-ot-ruleset.c
--- pango/opentype/pango-ot-ruleset.c	2000/12/20 04:41:36	1.1
+++ pango/opentype/pango-ot-ruleset.c	2001/07/11 23:39:46
@@ -133,7 +133,6 @@ pango_ot_ruleset_shape (PangoOTRuleset
   TTO_GSUB_String *in_string = NULL;
   TTO_GSUB_String *out_string = NULL;
   TTO_GSUB_String *result_string = NULL;
-  TTO_GPOS_Data *pos_data;

   gboolean need_gsub = FALSE;
   gboolean need_gpos = FALSE;

===================================================================

    -- Darin





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