[babl] babl: drop long return from conversion funcs
- From: Øyvind Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] babl: drop long return from conversion funcs
- Date: Thu, 7 Sep 2017 13:50:47 +0000 (UTC)
commit 34b25ce6b5f77443aa347c48e779cea52d7acc42
Author: Øyvind Kolås <pippin gimp org>
Date: Thu Sep 7 15:48:13 2017 +0200
babl: drop long return from conversion funcs
They are propagated and instructions are spent on that, but their value are
never used. Some conversion functions in base even used the argument passed for
counting down to 0 and return 0 instead, to no ill effect.
Since we do not currently see external babl extensions, we can break extensions
API without bumping the library version, this is even a change where due to
varargs, old extensions will continue working until migrated.
babl/babl-conversion.c | 18 +++++++++---------
babl/babl-conversion.h | 14 +++++++-------
babl/babl-palette.c | 19 ++++++-------------
babl/babl-space.c | 44 +++++++++++---------------------------------
babl/babl-types.h | 4 ++--
babl/base/model-gray.c | 38 ++++++++++++--------------------------
babl/base/model-rgb.c | 28 +++++++++-------------------
babl/base/model-ycbcr.c | 13 ++++---------
babl/base/type-float.c | 6 ++----
babl/base/type-half.c | 6 ++----
babl/base/type-u15.c | 18 ++++++++----------
babl/base/type-u16.c | 18 ++++++++----------
babl/base/type-u32.c | 18 ++++++++----------
babl/base/type-u8.c | 18 ++++++++----------
14 files changed, 96 insertions(+), 166 deletions(-)
---
diff --git a/babl/babl-conversion.c b/babl/babl-conversion.c
index 6a0a523..b08f835 100644
--- a/babl/babl-conversion.c
+++ b/babl/babl-conversion.c
@@ -311,16 +311,16 @@ babl_conversion_new (const void *first_arg,
return babl;
}
-static long
+static void
babl_conversion_linear_process (BablConversion *conversion,
const void *source,
void *destination,
long n)
{
- return conversion->function.linear ((void*)conversion, source, destination, n, conversion->data);
+ conversion->function.linear ((void*)conversion, source, destination, n, conversion->data);
}
-static long
+static void
babl_conversion_plane_process (BablConversion *conversion,
const void *source,
void *destination,
@@ -328,13 +328,13 @@ babl_conversion_plane_process (BablConversion *conversion,
int dst_pitch,
long n)
{
- return conversion->function.plane ((void*)conversion, source, destination,
- src_pitch, dst_pitch,
- n,
- conversion->data);
+ conversion->function.plane ((void*)conversion, source, destination,
+ src_pitch, dst_pitch,
+ n,
+ conversion->data);
}
-static long
+static void
babl_conversion_planar_process (BablConversion *conversion,
BablImage *source,
BablImage *destination,
@@ -350,7 +350,7 @@ babl_conversion_planar_process (BablConversion *conversion,
memcpy (src_data, source->data, sizeof (void *) * source->components);
memcpy (dst_data, destination->data, sizeof (void *) * destination->components);
- return conversion->function.planar ((void*)conversion,
+ conversion->function.planar ((void*)conversion,
source->components,
src_data,
source->pitch,
diff --git a/babl/babl-conversion.h b/babl/babl-conversion.h
index ac7ade6..1f8f8ab 100644
--- a/babl/babl-conversion.h
+++ b/babl/babl-conversion.h
@@ -29,13 +29,13 @@ typedef struct _BablConversion BablConversion;
/* Signature of functions registered for reference type
* conversions,
*/
-typedef long (*BablFuncPlane) (BablConversion *conversion,
- const char *src,
- char *dst,
- int src_pitch,
- int dst_pitch,
- long n,
- void *user_data);
+typedef void (*BablFuncPlane) (BablConversion *conversion,
+ const char *src,
+ char *dst,
+ int src_pitch,
+ int dst_pitch,
+ long n,
+ void *user_data);
struct
_BablConversion {
diff --git a/babl/babl-palette.c b/babl/babl-palette.c
index 7284d6b..f8c7fa8 100644
--- a/babl/babl-palette.c
+++ b/babl/babl-palette.c
@@ -176,7 +176,7 @@ static BablPalette *default_palette (void)
return &pal;
}
-static long
+static void
rgba_to_pal (Babl *conversion,
char *src,
char *dst,
@@ -215,10 +215,9 @@ rgba_to_pal (Babl *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 1;
}
- return n;
}
-static long
+static void
rgba_to_pala (Babl *conversion,
char *src,
char *dst,
@@ -262,10 +261,9 @@ rgba_to_pala (Babl *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 2;
}
- return n;
}
-static long
+static void
pal_to_rgba (Babl *conversion,
char *src,
char *dst,
@@ -289,10 +287,9 @@ pal_to_rgba (Babl *conversion,
src += sizeof (double) * 1;
dst += sizeof (double) * 4;
}
- return n;
}
-static long
+static void
pala_to_rgba (Babl *conversion,
char *src,
char *dst,
@@ -320,10 +317,9 @@ pala_to_rgba (Babl *conversion,
src += sizeof (double) * 2;
dst += sizeof (double) * 4;
}
- return n;
}
-static long
+static void
rgba_u8_to_pal (Babl *conversion,
unsigned char *src,
unsigned char *dst,
@@ -342,11 +338,9 @@ rgba_u8_to_pal (Babl *conversion,
src += sizeof (char) * 4;
dst += sizeof (char) * 1;
}
-
- return n;
}
-static long
+static void
rgba_u8_to_pal_a (Babl *conversion,
char *src,
char *dst,
@@ -366,7 +360,6 @@ rgba_u8_to_pal_a (Babl *conversion,
src += sizeof (char) * 4;
dst += sizeof (char) * 2;
}
- return n;
}
static long
diff --git a/babl/babl-space.c b/babl/babl-space.c
index 40a21c9..3f0812b 100644
--- a/babl/babl-space.c
+++ b/babl/babl-space.c
@@ -472,7 +472,7 @@ static void prep_conversion (const Babl *babl)
-static inline long
+static inline void
universal_nonlinear_rgb_converter (const Babl *conversion,unsigned char *src_char, unsigned char *dst_char,
long samples)
{
const Babl *source_space = babl_conversion_get_source_space (conversion);
@@ -487,11 +487,9 @@ universal_nonlinear_rgb_converter (const Babl *conversion,unsigned char *src_cha
babl_matrix_mul_vectorff_buf4 (matrixf, rgba_out, rgba_out, samples);
TRC_OUT(rgba_out, rgba_out);
-
- return samples;
}
-static inline long
+static inline void
universal_nonlinear_rgb_linear_converter (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *source_space = babl_conversion_get_source_space (conversion);
@@ -502,11 +500,9 @@ universal_nonlinear_rgb_linear_converter (const Babl *conversion,unsigned char *
TRC_IN(rgba_in, rgba_out);
babl_matrix_mul_vectorff_buf4 (matrixf, rgba_out, rgba_out, samples);
-
- return samples;
}
-static inline long
+static inline void
universal_nonlinear_rgba_u8_converter (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *destination_space = conversion->conversion.destination->format.space;
@@ -541,12 +537,10 @@ universal_nonlinear_rgba_u8_converter (const Babl *conversion,unsigned char *src
}
}
babl_free (rgb);
-
- return samples;
}
-static inline long
+static inline void
universal_rgba_converter (const Babl *conversion,unsigned char *src_char, unsigned char *dst_char, long
samples)
{
float *matrixf = conversion->conversion.data;
@@ -554,11 +548,9 @@ universal_rgba_converter (const Babl *conversion,unsigned char *src_char, unsign
float *rgba_out = (void*)dst_char;
babl_matrix_mul_vectorff_buf4 (matrixf, rgba_in, rgba_out, samples);
-
- return samples;
}
-static inline long
+static inline void
universal_rgb_converter (const Babl *conversion,unsigned char *src_char, unsigned char *dst_char, long
samples)
{
float *matrixf = conversion->conversion.data;
@@ -566,12 +558,10 @@ universal_rgb_converter (const Babl *conversion,unsigned char *src_char, unsigne
float *rgb_out = (void*)dst_char;
babl_matrix_mul_vectorff_buf3 (matrixf, rgb_in, rgb_out, samples);
-
- return samples;
}
-static inline long
+static inline void
universal_nonlinear_rgb_u8_converter (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *destination_space = conversion->conversion.destination->format.space;
@@ -603,8 +593,6 @@ universal_nonlinear_rgb_u8_converter (const Babl *conversion,unsigned char *src_
}
babl_free (rgba_out);
-
- return samples;
}
@@ -639,7 +627,7 @@ static inline void babl_matrix_mul_vectorff_buf4_sse2 (const float *mat,
#undef m
-static inline long
+static inline void
universal_nonlinear_rgb_converter_sse2 (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *source_space = babl_conversion_get_source_space (conversion);
@@ -653,12 +641,10 @@ universal_nonlinear_rgb_converter_sse2 (const Babl *conversion,unsigned char *sr
babl_matrix_mul_vectorff_buf4_sse2 (matrixf, rgba_out, rgba_out, samples);
TRC_OUT(rgba_out, rgba_out);
-
- return samples;
}
-static inline long
+static inline void
universal_rgba_converter_sse2 (const Babl *conversion,unsigned char *src_char, unsigned char *dst_char, long
samples)
{
float *matrixf = conversion->conversion.data;
@@ -666,11 +652,9 @@ universal_rgba_converter_sse2 (const Babl *conversion,unsigned char *src_char, u
float *rgba_out = (void*)dst_char;
babl_matrix_mul_vectorff_buf4_sse2 (matrixf, rgba_in, rgba_out, samples);
-
- return samples;
}
-static inline long
+static inline void
universal_nonlinear_rgba_u8_converter_sse2 (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *destination_space = conversion->conversion.destination->format.space;
@@ -703,11 +687,9 @@ universal_nonlinear_rgba_u8_converter_sse2 (const Babl *conversion,unsigned char
}
babl_free (rgba_out);
-
- return samples;
}
-static inline long
+static inline void
universal_nonlinear_rgb_u8_converter_sse2 (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *destination_space = conversion->conversion.destination->format.space;
@@ -739,12 +721,10 @@ universal_nonlinear_rgb_u8_converter_sse2 (const Babl *conversion,unsigned char
}
babl_free (rgba_out);
-
- return samples;
}
-static inline long
+static inline void
universal_nonlinear_rgb_linear_converter_sse2 (const Babl *conversion,unsigned char *src_char, unsigned char
*dst_char, long samples)
{
const Babl *source_space = babl_conversion_get_source_space (conversion);
@@ -755,8 +735,6 @@ universal_nonlinear_rgb_linear_converter_sse2 (const Babl *conversion,unsigned c
TRC_IN(rgba_in, rgba_out);
babl_matrix_mul_vectorff_buf4_sse2 (matrixf, rgba_out, rgba_out, samples);
-
- return samples;
}
#endif
diff --git a/babl/babl-types.h b/babl/babl-types.h
index e4e5a85..c1c4c27 100644
--- a/babl/babl-types.h
+++ b/babl/babl-types.h
@@ -37,14 +37,14 @@ typedef union _Babl Babl;
/* Conversion function between linear data of a either a data types or
* color formats.
*/
-typedef long (*BablFuncLinear) (const Babl *conversion,
+typedef void (*BablFuncLinear) (const Babl *conversion,
const char *src,
char *dst,
long n,
void *user_data);
/* TypePlanar,ModelPlanar and FormatPlanar */
-typedef long (*BablFuncPlanar) (const Babl *conversion,
+typedef void (*BablFuncPlanar) (const Babl *conversion,
int src_bands,
const char *src[],
int src_pitch[],
diff --git a/babl/base/model-gray.c b/babl/base/model-gray.c
index adb9fd8..d2cf060 100644
--- a/babl/base/model-gray.c
+++ b/babl/base/model-gray.c
@@ -107,7 +107,7 @@ models (void)
}
-static long
+static void
rgba_to_graya (Babl *conversion,
char *src,
char *dst,
@@ -138,10 +138,9 @@ rgba_to_graya (Babl *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 2;
}
- return n;
}
-static long
+static void
rgba_to_gray (Babl *conversion,
char *src,
char *dst,
@@ -170,10 +169,9 @@ rgba_to_gray (Babl *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 1;
}
- return n;
}
-static long
+static void
rgb_to_gray_2_2 (Babl *conversion,
int src_bands,
char **src,
@@ -213,11 +211,10 @@ rgb_to_gray_2_2 (Babl *conversion,
BABL_PLANAR_STEP
}
- return n;
}
-static long
+static void
gray_2_2_to_rgb (Babl *conversion,
int src_bands,
char **src,
@@ -255,12 +252,9 @@ gray_2_2_to_rgb (Babl *conversion,
BABL_PLANAR_STEP
}
- return n;
}
-
-
-static long
+static void
graya_to_rgba (Babl *conversion,
char *src,
char *dst,
@@ -286,11 +280,10 @@ graya_to_rgba (Babl *conversion,
src += sizeof (double) * 2;
dst += sizeof (double) * 4;
}
- return n;
}
-static long
+static void
gray_to_rgba (Babl *conversion,
char *src,
char *dst,
@@ -314,10 +307,9 @@ gray_to_rgba (Babl *conversion,
src += sizeof (double) * 1;
dst += sizeof (double) * 4;
}
- return n;
}
-static long
+static void
gray_alpha_premultiplied_to_rgba (Babl *conversion,
int src_bands,
char **src,
@@ -351,11 +343,10 @@ gray_alpha_premultiplied_to_rgba (Babl *conversion,
*(double *) dst[3] = alpha;
BABL_PLANAR_STEP
}
- return n;
}
-static long
+static void
rgba_to_gray_alpha_premultiplied (Babl *conversion,
int src_bands,
char **src,
@@ -392,10 +383,9 @@ rgba_to_gray_alpha_premultiplied (Babl *conversion,
*(double *) dst[1] = alpha;
BABL_PLANAR_STEP
}
- return n;
}
-static long
+static void
non_premultiplied_to_premultiplied (Babl *conversion,
int src_bands,
char **src,
@@ -421,10 +411,9 @@ non_premultiplied_to_premultiplied (Babl *conversion,
BABL_PLANAR_STEP
}
- return n;
}
-static long
+static void
premultiplied_to_non_premultiplied (Babl *conversion,
int src_bands,
char **src,
@@ -457,10 +446,9 @@ premultiplied_to_non_premultiplied (Babl *conversion,
BABL_PLANAR_STEP
}
- return n;
}
-static long
+static void
rgba2gray_gamma_2_2_premultiplied (Babl *conversion,
char *src,
char *dst,
@@ -493,11 +481,10 @@ rgba2gray_gamma_2_2_premultiplied (Babl *conversion,
src += 4 * sizeof (double);
dst += 2 * sizeof (double);
}
- return n;
}
-static long
+static void
gray_gamma_2_2_premultiplied2rgba (Babl *conversion,
char *src,
char *dst,
@@ -523,7 +510,6 @@ gray_gamma_2_2_premultiplied2rgba (Babl *conversion,
src += 2 * sizeof (double);
dst += 4 * sizeof (double);
}
- return n;
}
diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c
index 4fcd2fb..7da204f 100644
--- a/babl/base/model-rgb.c
+++ b/babl/base/model-rgb.c
@@ -149,7 +149,7 @@ models (void)
NULL);
}
-static long
+static void
copy_strip_1 (Babl *conversion,
int src_bands,
char **src,
@@ -178,10 +178,9 @@ copy_strip_1 (Babl *conversion,
BABL_PLANAR_STEP
}
- return samples;
}
-static long
+static void
g3_gamma_2_2 (Babl *conversion,
int src_bands,
char **src,
@@ -207,11 +206,10 @@ g3_gamma_2_2 (Babl *conversion,
BABL_PLANAR_STEP
}
- return samples;
}
-static long
+static void
g3_inv_gamma_2_2 (Babl *conversion,
int src_bands,
char **src,
@@ -242,10 +240,9 @@ g3_inv_gamma_2_2 (Babl *conversion,
}
BABL_PLANAR_STEP
}
- return samples;
}
-static long
+static void
non_premultiplied_to_premultiplied (Babl *conversion,
int src_bands,
char **src,
@@ -272,10 +269,9 @@ non_premultiplied_to_premultiplied (Babl *conversion,
BABL_PLANAR_STEP
}
- return samples;
}
-static long
+static void
premultiplied_to_non_premultiplied (Babl *conversion,
int src_bands,
char **src,
@@ -309,12 +305,10 @@ premultiplied_to_non_premultiplied (Babl *conversion,
BABL_PLANAR_STEP
}
- return samples;
}
-
-static long
+static void
rgba2rgba_gamma_2_2_premultiplied (Babl *conversion,
char *src,
char *dst,
@@ -334,11 +328,10 @@ rgba2rgba_gamma_2_2_premultiplied (Babl *conversion,
src += 4 * sizeof (double);
dst += 4 * sizeof (double);
}
- return samples;
}
-static long
+static void
rgba_gamma_2_2_premultiplied2rgba (Babl *conversion,
char *src,
char *dst,
@@ -368,11 +361,10 @@ rgba_gamma_2_2_premultiplied2rgba (Babl *conversion,
src += 4 * sizeof (double);
dst += 4 * sizeof (double);
}
- return samples;
}
-static long
+static void
rgba2rgba_gamma_2_2 (Babl *conversion,
char *src,
char *dst,
@@ -392,11 +384,10 @@ rgba2rgba_gamma_2_2 (Babl *conversion,
src += 4 * sizeof (double);
dst += 4 * sizeof (double);
}
- return samples;
}
-static long
+static void
rgba_gamma_2_22rgba (Babl *conversion,
char *src,
char *dst,
@@ -417,7 +408,6 @@ rgba_gamma_2_22rgba (Babl *conversion,
src += 4 * sizeof (double);
dst += 4 * sizeof (double);
}
- return samples;
}
static void
diff --git a/babl/base/model-ycbcr.c b/babl/base/model-ycbcr.c
index c6de014..6b34d20 100644
--- a/babl/base/model-ycbcr.c
+++ b/babl/base/model-ycbcr.c
@@ -77,7 +77,7 @@ models (void)
NULL);
}
-static long
+static void
rgba_to_ycbcra (BablConversion *conversion,
char *src,
char *dst,
@@ -108,11 +108,10 @@ rgba_to_ycbcra (BablConversion *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 4;
}
- return n;
}
-static long
+static void
rgba_to_ycbcr (BablConversion *conversion,
char *src,
char *dst,
@@ -141,10 +140,9 @@ rgba_to_ycbcr (BablConversion *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 3;
}
- return n;
}
-static long
+static void
ycbcra_to_rgba (BablConversion *conversion,
char *src,
char *dst,
@@ -175,11 +173,9 @@ ycbcra_to_rgba (BablConversion *conversion,
src += sizeof (double) * 4;
dst += sizeof (double) * 4;
}
- return n;
}
-
-static long
+static void
ycbcr_to_rgba (BablConversion *conversion,
char *src,
char *dst,
@@ -209,7 +205,6 @@ ycbcr_to_rgba (BablConversion *conversion,
src += sizeof (double) * 3;
dst += sizeof (double) * 4;
}
- return n;
}
static void
diff --git a/babl/base/type-float.c b/babl/base/type-float.c
index 8c62021..709c7fa 100644
--- a/babl/base/type-float.c
+++ b/babl/base/type-float.c
@@ -25,7 +25,7 @@
#include "babl-ids.h"
#include "babl-base.h"
-static long
+static void
convert_double_float (BablConversion *conversion,
char *src,
char *dst,
@@ -39,10 +39,9 @@ convert_double_float (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
-static long
+static void
convert_float_double (BablConversion *conversion,
char *src,
char *dst,
@@ -56,7 +55,6 @@ convert_float_double (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
void
diff --git a/babl/base/type-half.c b/babl/base/type-half.c
index 64fd15d..93d5e5b 100644
--- a/babl/base/type-half.c
+++ b/babl/base/type-half.c
@@ -183,7 +183,7 @@ static void halfp2doubles(void *target, void *source, long numel)
}
}
-static long
+static void
convert_double_half (BablConversion *conversion,
char *src,
char *dst,
@@ -197,10 +197,9 @@ convert_double_half (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
-static long
+static void
convert_half_double (BablConversion *conversion,
char *src,
char *dst,
@@ -214,7 +213,6 @@ convert_half_double (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
void
diff --git a/babl/base/type-u15.c b/babl/base/type-u15.c
index ee188e8..355f875 100644
--- a/babl/base/type-u15.c
+++ b/babl/base/type-u15.c
@@ -26,7 +26,7 @@
#include "babl-base.h"
-static inline long
+static inline void
convert_double_u15_scaled (BablConversion *conversion,
double min_val,
double max_val,
@@ -54,10 +54,9 @@ convert_double_u15_scaled (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
-static inline long
+static inline void
convert_u15_double_scaled (BablConversion *conversion,
double min_val,
double max_val,
@@ -85,11 +84,10 @@ convert_u15_double_scaled (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
#define MAKE_CONVERSIONS(name, min_val, max_val, min, max) \
- static long \
+ static void \
convert_ ## name ## _double (BablConversion *conversion, \
void *src, \
void *dst, \
@@ -97,18 +95,18 @@ convert_u15_double_scaled (BablConversion *conversion,
int dst_pitch, \
long n) \
{ \
- return convert_u15_double_scaled (conversion, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_u15_double_scaled (conversion, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
} \
- static long \
+ static void \
convert_double_ ## name (BablConversion *conversion, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_double_u15_scaled (conversion, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_double_u15_scaled (conversion, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
}
MAKE_CONVERSIONS (u15, 0.0, 1.0, 0, (1<<15))
diff --git a/babl/base/type-u16.c b/babl/base/type-u16.c
index 697f1da..4a7c8f1 100644
--- a/babl/base/type-u16.c
+++ b/babl/base/type-u16.c
@@ -26,7 +26,7 @@
#include "babl-base.h"
-static inline long
+static inline void
convert_double_u16_scaled (BablConversion *conversion,
double min_val,
double max_val,
@@ -54,10 +54,9 @@ convert_double_u16_scaled (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
-static inline long
+static inline void
convert_u16_double_scaled (BablConversion *conversion,
double min_val,
double max_val,
@@ -85,29 +84,28 @@ convert_u16_double_scaled (BablConversion *conversion,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
#define MAKE_CONVERSIONS(name, min_val, max_val, min, max) \
- static long \
+ static void \
convert_ ## name ## _double (BablConversion *c, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_u16_double_scaled (c, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_u16_double_scaled (c, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
} \
- static long \
+ static void \
convert_double_ ## name (BablConversion *c, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_double_u16_scaled (c, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_double_u16_scaled (c, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
}
MAKE_CONVERSIONS (u16, 0.0, 1.0, 0, UINT16_MAX)
diff --git a/babl/base/type-u32.c b/babl/base/type-u32.c
index b934dbe..66a5654 100644
--- a/babl/base/type-u32.c
+++ b/babl/base/type-u32.c
@@ -25,7 +25,7 @@
#include "babl-internal.h"
#include "babl-base.h"
-static inline long
+static inline void
convert_double_u32_scaled (BablConversion *c,
double min_val,
double max_val,
@@ -53,10 +53,9 @@ convert_double_u32_scaled (BablConversion *c,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
-static inline long
+static inline void
convert_u32_double_scaled (BablConversion *c,
double min_val,
double max_val,
@@ -84,29 +83,28 @@ convert_u32_double_scaled (BablConversion *c,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
#define MAKE_CONVERSIONS(name, min_val, max_val, min, max) \
- static long \
+ static void \
convert_ ## name ## _double (BablConversion *c, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_u32_double_scaled (c, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_u32_double_scaled (c, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
} \
- static long \
+ static void \
convert_double_ ## name (BablConversion *c, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_double_u32_scaled (c, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_double_u32_scaled (c, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
}
MAKE_CONVERSIONS (u32, 0.0, 1.0, 0, UINT32_MAX)
diff --git a/babl/base/type-u8.c b/babl/base/type-u8.c
index 86d889e..8eeaf65 100644
--- a/babl/base/type-u8.c
+++ b/babl/base/type-u8.c
@@ -25,7 +25,7 @@
#include "babl-base.h"
#include <math.h>
-static inline long
+static inline void
convert_double_u8_scaled (BablConversion *c,
double min_val,
double max_val,
@@ -53,10 +53,9 @@ convert_double_u8_scaled (BablConversion *c,
src += src_pitch;
dst += dst_pitch;
}
- return n;
}
-static inline long
+static inline void
convert_u8_double_scaled (BablConversion *c,
double min_val,
double max_val,
@@ -85,29 +84,28 @@ convert_u8_double_scaled (BablConversion *c,
dst += dst_pitch;
src += src_pitch;
}
- return n;
}
#define MAKE_CONVERSIONS(name, min_val, max_val, min, max) \
- static long \
+ static void \
convert_ ## name ## _double (BablConversion *c, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_u8_double_scaled (c, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_u8_double_scaled (c, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
} \
- static long \
+ static void \
convert_double_ ## name (BablConversion *c, void *src, \
void *dst, \
int src_pitch, \
int dst_pitch, \
long n) \
{ \
- return convert_double_u8_scaled (c, min_val, max_val, min, max, \
- src, dst, src_pitch, dst_pitch, n); \
+ convert_double_u8_scaled (c, min_val, max_val, min, max, \
+ src, dst, src_pitch, dst_pitch, n); \
}
MAKE_CONVERSIONS (u8, 0.0, 1.0, 0x00, UINT8_MAX)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]