Fix some signed/unsigned comparison warnings that cropped up during the warnings-cleanup branch

This commit is contained in:
Carl Worth 2006-08-07 15:18:38 -07:00
parent 959b85e98c
commit 20c3ff96de
7 changed files with 17 additions and 18 deletions

View file

@ -97,7 +97,7 @@ typedef struct _cairo_command_show_glyphs {
cairo_operator_t op;
cairo_pattern_union_t source;
cairo_glyph_t *glyphs;
int num_glyphs;
unsigned int num_glyphs;
cairo_scaled_font_t *scaled_font;
} cairo_command_show_glyphs_t;

View file

@ -1601,7 +1601,7 @@ _cairo_pdf_surface_emit_type1_font_subset (cairo_pdf_surface_t *surface,
cairo_type1_subset_t subset;
unsigned long length, compressed_length;
char *compressed;
int i;
unsigned int i;
char name[64];
snprintf (name, sizeof name, "CairoFont-%d-%d",
@ -1711,7 +1711,7 @@ _cairo_pdf_surface_emit_truetype_font_subset (cairo_pdf_surface_t *surface,
cairo_truetype_subset_t subset;
unsigned long compressed_length;
char *compressed;
int i;
unsigned int i;
status = _cairo_truetype_subset_init (&subset, font_subset);
if (status)
@ -1944,7 +1944,7 @@ _cairo_pdf_surface_emit_type3_font_subset (cairo_pdf_surface_t *surface,
cairo_pdf_resource_t *glyphs, encoding, char_procs, subset_resource;
cairo_pdf_font_t font;
cairo_matrix_t matrix;
int i;
unsigned int i;
glyphs = malloc (font_subset->num_glyphs * sizeof (cairo_pdf_resource_t));
if (glyphs == NULL) {

View file

@ -425,8 +425,7 @@ _cairo_ps_surface_emit_truetype_font_subset (cairo_ps_surface_t *surface,
{
cairo_truetype_subset_t subset;
cairo_status_t status;
int i;
unsigned int begin, end;
unsigned int i, begin, end;
status = _cairo_truetype_subset_init (&subset, font_subset);
if (status)
@ -628,7 +627,7 @@ _cairo_ps_surface_emit_type3_font_subset (cairo_ps_surface_t *surface,
{
cairo_matrix_t matrix;
int i;
unsigned int i;
_cairo_output_stream_printf (surface->final_stream,
"%% _cairo_ps_surface_emit_type3_font_subset\n");

View file

@ -50,7 +50,7 @@ typedef struct _cairo_scaled_font_subset {
* Value of glyphs array is scaled_font_glyph_index.
*/
unsigned long *glyphs;
int num_glyphs;
unsigned int num_glyphs;
} cairo_scaled_font_subset_t;
/**

View file

@ -625,7 +625,7 @@ _cairo_svg_document_emit_font_subset (cairo_scaled_font_subset_t *font_subset,
void *closure)
{
cairo_svg_document_t *document = closure;
int i;
unsigned int i;
for (i = 0; i < font_subset->num_glyphs; i++) {
_cairo_svg_document_emit_glyph (document,

View file

@ -51,7 +51,7 @@ typedef struct _cairo_truetype_font {
struct {
char *base_font;
int num_glyphs;
unsigned int num_glyphs;
int *widths;
long x_min, y_min, x_max, y_max;
long ascent, descent;
@ -445,7 +445,7 @@ static int
cairo_truetype_font_write_cmap_table (cairo_truetype_font_t *font,
unsigned long tag)
{
int i;
unsigned int i;
cairo_truetype_font_write_be16 (font, 0);
cairo_truetype_font_write_be16 (font, 1);
@ -549,7 +549,7 @@ cairo_truetype_font_write_glyf_table (cairo_truetype_font_t *font,
tt_head_t header;
unsigned long begin, end;
unsigned char *buffer;
int i;
unsigned int i;
union {
unsigned char *bytes;
uint16_t *short_offsets;
@ -648,7 +648,7 @@ cairo_truetype_font_write_hmtx_table (cairo_truetype_font_t *font,
unsigned long long_entry_size;
unsigned long short_entry_size;
short *p;
int i;
unsigned int i;
tt_hhea_t hhea;
int num_hmetrics;
@ -691,7 +691,7 @@ static int
cairo_truetype_font_write_loca_table (cairo_truetype_font_t *font,
unsigned long tag)
{
int i;
unsigned int i;
tt_head_t header;
unsigned long size;
@ -832,7 +832,7 @@ cairo_truetype_font_generate (cairo_truetype_font_t *font,
{
unsigned long start, end, next;
uint32_t checksum, *checksum_location;
int i;
unsigned int i;
if (cairo_truetype_font_write_offset_table (font))
goto fail;
@ -891,7 +891,7 @@ _cairo_truetype_subset_init (cairo_truetype_subset_t *truetype_subset,
const char *data = NULL; /* squelch bogus compiler warning */
unsigned long length = 0; /* squelch bogus compiler warning */
unsigned long parent_glyph, offsets_length;
int i;
unsigned int i;
const unsigned long *string_offsets = NULL;
unsigned long num_strings = 0;

View file

@ -53,7 +53,7 @@ typedef struct _cairo_type1_font_subset {
cairo_unscaled_font_t *unscaled_font;
unsigned int font_id;
char *base_font;
int num_glyphs;
unsigned int num_glyphs;
long x_min, y_min, x_max, y_max;
long ascent, descent;
@ -958,7 +958,7 @@ _cairo_type1_subset_init (cairo_type1_subset_t *type1_subset,
cairo_type1_font_subset_t *font;
cairo_status_t status;
unsigned long parent_glyph, length;
int i;
unsigned int i;
cairo_unscaled_font_t *unscaled_font;
/* XXX: Need to fix this to work with a general cairo_unscaled_font_t. */