[cairo-commit] cairo/src cairo-pdf-surface.c,1.38,1.39

Kristian Hogsberg commit at pdx.freedesktop.org
Fri Jun 3 10:28:44 PDT 2005


Committed by: krh

Update of /cvs/cairo/cairo/src
In directory gabe:/tmp/cvs-serv17936/src

Modified Files:
	cairo-pdf-surface.c 
Log Message:
2005-06-03  Kristian Høgsberg  <krh at redhat.com>

        Patch from Tomasz Cholewo <cholewo at ieee-cis.org>:

        * src/cairo-pdf-surface.c: (cairo_pdf_ft_font_write_head_table),
        (cairo_pdf_ft_font_generate): Store the index of the checksum
        instea of a pointer to the location.



Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- cairo-pdf-surface.c	1 Jun 2005 20:24:10 -0000	1.38
+++ cairo-pdf-surface.c	3 Jun 2005 17:28:42 -0000	1.39
@@ -126,7 +126,7 @@
     cairo_pdf_font_t base;
     ft_subset_glyph_t *glyphs;
     FT_Face face;
-    unsigned long *checksum_location;
+    int checksum_index;
     cairo_array_t output;
     int *parent_to_subset;
     cairo_status_t status;
@@ -541,9 +541,7 @@
     cairo_pdf_ft_font_write_be32 (font, head->Table_Version);
     cairo_pdf_ft_font_write_be32 (font, head->Font_Revision);
 
-    font->checksum_location =
-	(unsigned long *) _cairo_array_index (&font->output, 0) +
-	_cairo_array_num_elements (&font->output) / sizeof (long);
+    font->checksum_index = _cairo_array_num_elements (&font->output);
     cairo_pdf_ft_font_write_be32 (font, 0);
     cairo_pdf_ft_font_write_be32 (font, head->Magic_Number);
 
@@ -754,6 +752,7 @@
 {
     cairo_pdf_ft_font_t *font = abstract_font;
     unsigned long start, end, next, checksum;
+    unsigned long *checksum_location;
     int i;
 
     font->face = _cairo_ft_unscaled_font_lock_face (font->base.unscaled_font);
@@ -778,7 +777,8 @@
 
     checksum =
 	0xb1b0afba - cairo_pdf_ft_font_calculate_checksum (font, 0, end);
-    *font->checksum_location = cpu_to_be32 (checksum);
+    checksum_location = _cairo_array_index (&font->output, font->checksum_index);
+    *checksum_location = cpu_to_be32 (checksum);
 
     *data = _cairo_array_index (&font->output, 0);
     *length = _cairo_array_num_elements (&font->output);




More information about the cairo-commit mailing list