@@ -410,10 +410,7 @@ void twin_path_bounds(twin_path_t *path, twin_rect_t *rect)
410410
411411void twin_path_append (twin_path_t * dst , twin_path_t * src )
412412{
413- int p ;
414- int s = 0 ;
415-
416- for (p = 0 ; p < src -> npoints ; p ++ ) {
413+ for (int p = 0 , s = 0 ; p < src -> npoints ; p ++ ) {
417414 if (s < src -> nsublen && p == src -> sublen [s ]) {
418415 _twin_path_sfinish (dst );
419416 s ++ ;
@@ -463,33 +460,26 @@ void twin_composite_path(twin_pixmap_t *dst,
463460 twin_operator_t operator )
464461{
465462 twin_rect_t bounds ;
466- twin_pixmap_t * mask ;
467- twin_operand_t msk ;
468- twin_coord_t width , height ;
469-
470463 twin_path_bounds (path , & bounds );
471464 if (bounds .left >= bounds .right || bounds .top >= bounds .bottom )
472465 return ;
473- width = bounds .right - bounds .left ;
474- height = bounds .bottom - bounds .top ;
475- mask = twin_pixmap_create (TWIN_A8 , width , height );
476466
467+ twin_coord_t width = bounds .right - bounds .left ;
468+ twin_coord_t height = bounds .bottom - bounds .top ;
469+ twin_pixmap_t * mask = twin_pixmap_create (TWIN_A8 , width , height );
477470 if (!mask )
478471 return ;
472+
479473 twin_fill_path (mask , path , - bounds .left , - bounds .top );
480- msk .source_kind = TWIN_PIXMAP ;
481- msk .u .pixmap = mask ;
474+ twin_operand_t msk = {.source_kind = TWIN_PIXMAP , .u .pixmap = mask };
482475 twin_composite (dst , bounds .left , bounds .top , src , src_x + bounds .left ,
483476 src_y + bounds .top , & msk , 0 , 0 , operator , width , height );
484477 twin_pixmap_destroy (mask );
485478}
486479
487480void twin_paint_path (twin_pixmap_t * dst , twin_argb32_t argb , twin_path_t * path )
488481{
489- twin_operand_t src ;
490-
491- src .source_kind = TWIN_SOLID ;
492- src .u .argb = argb ;
482+ twin_operand_t src = {.source_kind = TWIN_SOLID , .u .argb = argb };
493483 twin_composite_path (dst , & src , 0 , 0 , path , TWIN_OVER );
494484}
495485
@@ -521,9 +511,6 @@ void twin_paint_stroke(twin_pixmap_t *dst,
521511 twin_path_t * stroke ,
522512 twin_fixed_t pen_width )
523513{
524- twin_operand_t src ;
525-
526- src .source_kind = TWIN_SOLID ;
527- src .u .argb = argb ;
514+ twin_operand_t src = {.source_kind = TWIN_SOLID , .u .argb = argb };
528515 twin_composite_stroke (dst , & src , 0 , 0 , stroke , pen_width , TWIN_OVER );
529516}
0 commit comments