use g_assert_not_reached()

we were using g_assert(0) ... g_assert_not_reached() makes the
intention clearer
This commit is contained in:
John Cupitt 2016-01-24 13:21:53 +00:00
parent 31e4168718
commit 07a1903390
81 changed files with 191 additions and 199 deletions

View File

@ -9,6 +9,7 @@
- remove SEQ hint from vips_subsample(), fixes cli performance [erdmann]
- fix double free on attach ICC profile from file in tiff write [erdmann]
- add VIPS_FLOOR()/VIPS_CEIL(), much faster [Lovell Fuller]
- use g_assert_not_reached();
1/1/16 started 8.2.1
- add a compat stub [Benjamin Gilbert]

View File

@ -193,7 +193,7 @@ vips_abs_buffer( VipsArithmetic *arithmetic,
case VIPS_FORMAT_DPCOMPLEX: ABS_COMPLEX( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
}

View File

@ -137,7 +137,7 @@ add_buffer( VipsArithmetic *arithmetic, VipsPel *out, VipsPel **in, int width )
LOOP( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -184,7 +184,7 @@ vips_avg_scan( VipsStatistic *statistic, void *seq,
case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
*sum = m;

View File

@ -137,7 +137,7 @@ vips_boolean_build( VipsObject *object )
case VIPS_FORMAT_DOUBLE: F( double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
static void
@ -172,7 +172,7 @@ vips_boolean_buffer( VipsArithmetic *arithmetic,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -494,7 +494,7 @@ vips_boolean_const_buffer( VipsArithmetic *arithmetic,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -128,7 +128,7 @@ G_DEFINE_TYPE( VipsComplex, vips_complex, VIPS_TYPE_UNARY );
CLOOP( double, double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
static double
@ -211,7 +211,7 @@ vips_complex_buffer( VipsArithmetic *arithmetic,
case VIPS_OPERATION_COMPLEX_CONJ: SWITCH( CONJ ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -428,7 +428,7 @@ G_DEFINE_TYPE( VipsComplex2, vips_complex2, VIPS_TYPE_BINARY );
CLOOP2( double, double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
/* There doesn't seem to be much difference in speed between these two methods
@ -504,7 +504,7 @@ vips_complex2_buffer( VipsArithmetic *arithmetic,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -692,7 +692,7 @@ vips_complexget_build( VipsObject *object )
CGETLOOP( double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
#define REAL( Q, X, Y ) { \
@ -718,7 +718,7 @@ vips_complexget_buffer( VipsArithmetic *arithmetic,
case VIPS_OPERATION_COMPLEXGET_IMAG: GETSWITCH( IMAG ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -926,7 +926,7 @@ vips_complexform_buffer( VipsArithmetic *arithmetic,
CFORM( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -190,7 +190,7 @@ vips_deviate_scan( VipsStatistic *statistic, void *seq,
case VIPS_FORMAT_DOUBLE: LOOP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
ss2[0] = sum;

View File

@ -190,7 +190,7 @@ vips_divide_buffer( VipsArithmetic *arithmetic,
case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -266,7 +266,7 @@ vips_hist_find_indexed_uchar_scan( VipsHistFindIndexed *indexed,
ACCUMULATE_UCHAR( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
/* Max is always 255.
@ -327,7 +327,7 @@ vips_hist_find_indexed_ushort_scan( VipsHistFindIndexed *indexed,
ACCUMULATE_USHORT( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
/* Note the maximum.

View File

@ -256,7 +256,7 @@ vips_hist_find_ndim_scan( VipsStatistic *statistic, void *seq,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -131,7 +131,7 @@ vips_invert_buffer( VipsArithmetic *arithmetic,
LOOPC( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -321,7 +321,7 @@ vips_linear_buffer( VipsArithmetic *arithmetic,
LOOPCMPLXNuc( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
else
switch( vips_image_get_format( im ) ) {
@ -347,7 +347,7 @@ vips_linear_buffer( VipsArithmetic *arithmetic,
LOOPCMPLXN( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -126,7 +126,7 @@ vips_math_build( VipsObject *object )
LOOP( double, double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
/* sin/cos/tan in degrees.
@ -170,7 +170,7 @@ vips_math_buffer( VipsArithmetic *arithmetic,
case VIPS_OPERATION_MATH_EXP10: SWITCH( EXP10 ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -130,7 +130,7 @@ vips_math2_build( VipsObject *object )
L( double, double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
#define POW( Y, X, E ) { \
@ -159,7 +159,7 @@ vips_math2_buffer( VipsArithmetic *arithmetic,
case VIPS_OPERATION_MATH2_WOP: SWITCH( LOOP, WOP ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -377,7 +377,7 @@ vips_math2_const_buffer( VipsArithmetic *arithmetic,
case VIPS_OPERATION_MATH2_WOP: SWITCH( LOOPC, WOP ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -398,7 +398,7 @@ vips_max_scan( VipsStatistic *statistic, void *seq,
LOOPC( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -401,7 +401,7 @@ vips_min_scan( VipsStatistic *statistic, void *seq,
LOOPC( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -138,7 +138,7 @@ vips_multiply_buffer( VipsArithmetic *arithmetic,
case VIPS_FORMAT_DPCOMPLEX: CLOOP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -246,7 +246,7 @@ vips_profile_scan( VipsStatistic *statistic, void *seq,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -246,7 +246,7 @@ vips_project_scan( VipsStatistic *statistic, void *seq,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );
@ -297,7 +297,7 @@ vips_project_stop( VipsStatistic *statistic, void *seq )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
/* Blank out sub-project to make sure we can't add it again.

View File

@ -125,7 +125,7 @@ G_DEFINE_TYPE( VipsRelational, vips_relational, VIPS_TYPE_BINARY );
case VIPS_FORMAT_DPCOMPLEX: C( double, COP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
#define CEQUAL( x1, y1, x2, y2 ) (x1 == x2 && y1 == y2)
@ -180,7 +180,7 @@ vips_relational_buffer( VipsArithmetic *arithmetic,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -534,7 +534,7 @@ vips_relational_const_buffer( VipsArithmetic *arithmetic,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -135,7 +135,7 @@ vips_remainder_buffer( VipsArithmetic *arithmetic,
case VIPS_FORMAT_DOUBLE:FREMAINDER( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -305,7 +305,7 @@ vips_remainder_const_buffer( VipsArithmetic *arithmetic,
case VIPS_FORMAT_DOUBLE:FREMAINDERCONST( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -101,7 +101,7 @@ vips_round_build( VipsObject *object )
case VIPS_FORMAT_DOUBLE:LOOP( double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
} \
}
@ -125,7 +125,7 @@ vips_round_buffer( VipsArithmetic *arithmetic,
case VIPS_OPERATION_ROUND_FLOOR: SWITCH( VIPS_FLOOR ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -120,7 +120,7 @@ vips_sign_buffer( VipsArithmetic *arithmetic,
case VIPS_FORMAT_DPCOMPLEX: CSIGN( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -392,7 +392,7 @@ vips_stats_scan( VipsStatistic *statistic, void *seq,
case VIPS_FORMAT_DOUBLE: LOOP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -127,7 +127,7 @@ vips_subtract_buffer( VipsArithmetic *arithmetic,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -108,7 +108,7 @@ sum_buffer( VipsArithmetic *arithmetic, VipsPel *out, VipsPel **in, int width )
LOOP( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -137,7 +137,7 @@ make_pixel( VipsObject *obj,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( q );

View File

@ -241,7 +241,7 @@ vips_arrayjoin_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
break;
}
@ -259,7 +259,7 @@ vips_arrayjoin_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
break;
}

View File

@ -110,7 +110,7 @@ vips_bandbool_build( VipsObject *object )
case VIPS_FORMAT_DOUBLE: F( double, OP ); break;\
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
#define LOOPB( TYPE, OP ) { \
@ -169,7 +169,7 @@ vips_bandbool_buffer( VipsBandary *bandary,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -153,7 +153,7 @@ vips_bandmean_buffer( VipsBandary *bandary,
FLOOP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -141,7 +141,7 @@ G_DEFINE_TYPE( VipsBandrank, vips_bandrank, VIPS_TYPE_BANDARY );
case VIPS_FORMAT_DOUBLE: OPERATION( double ); break; \
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
/* Sort input band elements in the stack. Needs to be big enough for

View File

@ -362,7 +362,7 @@ vips_cast_start( VipsImage *out, void *a, void *b )
break; \
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
} \
}
@ -462,7 +462,7 @@ vips_cast_gen( VipsRegion *or, void *vseq, void *a, void *b,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -330,7 +330,7 @@ vips_embed_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );
@ -535,7 +535,7 @@ vips_embed_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -212,7 +212,7 @@ vips_flatten_black_gen( VipsRegion *or, void *vseq, void *a, void *b,
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -277,7 +277,7 @@ vips_flatten_gen( VipsRegion *or, void *vseq, void *a, void *b,
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -197,7 +197,7 @@ vips_blend1_buffer( VipsPel *qp,
case VIPS_FORMAT_DPCOMPLEX: CBLEND1( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -225,7 +225,7 @@ vips_blendn_buffer( VipsPel *qp,
case VIPS_FORMAT_DPCOMPLEX: CBLENDN( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -117,11 +117,11 @@ vips_join_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
/* Keep -Wall happy.
/* Stop compiler warnings.
*/
return( 0 );
y = 0;
}
break;
@ -143,21 +143,17 @@ vips_join_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
/* Keep -Wall happy.
/* Stop compiler warnings.
*/
return( 0 );
x = 0;
}
break;
default:
g_assert( 0 );
/* Keep -Wall happy.
*/
return( 0 );
g_assert_not_reached();
}
if( vips_insert( join->in1, join->in2, &t, x, y,
@ -186,11 +182,14 @@ vips_join_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
/* Keep -Wall happy.
/* Stop compiler warnings.
*/
return( 0 );
left = 0;
top = 0;
width = 0;
height = 0;
}
if( left != 0 ||

View File

@ -172,7 +172,7 @@ vips_premultiply_gen( VipsRegion *or, void *vseq, void *a, void *b,
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -128,7 +128,7 @@ vips_recomb_gen( VipsRegion *or,
case VIPS_FORMAT_DOUBLE:LOOP( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -325,11 +325,11 @@ vips_rot_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
/* Keep -Wall happy.
/* Stop compiler warnings.
*/
return( 0 );
generate_fn = NULL;
}
if( vips_image_generate( conversion->out,

View File

@ -239,11 +239,7 @@ vips_rot45_build( VipsObject *object )
break;
default:
g_assert( 0 );
/* Keep -Wall happy.
*/
return( 0 );
g_assert_not_reached();
}
if( vips_image_write( in, conversion->out ) )

View File

@ -286,7 +286,7 @@ vips_tile_search_recycle( gpointer key, gpointer value, gpointer user_data )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
}

View File

@ -183,7 +183,7 @@ vips_unpremultiply_gen( VipsRegion *or, void *vseq, void *a, void *b,
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -120,10 +120,11 @@ vips_compass_build( VipsObject *object )
break;
default:
/* Silence compiler warning.
g_assert_not_reached();
/* Stop compiler warnings.
*/
x = NULL;
g_assert( 0 );
}
if( vips_image_write( x, convolution->out ) )

View File

@ -116,7 +116,7 @@ vips_conv_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -180,7 +180,7 @@ vips_fastcor_correlation( VipsCorrelation *correlation,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -961,7 +961,7 @@ aconv_hgenerate( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -1183,7 +1183,7 @@ aconv_vgenerate( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -590,7 +590,7 @@ aconvsep_generate_horizontal( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -768,7 +768,7 @@ aconvsep_generate_vertical( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -772,7 +772,7 @@ conv_gen( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -929,7 +929,7 @@ conv3x3_gen( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -303,7 +303,7 @@ conv_gen( REGION *or, void *vseq, void *a, void *b )
CONV_FLOAT( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -263,8 +263,12 @@ vips_spcor_correlation( VipsCorrelation *correlation,
break;
default:
g_assert( 0 );
return;
g_assert_not_reached();
/* Stop compiler warnings.
*/
sum2 = 0;
sum3 = 0;
}
c2 = spcor->c1[b] * sqrt( sum2 );

View File

@ -146,7 +146,7 @@ vips_draw_image_mode_add( VipsDrawImage *draw_image, VipsImage *im,
LOOPF( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -231,9 +231,7 @@ vips_draw_image_build( VipsObject *object )
break;
default:
g_assert( 0 );
break;
g_assert_not_reached();
}
p += VIPS_IMAGE_SIZEOF_LINE( im );

View File

@ -208,7 +208,7 @@ vips__draw_line_direct( VipsImage *image, int x1, int y1, int x2, int y2,
}
}
else
g_assert( 0 );
g_assert_not_reached();
}
static void

View File

@ -220,7 +220,7 @@ vips_draw_mask_draw( VipsImage *image, VipsImage *mask, VipsPel *ink,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -283,7 +283,7 @@ vips__draw_mask_direct( VipsImage *image, VipsImage *mask,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -174,7 +174,7 @@ vips_draw_smudge_build( VipsObject *object )
case VIPS_FORMAT_DPCOMPLEX: SMUDGE( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -289,7 +289,7 @@ print_dsr( struct dsr *d )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
}
@ -344,7 +344,7 @@ read_header( const char *header )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
}
@ -478,7 +478,7 @@ attach_meta( VipsImage *out, struct dsr *d )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
}

View File

@ -417,7 +417,7 @@ vips2csv( VipsImage *in, FILE *fp, const char *sep )
PRINT_COMPLEX( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
p += es;

View File

@ -723,9 +723,11 @@ pyramid_build( VipsForeignSaveDz *dz, Layer *above,
break;
default:
g_assert( 0 );
limit = dz->tile_size;
break;
g_assert_not_reached();
/* Stop compiler warnings.
*/
limit = 1;
}
if( width > limit ||
@ -1080,8 +1082,11 @@ tile_name( Layer *layer, int x, int y )
break;
default:
g_assert( 0 );
return( NULL );
g_assert_not_reached();
/* Stop compiler warnings.
*/
out = NULL;
}
#ifdef DEBUG_VERBOSE
@ -1804,8 +1809,7 @@ vips_foreign_save_dz_build( VipsObject *object )
break;
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
}
if( vips_sink_disc( save->ready, pyramid_strip, dz ) )
@ -1828,8 +1832,7 @@ vips_foreign_save_dz_build( VipsObject *object )
break;
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
}
if( dz->properties &&

View File

@ -533,7 +533,7 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n )
GRAY_LOOP( double, QuantumRange ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
break;
@ -551,7 +551,7 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n )
GRAYA_LOOP( double, QuantumRange ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
break;
@ -569,7 +569,7 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n )
RGB_LOOP( double, QuantumRange ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
break;
@ -587,12 +587,12 @@ unpack_pixels( VipsImage *im, VipsPel *q8, PixelPacket *pixels, int n )
RGBA_LOOP( double, QuantumRange ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -249,11 +249,11 @@ read_header( FILE *fp, VipsImage *out, int *bits, int *ascii, int *msb_first )
break;
default:
g_assert( 0 );
g_assert_not_reached();
/* Keep -Wall happy.
/* Stop compiler warnings.
*/
return( 0 );
format = VIPS_FORMAT_UCHAR;
}
if( bands == 1 ) {
@ -341,7 +341,7 @@ read_ascii( FILE *fp, VipsImage *out )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -607,7 +607,7 @@ write_ppm_line_ascii( Write *write, VipsPel *p )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -731,7 +731,7 @@ write_ppm( Write *write, gboolean ascii, gboolean squash )
else if( in->Bands == 3 && !ascii )
magic = "P6";
else
g_assert( 0 );
g_assert_not_reached();
fprintf( write->fp, "%s\n", magic );
time( &timebuf );
@ -765,7 +765,7 @@ write_ppm( Write *write, gboolean ascii, gboolean squash )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
if( squash )

View File

@ -674,7 +674,7 @@ greyscale_line( ReadTiff *rtiff, VipsPel *q, VipsPel *p, int n, void *client )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -934,7 +934,7 @@ parse_palette( ReadTiff *rtiff, VipsImage *out )
else if( rtiff->bits_per_sample == 16 )
rtiff->sfn = palette_line16;
else
g_assert( 0 );
g_assert_not_reached();
return( 0 );
}
@ -1835,7 +1835,7 @@ my_tiff_read( thandle_t st, tdata_t buffer, tsize_t size )
static tsize_t
my_tiff_write( thandle_t st, tdata_t buffer, tsize_t size )
{
g_assert( 0 );
g_assert_not_reached();
return( 0 );
}
@ -1858,7 +1858,7 @@ my_tiff_seek( thandle_t st, toff_t pos, int whence )
else if( whence == SEEK_END )
rtiff->pos = rtiff->len + pos;
else
g_assert( 0 );
g_assert_not_reached();
return( rtiff->pos );
}
@ -1874,7 +1874,7 @@ my_tiff_size( thandle_t st )
static int
my_tiff_map( thandle_t st, tdata_t *start, toff_t *len )
{
g_assert( 0 );
g_assert_not_reached();
return 0;
}
@ -1882,7 +1882,7 @@ my_tiff_map( thandle_t st, tdata_t *start, toff_t *len )
static void
my_tiff_unmap( thandle_t st, tdata_t start, toff_t len )
{
g_assert( 0 );
g_assert_not_reached();
return;
}

View File

@ -829,7 +829,7 @@ get_compression( VipsForeignTiffCompression compression )
return( COMPRESSION_LZW );
default:
g_assert( 0 );
g_assert_not_reached();
}
/* Keep -Wall happy.
@ -847,7 +847,7 @@ get_resunit( VipsForeignTiffResunit resunit )
return( RESUNIT_INCH );
default:
g_assert( 0 );
g_assert_not_reached();
}
/* Keep -Wall happy.
@ -1103,7 +1103,7 @@ invert_band0( Write *write, VipsPel *q, VipsPel *p, int n )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -116,7 +116,7 @@ vips_hist_cum_process( VipsHistogram *histogram,
ACCUMULATE( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -158,7 +158,7 @@ make_vert_gen( REGION *or, void *seq, void *a, void *b )
case IM_BANDFMT_DOUBLE: VERT( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -208,7 +208,7 @@ make_horz_gen( REGION *or, void *seq, void *a, void *b )
case IM_BANDFMT_DOUBLE: HORZ( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -404,7 +404,7 @@ vips_maplut_start( VipsImage *out, void *a, void *b )
case VIPS_FORMAT_USHORT: GEN( unsigned short, OUT ); break; \
case VIPS_FORMAT_UINT: GEN( unsigned int, OUT ); break; \
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
/* Switch for LUT types. One function for non-complex images, a
@ -434,7 +434,7 @@ vips_maplut_start( VipsImage *out, void *a, void *b )
case VIPS_FORMAT_DPCOMPLEX: \
inner_switch( UCHAR_FC, GEN_FC, double ); break; \
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
/* Do a map.
@ -666,7 +666,7 @@ vips_maplut_build( VipsObject *object )
case VIPS_FORMAT_DPCOMPLEX:
PACK_TABLEC( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
if( vips_image_generate( maplut->out,

View File

@ -536,9 +536,7 @@ vips_image_guess_interpretation( const VipsImage *image )
break;
default:
g_assert( 0 );
sane = FALSE;
break;
g_assert_not_reached();
}
if( sane )

View File

@ -3384,8 +3384,8 @@ vips_band_format_isint( VipsBandFormat format )
return( FALSE );
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
return( FALSE );
}
}
@ -3402,7 +3402,7 @@ vips_band_format_isuint( VipsBandFormat format )
case VIPS_FORMAT_UCHAR:
case VIPS_FORMAT_USHORT:
case VIPS_FORMAT_UINT:
return( 1 );
return( TRUE );
case VIPS_FORMAT_INT:
case VIPS_FORMAT_SHORT:
@ -3411,11 +3411,11 @@ vips_band_format_isuint( VipsBandFormat format )
case VIPS_FORMAT_DOUBLE:
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
return( 0 );
return( FALSE );
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
return( FALSE );
}
}
@ -3444,8 +3444,8 @@ vips_band_format_is8bit( VipsBandFormat format )
return( FALSE );
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
return( FALSE );
}
}
@ -3461,7 +3461,7 @@ vips_band_format_isfloat( VipsBandFormat format )
switch( format ) {
case VIPS_FORMAT_FLOAT:
case VIPS_FORMAT_DOUBLE:
return( 1 );
return( TRUE );
case VIPS_FORMAT_UCHAR:
case VIPS_FORMAT_CHAR:
@ -3471,11 +3471,11 @@ vips_band_format_isfloat( VipsBandFormat format )
case VIPS_FORMAT_INT:
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
return( 0 );
return( FALSE );
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
return( FALSE );
}
}
@ -3491,7 +3491,7 @@ vips_band_format_iscomplex( VipsBandFormat format )
switch( format ) {
case VIPS_FORMAT_COMPLEX:
case VIPS_FORMAT_DPCOMPLEX:
return( 1 );
return( TRUE );
case VIPS_FORMAT_UCHAR:
case VIPS_FORMAT_CHAR:
@ -3501,10 +3501,10 @@ vips_band_format_iscomplex( VipsBandFormat format )
case VIPS_FORMAT_INT:
case VIPS_FORMAT_FLOAT:
case VIPS_FORMAT_DOUBLE:
return( 0 );
return( FALSE );
default:
g_assert( 0 );
return( -1 );
g_assert_not_reached();
return( FALSE );
}
}

View File

@ -90,7 +90,7 @@
* uses this information to decide when to trim caches.
*/
/* g_assert( 0 ) on memory errors.
/* g_assert_not_reached() on memory errors.
#define DEBUG
*/
@ -288,7 +288,7 @@ vips_tracked_malloc( size_t size )
if( !(buf = g_try_malloc( size )) ) {
#ifdef DEBUG
g_assert( 0 );
g_assert_not_reached();
#endif /*DEBUG*/
vips_error( "vips_tracked",

View File

@ -1774,7 +1774,7 @@ vips_object_no_value( VipsObject *object, const char *name )
if( vips_object_get_argument( object, name,
&pspec, &argument_class, &argument_instance ) )
g_assert( 0 );
g_assert_not_reached();
if( strcmp( name, g_param_spec_get_name( pspec ) ) == 0 )
vips_error( class->nickname,

View File

@ -967,8 +967,7 @@ vips_region_paint( VipsRegion *reg, VipsRect *r, int value )
break;
default:
g_assert( 0 );
break;
g_assert_not_reached();
}
q1 = q + ls;
@ -1221,7 +1220,7 @@ vips_region_shrink_uncoded( VipsRegion *from, VipsRegion *to, VipsRect *target )
SHRINK_TYPE_FLOAT( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
}

View File

@ -965,7 +965,7 @@ vips_get_tile_size( VipsImage *im,
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
/* We can't set n_lines for the current demand style: a later bit of

View File

@ -104,11 +104,7 @@ vips_countlines_build( VipsObject *object )
break;
default:
g_assert( 0 );
/* Keep -Wall happy.
*/
return( 0 );
g_assert_not_reached();
}
g_object_set( object, "nolines", nolines / 255.0, NULL );

View File

@ -495,7 +495,7 @@ dilate_gen( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -607,7 +607,7 @@ erode_gen( REGION *or, void *vseq, void *a, void *b )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -117,7 +117,7 @@ vips_morph_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -282,7 +282,7 @@ vips_rank_start( IMAGE *out, void *a, void *b )
case VIPS_FORMAT_DOUBLE: OPERATION( double ); break; \
\
default: \
g_assert( 0 ); \
g_assert_not_reached(); \
}
static int

View File

@ -86,7 +86,7 @@ vips_merge_build( VipsObject *object )
break;
default:
g_assert( 0 );
g_assert_not_reached();
}
return( 0 );

View File

@ -128,16 +128,7 @@ vips_mosaic_build( VipsObject *object )
break;
default:
/* Silence compiler warnings.
*/
dx0 = 0;
dy0 = 0;
scale1 = 0.0;
angle1 = 0.0;
dx1 = 0.0;
dy1 = 0.0;
g_assert( 0 );
g_assert_not_reached();
}
g_object_set( mosaic,

View File

@ -140,7 +140,14 @@ vips_mapim_region_minmax( VipsRegion *region, VipsRect *r, VipsRect *bounds )
MINMAX( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
/* Stop compiler warnings.
*/
min_x = 0;
max_x = 0;
min_y = 0;
max_y = 0;
}
}
@ -280,7 +287,7 @@ vips_mapim_gen( VipsRegion *or, void *seq, void *a, void *b, gboolean *stop )
LOOKUP( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -193,8 +193,7 @@ vips_quadratic_gen( VipsRegion *or, void *vseq,
break;
default:
g_assert( 0 );
return( -7 );
g_assert_not_reached();
}
printf( "dx = %g, dy = %g\n", dx, dy );

View File

@ -234,7 +234,7 @@ vips_shrink2_gen2( VipsShrink2 *shrink, VipsShrink2Sequence *seq,
FSHRINK( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
out += sizeof_pixel;

View File

@ -165,7 +165,7 @@ vips_shrinkh_gen2( VipsShrinkh *shrink, VipsRegion *or, VipsRegion *ir,
FSHRINK( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}

View File

@ -189,7 +189,7 @@ vips_shrinkv_add_line( VipsShrinkv *shrink, VipsShrinkvSequence *seq,
ADD( double, double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}
@ -251,7 +251,7 @@ vips_shrinkv_write_line( VipsShrinkv *shrink, VipsShrinkvSequence *seq,
FAVG( double ); break;
default:
g_assert( 0 );
g_assert_not_reached();
}
}