[cairo-commit] cairo/src cairo-atsui-font.c, 1.9, 1.10 cairo-cache.c, 1.10, 1.11 cairo-ft-font.c, 1.61, 1.62 cairo-glitz-surface.c, 1.40, 1.41 cairo-gstate.c, 1.136, 1.137 cairo-matrix.c, 1.27, 1.28 cairo-pattern.c, 1.40, 1.41 cairo-pdf-surface.c, 1.39, 1.40 cairo-spline.c, 1.14, 1.15 cairo-wideint.c, 1.4, 1.5 cairo-win32-font.c, 1.18, 1.19 cairo-xlib-surface.c, 1.74, 1.75

Carl Worth commit at pdx.freedesktop.org
Fri Jun 3 14:51:59 PDT 2005


Committed by: cworth

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

Modified Files:
	cairo-atsui-font.c cairo-cache.c cairo-ft-font.c 
	cairo-glitz-surface.c cairo-gstate.c cairo-matrix.c 
	cairo-pattern.c cairo-pdf-surface.c cairo-spline.c 
	cairo-wideint.c cairo-win32-font.c cairo-xlib-surface.c 
Log Message:

        * CODING_STYLE: Add CODING_STYLE document to standardize on some
        style issues.

        * src/cairo-atsui-font.c:
        * src/cairo-cache.c:
        * src/cairo-ft-font.c:
        * src/cairo-glitz-surface.c:
        * src/cairo-gstate.c:
        * src/cairo-matrix.c:
        * src/cairo-pattern.c:
        * src/cairo-pdf-surface.c:
        * src/cairo-spline.c:
        * src/cairo-wideint.c:
        * src/cairo-win32-font.c:
        * src/cairo-xlib-surface.c: Standardize brace handling around all
        else clauses according to new CODING_STYLE guidelines.


Index: cairo-atsui-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-atsui-font.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- cairo-atsui-font.c	11 May 2005 22:39:26 -0000	1.9
+++ cairo-atsui-font.c	3 Jun 2005 21:51:57 -0000	1.10
@@ -486,14 +486,16 @@
     CGContextSetTextMatrix(myBitmapContext, textTransform);
 
     if (pattern->type == CAIRO_PATTERN_SOLID &&
-	_cairo_pattern_is_opaque_solid(pattern)) {
+	_cairo_pattern_is_opaque_solid(pattern))
+    {
 	cairo_solid_pattern_t *solid = (cairo_solid_pattern_t *)pattern;
 	CGContextSetRGBFillColor(myBitmapContext,
 				 solid->color.red,
 				 solid->color.green,
 				 solid->color.blue, 1.0f);
-    } else
+    } else {
 	CGContextSetRGBFillColor(myBitmapContext, 0.0f, 0.0f, 0.0f, 0.0f);
+    }
 
     // TODO - bold and italic text
     //

Index: cairo-cache.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-cache.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- cairo-cache.c	7 May 2005 04:33:22 -0000	1.10
+++ cairo-cache.c	3 Jun 2005 21:51:57 -0000	1.11
@@ -182,19 +182,25 @@
 	{
 	    /* We are looking up an exact entry. */
 	    if (*probe == NULL)
+	    {
 		/* Found an empty spot, there can't be a match */
 		break;
+	    }
 	    else if (*probe != DEAD_ENTRY 
 		     && (*probe)->hashcode == hash
 		     && predicate (cache, key, *probe))
+	    {
 		return probe;
+	    }
 	}
 	else
 	{
 	    /* We are just looking for a free slot. */
 	    if (*probe == NULL 
 		|| *probe == DEAD_ENTRY)
+	    {
 		return probe;
+	    }
 	}
 
 	if (step == 0) { 	    

Index: cairo-ft-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-ft-font.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- cairo-ft-font.c	1 Jun 2005 20:24:10 -0000	1.61
+++ cairo-ft-font.c	3 Jun 2005 21:51:57 -0000	1.62
@@ -575,10 +575,9 @@
     height = (unsigned int) ((cbox.yMax - cbox.yMin) >> 6);
     stride = (width + 3) & -4;
     
-    if (width * height == 0) 
+    if (width * height == 0) {
 	val->image = NULL;
-    else	
-    {
+    } else  {
 
 	bitmap.pixel_mode = ft_pixel_mode_grays;
 	bitmap.num_grays  = 256;

Index: cairo-glitz-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-glitz-surface.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cairo-glitz-surface.c	1 Jun 2005 20:24:10 -0000	1.40
+++ cairo-glitz-surface.c	3 Jun 2005 21:51:57 -0000	1.41
@@ -1403,8 +1403,9 @@
 		return CAIRO_INT_STATUS_UNSUPPORTED;
 	
 	    _cairo_glitz_area_move_out (area);
-	} else
+	} else {
 	    return CAIRO_INT_STATUS_UNSUPPORTED;
+	}
 		
     /* fall-through */
     case CAIRO_GLITZ_AREA_AVAILABLE: {
@@ -1488,8 +1489,9 @@
 							 to_area->closure,
 							 closure) >= 0)
 		    return CAIRO_INT_STATUS_UNSUPPORTED;
-	    } else
+	    } else {
 		return CAIRO_INT_STATUS_UNSUPPORTED;
+	    }
 	}
 
 	for (i = 0; i < 4; i++)

Index: cairo-gstate.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-gstate.c,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -d -r1.136 -r1.137
--- cairo-gstate.c	3 Jun 2005 16:38:39 -0000	1.136
+++ cairo-gstate.c	3 Jun 2005 21:51:57 -0000	1.137
@@ -1079,9 +1079,13 @@
 	if (pixman_region_intersect (intersection,
 				     gstate->clip.region,
 				     intersection) == PIXMAN_REGION_STATUS_SUCCESS) 
+	{
 	    _region_rect_extents (intersection, extents);
+	}
 	else
+	{
 	    status = CAIRO_STATUS_NO_MEMORY;
+	}
 
 	pixman_region_destroy (intersection);
 

Index: cairo-matrix.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-matrix.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- cairo-matrix.c	9 May 2005 16:12:52 -0000	1.27
+++ cairo-matrix.c	3 Jun 2005 21:51:57 -0000	1.28
@@ -526,7 +526,9 @@
     _cairo_matrix_compute_determinant (matrix, &det);
 
     if (det == 0)
+    {
 	*sx = *sy = 0;
+    }
     else
     {
 	double x = x_major != 0;

Index: cairo-pattern.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pattern.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- cairo-pattern.c	1 Jun 2005 20:24:10 -0000	1.40
+++ cairo-pattern.c	3 Jun 2005 21:51:57 -0000	1.41
@@ -868,8 +868,9 @@
 		    c0_x = y_x + c0_y;
 		    
 		    factor = (c0_e - r0) / (c0_x - r0);
-		} else
+		} else {
 		    factor = -r0;
+		}
 	    }
 
 	    _cairo_pattern_calc_color_at_pixel (&op, factor * 65536, pixels++);
@@ -1130,11 +1131,13 @@
 							       attributes);
 	}
 	else
+	{
 	    status = _cairo_pattern_acquire_surface_for_gradient (src, dst,
 								  x, y,
 								  width, height,
 								  surface_out,
 								  attributes);
+	}
     } break;
     case CAIRO_PATTERN_SURFACE: {
 	cairo_surface_pattern_t *src = (cairo_surface_pattern_t *) pattern;
@@ -1169,8 +1172,11 @@
 	_cairo_surface_release_source_image (dst,
 					     (cairo_image_surface_t *) surface,
 					     attributes->extra);
-    } else
+    }
+    else
+    {
 	cairo_surface_destroy (surface);
+    }
 }
 
 cairo_int_status_t
@@ -1199,7 +1205,7 @@
      * support RENDER-style 4-channel masks. */
     if (src->type == CAIRO_PATTERN_SOLID &&
 	mask && mask->type == CAIRO_PATTERN_SOLID)
-      {
+    {
 	cairo_color_t combined;
 	cairo_solid_pattern_t *src_solid = (cairo_solid_pattern_t *) src;
 	cairo_solid_pattern_t *mask_solid = (cairo_solid_pattern_t *) mask;
@@ -1210,7 +1216,9 @@
 	_cairo_pattern_init_solid (&tmp.solid, &combined);
 
 	mask = NULL;
-    } else {
+    }
+    else
+    {
 	_cairo_pattern_init_copy (&tmp.base, src);
     }
 

Index: cairo-pdf-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-pdf-surface.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- cairo-pdf-surface.c	3 Jun 2005 17:28:42 -0000	1.39
+++ cairo-pdf-surface.c	3 Jun 2005 21:51:57 -0000	1.40
@@ -505,8 +505,7 @@
 	if (header->Index_To_Loc_Format == 0) {
 	    begin = be16_to_cpu (u.short_offsets[index]) * 2;
 	    end = be16_to_cpu (u.short_offsets[index + 1]) * 2;
-	}
-	else {
+	} else {
 	    begin = be32_to_cpu (u.long_offsets[index]);
 	    end = be32_to_cpu (u.long_offsets[index + 1]);
 	}
@@ -631,8 +630,7 @@
     if (header->Index_To_Loc_Format == 0) {
 	for (i = 0; i < font->base.num_glyphs + 1; i++)
 	    cairo_pdf_ft_font_write_be16 (font, font->glyphs[i].location / 2);
-    }
-    else {
+    } else {
 	for (i = 0; i < font->base.num_glyphs + 1; i++)
 	    cairo_pdf_ft_font_write_be32 (font, font->glyphs[i].location);
     }

Index: cairo-spline.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-spline.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- cairo-spline.c	22 Feb 2005 19:35:03 -0000	1.14
+++ cairo-spline.c	3 Jun 2005 21:51:57 -0000	1.15
@@ -64,23 +64,21 @@
     spline->c = *c;
     spline->d = *d;
 
-    if (a->x != b->x || a->y != b->y) {
+    if (a->x != b->x || a->y != b->y)
 	_cairo_slope_init (&spline->initial_slope, &spline->a, &spline->b);
-    } else if (a->x != c->x || a->y != c->y) {
+    else if (a->x != c->x || a->y != c->y)
 	_cairo_slope_init (&spline->initial_slope, &spline->a, &spline->c);
-    } else if (a->x != d->x || a->y != d->y) {
+    else if (a->x != d->x || a->y != d->y)
 	_cairo_slope_init (&spline->initial_slope, &spline->a, &spline->d);
-    } else {
+    else
 	return CAIRO_INT_STATUS_DEGENERATE;
-    }
 
-    if (c->x != d->x || c->y != d->y) {
+    if (c->x != d->x || c->y != d->y)
 	_cairo_slope_init (&spline->final_slope, &spline->c, &spline->d);
-    } else if (b->x != d->x || b->y != d->y) {
+    else if (b->x != d->x || b->y != d->y)
 	_cairo_slope_init (&spline->final_slope, &spline->b, &spline->d);
-    } else {
+    else
 	_cairo_slope_init (&spline->final_slope, &spline->a, &spline->d);
-    }
 
     spline->num_points = 0;
     spline->points_size = 0;

Index: cairo-wideint.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-wideint.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo-wideint.c	19 Jan 2005 15:07:00 -0000	1.4
+++ cairo-wideint.c	3 Jun 2005 21:51:57 -0000	1.5
@@ -421,7 +421,9 @@
 		    num = _cairo_uint64_sub (num, den);
 		}
 		else
+		{
 		    q0 = 0;
+		}
 		
 		q1 = 0;
 		r0 = num.lo;
@@ -937,7 +939,9 @@
 		    num = _cairo_uint128_sub (num, den);
 		}
 		else
+		{
 		    q0 = _cairo_uint32_to_uint64 (0);
+		}
 		
 		q1 = _cairo_uint32_to_uint64 (0);
 		r0 = num.lo;

Index: cairo-win32-font.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-win32-font.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- cairo-win32-font.c	1 Jun 2005 20:24:10 -0000	1.18
+++ cairo-win32-font.c	3 Jun 2005 21:51:57 -0000	1.19
@@ -194,8 +194,9 @@
 	}
 
 	return ANTIALIASED_QUALITY;
-    } else
+    } else {
 	return DEFAULT_QUALITY;
+    }
 }
 
 static cairo_scaled_font_t *

Index: cairo-xlib-surface.c
===================================================================
RCS file: /cvs/cairo/cairo/src/cairo-xlib-surface.c,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -d -r1.74 -r1.75
--- cairo-xlib-surface.c	1 Jun 2005 20:24:10 -0000	1.74
+++ cairo-xlib-surface.c	3 Jun 2005 21:51:57 -0000	1.75
@@ -1122,13 +1122,14 @@
 
     if (CAIRO_SURFACE_RENDER_HAS_CREATE_PICTURE (surface)) {
 	if (!format) {
-	    if (visual) {
+	    if (visual)
 		format = XRenderFindVisualFormat (dpy, visual);
-	    } else if (depth == 1)
+	    else if (depth == 1)
 		format = XRenderFindStandardFormat (dpy, PictStandardA1);
 	}
-    } else
+    } else {
 	format = NULL;
+    }
 
     surface->visual = visual;
     surface->format = format;
@@ -1778,20 +1779,26 @@
 
     _cairo_xlib_surface_ensure_dst_picture (self);
     if (elt_size == 8)
+    {
 	status = _cairo_xlib_surface_show_glyphs8 (scaled_font, operator, g, &key, src, self,
 						   source_x + attributes.x_offset,
 						   source_y + attributes.y_offset, 
 						   glyphs, entries, num_glyphs);
+    }
     else if (elt_size == 16)
+    {
 	status = _cairo_xlib_surface_show_glyphs16 (scaled_font, operator, g, &key, src, self,
 						    source_x + attributes.x_offset,
 						    source_y + attributes.y_offset, 
 						    glyphs, entries, num_glyphs);
+    }
     else 
+    {
 	status = _cairo_xlib_surface_show_glyphs32 (scaled_font, operator, g, &key, src, self,
 						    source_x + attributes.x_offset,
 						    source_y + attributes.y_offset, 
 						    glyphs, entries, num_glyphs);
+    }
 
     for (i = 0; i < num_glyphs; ++i)
 	_xlib_glyphset_cache_destroy_entry (g, entries[i]);




More information about the cairo-commit mailing list