void function should not return a value

Submitted by Niveditha Rau on Feb. 22, 2019, 9:48 p.m.

Details

Message ID ef5e2bea-8335-1dad-8c4e-2882f0ef10b4@oracle.com
State New
Headers show
Series "void function should not return a value" ( rev: 1 ) in Pixman

Not browsing as part of any series.

Commit Message

Niveditha Rau Feb. 22, 2019, 9:48 p.m.
When compiling pixman with Oracle Developer Studio on Solaris, we get 
the following error:
pixman-0.38.0/pixman/pixman-radial-gradient.c", line 114: void function 
cannot return value

Would the attached patch be acceptable upstream?

Thanks
Niveditha

Patch hide | download patch | download mbox

From d993f475da58542887ced930f96f9fca46acdc86 Mon Sep 17 00:00:00 2001
From: Niveditha Rau <niveditha.rau@oracle.com>
Date: Fri, 22 Feb 2019 13:06:32 -0800
Subject: [PATCH] void function should not return a value

---
 pixman/pixman-radial-gradient.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c
index 0367d78..f346a09 100644
--- a/pixman/pixman-radial-gradient.c
+++ b/pixman/pixman-radial-gradient.c
@@ -111,12 +111,12 @@  radial_write_color (double                         a,
 	if (repeat == PIXMAN_REPEAT_NONE)
 	{
 	    if (0 <= t && t <= pixman_fixed_1)
-		return write_pixel (walker, t, buffer);
+		write_pixel (walker, t, buffer);
 	}
 	else
 	{
 	    if (t * dr >= mindr)
-		return write_pixel (walker, t, buffer);
+		write_pixel (walker, t, buffer);
 	}
 
 	memset (buffer, 0, Bpp);
@@ -146,16 +146,16 @@  radial_write_color (double                         a,
 	if (repeat == PIXMAN_REPEAT_NONE)
 	{
 	    if (0 <= t0 && t0 <= pixman_fixed_1)
-		return write_pixel (walker, t0, buffer);
+		write_pixel (walker, t0, buffer);
 	    else if (0 <= t1 && t1 <= pixman_fixed_1)
-		return write_pixel (walker, t1, buffer);
+		write_pixel (walker, t1, buffer);
 	}
 	else
 	{
 	    if (t0 * dr >= mindr)
-		return write_pixel (walker, t0, buffer);
+		write_pixel (walker, t0, buffer);
 	    else if (t1 * dr >= mindr)
-		return write_pixel (walker, t1, buffer);
+		write_pixel (walker, t1, buffer);
 	}
     }
 
-- 
2.17.1


Comments

Hi,

On 22.02.19 22:48, Niveditha Rau wrote:

> When compiling pixman with Oracle Developer Studio on Solaris, we get
> the following error:
> pixman-0.38.0/pixman/pixman-radial-gradient.c", line 114: void function
> cannot return value

> Would the attached patch be acceptable upstream?

No, because the flow is different. It'd have to be

 	if (repeat == PIXMAN_REPEAT_NONE)
 	{
 	    if (0 <= t && t <= pixman_fixed_1)
+           {
-		return write_pixel (walker, t, buffer);
+		write_pixel (walker, t, buffer);
+               return;
+           }
 	}