mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-04-17 18:30:39 +02:00
Fix some warnings
This commit is contained in:
parent
ba3823e6b8
commit
78d267ee7a
7 changed files with 25 additions and 28 deletions
|
|
@ -489,8 +489,6 @@ static gboolean
|
|||
graph_view_button_release (GtkWidget *w,
|
||||
GdkEventButton *ev)
|
||||
{
|
||||
GraphView *self = (GraphView *) w;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1599,7 +1599,7 @@ cairo_cff_parse_charstring (cairo_cff_font_t *font,
|
|||
if (font->is_cid) {
|
||||
fd = font->fdselect[glyph_id];
|
||||
sub_num = font->type2_stack_top_value + font->fd_local_sub_bias[fd];
|
||||
if (sub_num >= _cairo_array_num_elements(&font->fd_local_sub_index[fd]))
|
||||
if (sub_num >= (int)_cairo_array_num_elements(&font->fd_local_sub_index[fd]))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
element = _cairo_array_index (&font->fd_local_sub_index[fd], sub_num);
|
||||
if (! font->fd_local_subs_used[fd][sub_num]) {
|
||||
|
|
@ -1608,7 +1608,7 @@ cairo_cff_parse_charstring (cairo_cff_font_t *font,
|
|||
}
|
||||
} else {
|
||||
sub_num = font->type2_stack_top_value + font->local_sub_bias;
|
||||
if (sub_num >= _cairo_array_num_elements(&font->local_sub_index))
|
||||
if (sub_num >= (int)_cairo_array_num_elements(&font->local_sub_index))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
element = _cairo_array_index (&font->local_sub_index, sub_num);
|
||||
if (! font->local_subs_used[sub_num] ||
|
||||
|
|
@ -1634,7 +1634,7 @@ cairo_cff_parse_charstring (cairo_cff_font_t *font,
|
|||
font->type2_seen_first_int = FALSE;
|
||||
|
||||
sub_num = font->type2_stack_top_value + font->global_sub_bias;
|
||||
if (sub_num >= _cairo_array_num_elements(&font->global_sub_index))
|
||||
if (sub_num >= (int)_cairo_array_num_elements(&font->global_sub_index))
|
||||
return CAIRO_INT_STATUS_UNSUPPORTED;
|
||||
element = _cairo_array_index (&font->global_sub_index, sub_num);
|
||||
if (! font->global_subs_used[sub_num] ||
|
||||
|
|
|
|||
|
|
@ -1680,8 +1680,7 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
{
|
||||
if (!document->filters_emitted[filter]) {
|
||||
document->filters_emitted[filter] = TRUE;
|
||||
switch (filter) {
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR:
|
||||
if (filter == CAIRO_SVG_FILTER_REMOVE_COLOR) {
|
||||
// (r, g, b, a) -> (1, 1, 1, a)
|
||||
_cairo_svg_stream_printf (&document->xml_node_filters,
|
||||
"<filter id=\"filter-remove-color\" "
|
||||
|
|
@ -1692,8 +1691,7 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 1 0\" />\n"
|
||||
"</filter>\n");
|
||||
break;
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR_AND_INVERT_ALPHA:
|
||||
} else if (filter == CAIRO_SVG_FILTER_REMOVE_COLOR_AND_INVERT_ALPHA) {
|
||||
// (r, g, b, a) -> (1, 1, 1, 1 - a)
|
||||
_cairo_svg_stream_printf (&document->xml_node_filters,
|
||||
"<filter id=\"filter-remove-color-and-invert-alpha\" "
|
||||
|
|
@ -1704,8 +1702,7 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0 0 0 -1 1\"/>\n"
|
||||
"</filter>\n");
|
||||
break;
|
||||
case CAIRO_SVG_FILTER_COLOR_TO_ALPHA:
|
||||
} else if (filter == CAIRO_SVG_FILTER_COLOR_TO_ALPHA) {
|
||||
// (r, g, b, a) -> (1, 1, 1, 0.2126 * r + 0.7152 * g + 0.0722 * b)
|
||||
_cairo_svg_stream_printf (&document->xml_node_filters,
|
||||
"<filter id=\"filter-color-to-alpha\" "
|
||||
|
|
@ -1716,23 +1713,19 @@ _cairo_svg_surface_emit_static_filter (cairo_svg_document_t *document, enum cair
|
|||
/* */ "0 0 0 0 1 "
|
||||
/* */ "0.2126 0.7152 0.0722 0 0\"/>\n"
|
||||
"</filter>\n");
|
||||
break;
|
||||
default:
|
||||
ASSERT_NOT_REACHED;
|
||||
}
|
||||
}
|
||||
|
||||
switch (filter) {
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR:
|
||||
if (filter == CAIRO_SVG_FILTER_REMOVE_COLOR) {
|
||||
return "remove-color";
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR_AND_INVERT_ALPHA:
|
||||
} else if (filter == CAIRO_SVG_FILTER_REMOVE_COLOR_AND_INVERT_ALPHA) {
|
||||
return "remove-color-and-invert-alpha";
|
||||
case CAIRO_SVG_FILTER_COLOR_TO_ALPHA:
|
||||
} else if (filter == CAIRO_SVG_FILTER_COLOR_TO_ALPHA) {
|
||||
return "color-to-alpha";
|
||||
default:
|
||||
} else {
|
||||
ASSERT_NOT_REACHED;
|
||||
return FALSE; /* squelch warning */
|
||||
}
|
||||
return FALSE; /* squelch warning */
|
||||
}
|
||||
|
||||
#define _CAIRO_SVG_SURFACE_OUTPUT_FE_COMPOSITE_FILTER(operation) \
|
||||
|
|
@ -1882,6 +1875,10 @@ _cairo_svg_surface_emit_parametric_filter (cairo_svg_surface_t *surface,
|
|||
case CAIRO_SVG_FILTER_LUMINOSITY:
|
||||
_CAIRO_SVG_SURFACE_OUTPUT_FE_BLEND_FILTER ("luminosity")
|
||||
break;
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR:
|
||||
case CAIRO_SVG_FILTER_REMOVE_COLOR_AND_INVERT_ALPHA:
|
||||
case CAIRO_SVG_FILTER_COLOR_TO_ALPHA:
|
||||
case CAIRO_SVG_FILTER_LAST_STATIC_FILTER:
|
||||
default:
|
||||
ASSERT_NOT_REACHED;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -630,7 +630,7 @@ cairo_type1_font_subset_decrypt_eexec_segment (cairo_type1_font_subset_t *font)
|
|||
unsigned char *in, *end;
|
||||
char *out;
|
||||
int c, p;
|
||||
int i;
|
||||
unsigned int i;
|
||||
|
||||
in = (unsigned char *) font->eexec_segment;
|
||||
end = (unsigned char *) in + font->eexec_segment_size;
|
||||
|
|
|
|||
|
|
@ -176,13 +176,13 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
status = face->scaled_font_methods.render_color_glyph ((cairo_scaled_font_t *)scaled_font,
|
||||
_cairo_scaled_glyph_index(scaled_glyph),
|
||||
cr, &extents);
|
||||
if (status == CAIRO_STATUS_SUCCESS) {
|
||||
if (status == CAIRO_INT_STATUS_SUCCESS) {
|
||||
status = cairo_status (cr);
|
||||
scaled_glyph->has_color = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (status == CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED &&
|
||||
if (status == (cairo_int_status_t)CAIRO_STATUS_USER_FONT_NOT_IMPLEMENTED &&
|
||||
face->scaled_font_methods.render_glyph) {
|
||||
recording_surface = _cairo_user_scaled_font_create_recording_surface (scaled_font, FALSE);
|
||||
|
||||
|
|
@ -196,7 +196,7 @@ _cairo_user_scaled_glyph_init (void *abstract_font,
|
|||
cairo_destroy (cr);
|
||||
}
|
||||
|
||||
if (status != CAIRO_STATUS_SUCCESS) {
|
||||
if (status != CAIRO_INT_STATUS_SUCCESS) {
|
||||
if (recording_surface)
|
||||
cairo_surface_destroy (recording_surface);
|
||||
return status;
|
||||
|
|
|
|||
|
|
@ -791,7 +791,8 @@ matches_reference (struct slave *slave)
|
|||
int channel;
|
||||
|
||||
for (channel = 0; channel < 4; channel++) {
|
||||
unsigned va, vb, diff;
|
||||
int va, vb;
|
||||
unsigned diff;
|
||||
|
||||
va = (ua[x] >> (channel*8)) & 0xff;
|
||||
vb = (ub[x] >> (channel*8)) & 0xff;
|
||||
|
|
@ -815,7 +816,8 @@ matches_reference (struct slave *slave)
|
|||
int channel;
|
||||
|
||||
for (channel = 0; channel < 3; channel++) {
|
||||
unsigned va, vb, diff;
|
||||
int va, vb;
|
||||
unsigned diff;
|
||||
|
||||
va = (ua[x] >> (channel*8)) & 0xff;
|
||||
vb = (ub[x] >> (channel*8)) & 0xff;
|
||||
|
|
|
|||
|
|
@ -28,8 +28,8 @@
|
|||
#define WIDTH 160
|
||||
#define HEIGHT 120
|
||||
|
||||
void
|
||||
example (cairo_t *cr, char *name)
|
||||
static void
|
||||
example (cairo_t *cr, const char *name)
|
||||
{
|
||||
cairo_save (cr);
|
||||
cairo_push_group_with_content (cr, cairo_surface_get_content (cairo_get_target (cr)));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue