[cairo-commit] pycairo/cairo pycairo-font.c, 1.29, 1.30 pycairo-pattern.c, 1.28, 1.29

Steve Chaplin commit at pdx.freedesktop.org
Sat Mar 4 00:06:23 PST 2006


Committed by: stevech1097

Update of /cvs/cairo/pycairo/cairo
In directory kemper:/tmp/cvs-serv4049/cairo

Modified Files:
	pycairo-font.c pycairo-pattern.c 
Log Message:
'SC'

Index: pycairo-font.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-font.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- pycairo-font.c	23 Jan 2006 03:59:18 -0000	1.29
+++ pycairo-font.c	4 Mar 2006 08:06:21 -0000	1.30
@@ -2,7 +2,7 @@
  *
  * Pycairo - Python bindings for cairo
  *
- * Copyright © 2003-2005 James Henstridge
+ * Copyright © 2003-2006 James Henstridge
  *
  * This library is free software; you can redistribute it and/or
  * modify it either under the terms of the GNU Lesser General Public
@@ -57,10 +57,10 @@
     }
 
     o = PycairoFontFace_Type.tp_alloc (&PycairoFontFace_Type, 0);
-    if (o)
-	((PycairoFontFace *)o)->font_face = font_face;
-    else
+    if (o == NULL)
 	cairo_font_face_destroy (font_face);
+    else
+	((PycairoFontFace *)o)->font_face = font_face;
     return o;
 }
 
@@ -167,10 +167,10 @@
     }
 
     o = PycairoScaledFont_Type.tp_alloc (&PycairoScaledFont_Type, 0);
-    if (o)
-	((PycairoScaledFont *)o)->scaled_font = scaled_font;
-    else
+    if (o == NULL)
 	cairo_scaled_font_destroy (scaled_font);
+    else
+	((PycairoScaledFont *)o)->scaled_font = scaled_font;
     return o;
 }
 
@@ -205,7 +205,7 @@
 	return NULL;
 
     PyObject *o = type->tp_alloc(type, 0);
-    if (o) {
+    if (o != NULL) {
 	cairo_scaled_font_t *scaled_font = cairo_scaled_font_create
 	    (ff->font_face, &mx1->matrix, &mx2->matrix, fo->font_options);
 
@@ -309,10 +309,10 @@
     }
 
     o = PycairoFontOptions_Type.tp_alloc (&PycairoFontOptions_Type, 0);
-    if (o)
-	((PycairoFontOptions *)o)->font_options = font_options;
-    else
+    if (o == NULL)
 	cairo_font_options_destroy (font_options);
+    else
+	((PycairoFontOptions *)o)->font_options = font_options;
     return o;
 }
 
@@ -336,7 +336,7 @@
 font_options_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
 {
     PyObject *o = type->tp_alloc(type, 0);
-    if (o) {
+    if (o != NULL) {
 	cairo_font_options_t *font_options = cairo_font_options_create();
 
 	if (Pycairo_Check_Status (cairo_font_options_status (font_options))) {

Index: pycairo-pattern.c
===================================================================
RCS file: /cvs/cairo/pycairo/cairo/pycairo-pattern.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- pycairo-pattern.c	29 Aug 2005 14:52:30 -0000	1.28
+++ pycairo-pattern.c	4 Mar 2006 08:06:21 -0000	1.29
@@ -2,7 +2,7 @@
  *
  * Pycairo - Python bindings for cairo
  *
- * Copyright © 2004-2005 Steve Chaplin
+ * Copyright © 2004-2006 Steve Chaplin
  *
  * This library is free software; you can redistribute it and/or
  * modify it either under the terms of the GNU Lesser General Public
@@ -63,11 +63,10 @@
     if (type == NULL)
         type = &PycairoPattern_Type;
     o = PycairoPattern_Type.tp_alloc (type, 0);
-    if (o) {
-	((PycairoPattern *)o)->pattern = pattern;
-    } else {
+    if (o == NULL)
 	cairo_pattern_destroy (pattern);
-    }
+    else
+	((PycairoPattern *)o)->pattern = pattern;
     return o;
 }
 
@@ -191,7 +190,7 @@
 	return NULL;
 
     o = type->tp_alloc(type, 0);
-    if (o) {
+    if (o != NULL) {
 	pattern = cairo_pattern_create_rgba (red, green, blue, alpha);
 
 	if (Pycairo_Check_Status (cairo_pattern_status (pattern))) {
@@ -267,7 +266,7 @@
 	return NULL;
 
     o = type->tp_alloc(type, 0);
-    if (o) {
+    if (o != NULL) {
 	pattern = cairo_pattern_create_for_surface (s->surface);
 
 	if (Pycairo_Check_Status (cairo_pattern_status (pattern))) {
@@ -477,7 +476,7 @@
 	return NULL;
 
     o = type->tp_alloc(type, 0);
-    if (o) {
+    if (o != NULL) {
 	pattern = cairo_pattern_create_linear (x0, y0, x1, y1);
 
 	if (Pycairo_Check_Status (cairo_pattern_status (pattern))) {
@@ -553,7 +552,7 @@
 	return NULL;
 
     o = type->tp_alloc(type, 0);
-    if (o) {
+    if (o != NULL) {
 	pattern = cairo_pattern_create_radial (cx0, cy0, radius0,
 					       cx1, cy1, radius1);
 	if (Pycairo_Check_Status (cairo_pattern_status (pattern))) {



More information about the cairo-commit mailing list