[babl] extensions: HSV.o: return the number of samples processed, not always 0
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] extensions: HSV.o: return the number of samples processed, not always 0
- Date: Sun, 7 Apr 2013 14:05:50 +0000 (UTC)
commit 4f7f1c85f105bbe2f838f225389569b8c05d0639
Author: Michael Natterer <mitch gimp org>
Date: Sun Apr 7 16:04:49 2013 +0200
extensions: HSV.o: return the number of samples processed, not always 0
extensions/HSV.c | 19 +++++++++++++------
1 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/extensions/HSV.c b/extensions/HSV.c
index 6185fb7..6c66f42 100644
--- a/extensions/HSV.c
+++ b/extensions/HSV.c
@@ -21,6 +21,7 @@
*/
#include "config.h"
+
#include <math.h>
#include <string.h>
@@ -31,11 +32,11 @@
static long rgba_to_hsva (char *src,
char *dst,
- long n);
+ long samples);
static long hsva_to_rgba (char *src,
char *dst,
- long n);
+ long samples);
int init (void);
@@ -87,8 +88,10 @@ init (void)
static long
rgba_to_hsva (char *src,
char *dst,
- long n)
+ long samples)
{
+ long n = samples;
+
while (n--)
{
double red = ((double *) src)[0];
@@ -148,14 +151,17 @@ rgba_to_hsva (char *src,
src += 4 * sizeof (double);
dst += 4 * sizeof (double);
}
- return n;
+
+ return samples;
}
static long
hsva_to_rgba (char *src,
char *dst,
- long n)
+ long samples)
{
+ long n = samples;
+
while (n--)
{
double hue = ((double *) src)[0];
@@ -216,5 +222,6 @@ hsva_to_rgba (char *src,
src += 4 * sizeof (double);
dst += 4 * sizeof (double);
}
- return n;
+
+ return samples;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]