void function should not return a value

Submitted by Niveditha Rau on Feb. 22, 2019, 10:56 p.m.

Details

Message ID acc809cc-5fea-e0ca-1c88-bd86e03f7466@oracle.com
State New
Headers show
Series "void function should not return a value" ( rev: 2 ) in Pixman

Not browsing as part of any series.

Commit Message

Niveditha Rau Feb. 22, 2019, 10:56 p.m.
On 02/22/2019 01:51 PM, Simon Richter wrote:
> 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;
> +           }
>   	}
>
ok, thanks.  Please find attached a reworked patch.

Thanks
Niveditha

Patch hide | download patch | download mbox

From f1e290720d2ce7c0a238371bf100c478ac796771 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 | 30 ++++++++++++++++++++++++------
 1 file changed, 24 insertions(+), 6 deletions(-)

diff --git a/pixman/pixman-radial-gradient.c b/pixman/pixman-radial-gradient.c
index 0367d78..9760f2d 100644
--- a/pixman/pixman-radial-gradient.c
+++ b/pixman/pixman-radial-gradient.c
@@ -111,12 +111,18 @@  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);
+		return;
+	    }
 	}
 	else
 	{
 	    if (t * dr >= mindr)
-		return write_pixel (walker, t, buffer);
+	    {
+		write_pixel (walker, t, buffer);
+		return;
+	    }
 	}
 
 	memset (buffer, 0, Bpp);
@@ -146,16 +152,28 @@  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);
+		return;
+ 	    }
 	    else if (0 <= t1 && t1 <= pixman_fixed_1)
-		return write_pixel (walker, t1, buffer);
+	    {
+		write_pixel (walker, t1, buffer);
+		return;
+           }
 	}
 	else
 	{
 	    if (t0 * dr >= mindr)
-		return write_pixel (walker, t0, buffer);
+	    {
+		write_pixel (walker, t0, buffer);
+		return;
+	    }
 	    else if (t1 * dr >= mindr)
-		return write_pixel (walker, t1, buffer);
+	    {
+		write_pixel (walker, t1, buffer);
+		return;
+	    }
 	}
     }
 
-- 
2.17.1


Comments

Thanks. Merged.