diff --git a/libvips/conversion/cast.c b/libvips/conversion/cast.c index 21078ae3..26fa7be4 100644 --- a/libvips/conversion/cast.c +++ b/libvips/conversion/cast.c @@ -194,9 +194,8 @@ G_DEFINE_TYPE( VipsCast, vips_cast, VIPS_TYPE_CONVERSION ); ITYPE * restrict p = (ITYPE *) in; \ OTYPE * restrict q = (OTYPE *) out; \ \ - for( x = 0; x < sz; x++ ) { \ + for( x = 0; x < sz; x++ ) \ q[x] = CAST( p[x] ); \ - } \ } /* Cast complex types to an int type. Just take the real part. @@ -206,10 +205,8 @@ G_DEFINE_TYPE( VipsCast, vips_cast, VIPS_TYPE_CONVERSION ); OTYPE * restrict q = (OTYPE *) out; \ \ for( x = 0; x < sz; x++ ) { \ - TEMP v = VIPS_FLOOR( p[0] ); \ - \ + q[x] = CAST( p[0] ); \ p += 2; \ - q[x] = CAST( v ); \ } \ }