From 6a2fbbaed7345a144c84e4b07c3ced040fde7efd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 5 Mar 2020 13:40:07 +0000 Subject: [PATCH] Revert "add more "const" decls" This reverts commit 3dc2757330230a521a4693eb5d7bbea6ef292e2a. --- libvips/arithmetic/boolean.c | 17 +++++------ libvips/arithmetic/linear.c | 5 ++-- libvips/arithmetic/math2.c | 8 ++--- libvips/arithmetic/relational.c | 17 +++++------ libvips/arithmetic/remainder.c | 5 ++-- libvips/include/vips/arithmetic.h | 49 ++++++++++++------------------- 6 files changed, 41 insertions(+), 60 deletions(-) diff --git a/libvips/arithmetic/boolean.c b/libvips/arithmetic/boolean.c index ad978fe1..c4fcf18d 100644 --- a/libvips/arithmetic/boolean.c +++ b/libvips/arithmetic/boolean.c @@ -562,7 +562,7 @@ vips_boolean_const_init( VipsBooleanConst *boolean_const ) static int vips_boolean_constv( VipsImage *in, VipsImage **out, - VipsOperationBoolean operation, const double *c, int n, va_list ap ) + VipsOperationBoolean operation, double *c, int n, va_list ap ) { VipsArea *area_c; double *array; @@ -609,7 +609,7 @@ vips_boolean_constv( VipsImage *in, VipsImage **out, */ int vips_boolean_const( VipsImage *in, VipsImage **out, - VipsOperationBoolean boolean, const double *c, int n, ... ) + VipsOperationBoolean boolean, double *c, int n, ... ) { va_list ap; int result; @@ -637,8 +637,7 @@ vips_boolean_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_andimage_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +vips_andimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -667,8 +666,7 @@ vips_andimage_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_orimage_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +vips_orimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -697,8 +695,7 @@ vips_orimage_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_eorimage_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +vips_eorimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -727,7 +724,7 @@ vips_eorimage_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_lshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_lshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -756,7 +753,7 @@ vips_lshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) * Returns: 0 on success, -1 on error */ int -vips_rshift_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_rshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; diff --git a/libvips/arithmetic/linear.c b/libvips/arithmetic/linear.c index ebf4fb33..4a376a55 100644 --- a/libvips/arithmetic/linear.c +++ b/libvips/arithmetic/linear.c @@ -453,7 +453,7 @@ vips_linear_init( VipsLinear *linear ) static int vips_linearv( VipsImage *in, VipsImage **out, - const double *a, const double *b, int n, va_list ap ) + double *a, double *b, int n, va_list ap ) { VipsArea *area_a; VipsArea *area_b; @@ -500,8 +500,7 @@ vips_linearv( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_linear( VipsImage *in, VipsImage **out, - const double *a, const double *b, int n, ... ) +vips_linear( VipsImage *in, VipsImage **out, double *a, double *b, int n, ... ) { va_list ap; int result; diff --git a/libvips/arithmetic/math2.c b/libvips/arithmetic/math2.c index dd3e5323..cbcd2b99 100644 --- a/libvips/arithmetic/math2.c +++ b/libvips/arithmetic/math2.c @@ -420,7 +420,7 @@ vips_math2_const_init( VipsMath2Const *math2_const ) static int vips_math2_constv( VipsImage *in, VipsImage **out, - VipsOperationMath2 math2, const double *c, int n, va_list ap ) + VipsOperationMath2 math2, double *c, int n, va_list ap ) { VipsArea *area_c; double *array; @@ -470,7 +470,7 @@ vips_math2_constv( VipsImage *in, VipsImage **out, */ int vips_math2_const( VipsImage *in, VipsImage **out, - VipsOperationMath2 math2, const double *c, int n, ... ) + VipsOperationMath2 math2, double *c, int n, ... ) { va_list ap; int result; @@ -496,7 +496,7 @@ vips_math2_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_pow_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_pow_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -523,7 +523,7 @@ vips_pow_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) * Returns: 0 on success, -1 on error */ int -vips_wop_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_wop_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; diff --git a/libvips/arithmetic/relational.c b/libvips/arithmetic/relational.c index d740ea5c..f2f8f817 100644 --- a/libvips/arithmetic/relational.c +++ b/libvips/arithmetic/relational.c @@ -598,7 +598,7 @@ vips_relational_const_init( VipsRelationalConst *relational_const ) static int vips_relational_constv( VipsImage *in, VipsImage **out, - VipsOperationRelational relational, const double *c, int n, va_list ap ) + VipsOperationRelational relational, double *c, int n, va_list ap ) { VipsArea *area_c; double *array; @@ -645,7 +645,7 @@ vips_relational_constv( VipsImage *in, VipsImage **out, */ int vips_relational_const( VipsImage *in, VipsImage **out, - VipsOperationRelational relational, const double *c, int n, ... ) + VipsOperationRelational relational, double *c, int n, ... ) { va_list ap; int result; @@ -671,7 +671,7 @@ vips_relational_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_equal_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_equal_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -698,8 +698,7 @@ vips_equal_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) * Returns: 0 on success, -1 on error */ int -vips_notequal_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +vips_notequal_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -726,7 +725,7 @@ vips_notequal_const( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_less_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_less_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -753,7 +752,7 @@ vips_less_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) * Returns: 0 on success, -1 on error */ int -vips_lesseq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_lesseq_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -780,7 +779,7 @@ vips_lesseq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) * Returns: 0 on success, -1 on error */ int -vips_more_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_more_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; @@ -807,7 +806,7 @@ vips_more_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) * Returns: 0 on success, -1 on error */ int -vips_moreeq_const( VipsImage *in, VipsImage **out, const double *c, int n, ... ) +vips_moreeq_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; diff --git a/libvips/arithmetic/remainder.c b/libvips/arithmetic/remainder.c index 3c994345..75df8f4d 100644 --- a/libvips/arithmetic/remainder.c +++ b/libvips/arithmetic/remainder.c @@ -333,7 +333,7 @@ vips_remainder_const_init( VipsRemainderConst *remainder_const ) static int vips_remainder_constv( VipsImage *in, VipsImage **out, - const double *c, int n, va_list ap ) + double *c, int n, va_list ap ) { VipsArea *area_c; double *array; @@ -379,8 +379,7 @@ vips_remainder_constv( VipsImage *in, VipsImage **out, * Returns: 0 on success, -1 on error */ int -vips_remainder_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +vips_remainder_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) { va_list ap; int result; diff --git a/libvips/include/vips/arithmetic.h b/libvips/include/vips/arithmetic.h index 3c9c7aa9..ce95399a 100644 --- a/libvips/include/vips/arithmetic.h +++ b/libvips/include/vips/arithmetic.h @@ -185,14 +185,14 @@ int vips_multiply( VipsImage *left, VipsImage *right, VipsImage **out, ... ) int vips_divide( VipsImage *left, VipsImage *right, VipsImage **out, ... ) __attribute__((sentinel)); int vips_linear( VipsImage *in, VipsImage **out, - const double *a, const double *b, int n, ... ) + double *a, double *b, int n, ... ) __attribute__((sentinel)); int vips_linear1( VipsImage *in, VipsImage **out, double a, double b, ... ) __attribute__((sentinel)); int vips_remainder( VipsImage *left, VipsImage *right, VipsImage **out, ... ) __attribute__((sentinel)); int vips_remainder_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) + double *c, int n, ... ) __attribute__((sentinel)); int vips_remainder_const1( VipsImage *in, VipsImage **out, double c, ... ) @@ -279,25 +279,19 @@ int vips_more( VipsImage *left, VipsImage *right, VipsImage **out, ... ) int vips_moreeq( VipsImage *left, VipsImage *right, VipsImage **out, ... ) __attribute__((sentinel)); int vips_relational_const( VipsImage *in, VipsImage **out, - VipsOperationRelational relational, const double *c, int n, ... ) + VipsOperationRelational relational, double *c, int n, ... ) __attribute__((sentinel)); -int vips_equal_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_equal_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_notequal_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_notequal_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_less_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_less_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_lesseq_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_lesseq_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_more_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_more_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_moreeq_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_moreeq_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); int vips_relational_const1( VipsImage *in, VipsImage **out, VipsOperationRelational relational, double c, ... ) @@ -330,22 +324,17 @@ int vips_rshift( VipsImage *left, VipsImage *right, VipsImage **out, ... ) __attribute__((sentinel)); int vips_boolean_const( VipsImage *in, VipsImage **out, - VipsOperationBoolean boolean, const double *c, int n, ... ) + VipsOperationBoolean boolean, double *c, int n, ... ) __attribute__((sentinel)); -int vips_andimage_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_andimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_orimage_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_orimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_eorimage_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_eorimage_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_lshift_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_lshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_rshift_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_rshift_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); int vips_boolean_const1( VipsImage *in, VipsImage **out, VipsOperationBoolean boolean, double c, ... ) @@ -369,13 +358,11 @@ int vips_pow( VipsImage *left, VipsImage *right, VipsImage **out, ... ) int vips_wop( VipsImage *left, VipsImage *right, VipsImage **out, ... ) __attribute__((sentinel)); int vips_math2_const( VipsImage *in, VipsImage **out, - VipsOperationMath2 math2, const double *c, int n, ... ) + VipsOperationMath2 math2, double *c, int n, ... ) __attribute__((sentinel)); -int vips_pow_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_pow_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); -int vips_wop_const( VipsImage *in, VipsImage **out, - const double *c, int n, ... ) +int vips_wop_const( VipsImage *in, VipsImage **out, double *c, int n, ... ) __attribute__((sentinel)); int vips_math2_const1( VipsImage *in, VipsImage **out, VipsOperationMath2 math2, double c, ... )