Skip to content

Commit fcc05e7

Browse files
committed
fix some compile warnings
1 parent 810732b commit fcc05e7

File tree

8 files changed

+15
-15
lines changed

8 files changed

+15
-15
lines changed

src/class.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,21 +1007,18 @@ class_newv( Heap *heap, const char *name, PElement *out, ... )
10071007
static void
10081008
class_typecheck_error( PElement *instance, const char *name, const char *type )
10091009
{
1010-
PElement val;
1011-
gboolean res;
10121010
char txt[1024];
10131011
VipsBuf buf = VIPS_BUF_STATIC( txt );
1014-
1015-
res = class_get_member( instance, name, NULL, &val );
1016-
g_assert( res );
1012+
PElement val;
10171013

10181014
vips_buf_appendf( &buf, _( "Member \"%s\" of class \"%s\" "
10191015
"should be of type \"%s\", instead it's:" ),
10201016
name,
10211017
IOBJECT( PEGETCLASSCOMPILE( instance )->sym )->name,
10221018
type );
10231019
vips_buf_appends( &buf, "\n " );
1024-
if( !itext_value( reduce_context, &buf, &val ) )
1020+
if( class_get_member( instance, name, NULL, &val ) &&
1021+
!itext_value( reduce_context, &buf, &val ) )
10251022
return;
10261023

10271024
error_top( _( "Bad argument." ) );

src/classmodel.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1139,6 +1139,7 @@ classmodel_get_item( Classmodel *classmodel,
11391139

11401140
case CLASSMODEL_MEMBER_REALVEC_FIXED:
11411141
g_assert( m->extent < 4 );
1142+
11421143
if( (l = heap_get_realvec( value, vec, m->extent )) < 0 )
11431144
return( FALSE );
11441145
if( l != m->extent ) {
@@ -1168,21 +1169,17 @@ classmodel_get_item( Classmodel *classmodel,
11681169
}
11691170

11701171
case CLASSMODEL_MEMBER_OPTIONS:
1171-
{
1172-
ClassmodelClass *class = CLASSMODEL_GET_CLASS( classmodel );
1173-
11741172
/* If there are optional fields, we have to have a reset
11751173
* method for clearing the ones we don't use.
11761174
*/
1177-
g_assert( class->reset );
1175+
g_assert( CLASSMODEL_GET_CLASS( classmodel )->reset );
11781176

11791177
if( heap_map_dict( value,
11801178
(heap_map_dict_fn) classmodel_parse_option,
11811179
classmodel, m ) )
11821180
return( FALSE );
11831181

11841182
break;
1185-
}
11861183

11871184
case CLASSMODEL_MEMBER_IMAGE:
11881185
{

src/compile.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,6 +1186,7 @@ compile_share_scan_element( CompileShare *share, PElement *e )
11861186

11871187
case ELEMENT_NOVAL:
11881188
default:
1189+
hash = 0;
11891190
g_assert( 0 );
11901191
}
11911192

src/heap.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ heap_map( HeapNode *hn, heap_map_fn fn, void *a, void *b )
122122
}
123123
}
124124

125+
#ifdef DEBUG_HEAP_GC
125126
/* Debugging ... check that all nodes on the free list are TAG_FREE, and that
126127
* all other nodes are not TAG_FREE.
127128
*/
@@ -164,6 +165,7 @@ heap_check_free( Heap *heap )
164165
}
165166
}
166167
}
168+
#endif /*DEBUG_HEAP_GC*/
167169

168170
#ifdef DEBUG_HEAP_GC
169171
static void
@@ -180,9 +182,9 @@ heap_check_managed( void *key, void *value, Heap *heap )
180182
int
181183
heap_sanity( Heap *heap )
182184
{
185+
#ifdef DEBUG_HEAP_GC
183186
heap_check_free( heap );
184187

185-
#ifdef DEBUG_HEAP_GC
186188
heap_gc( heap );
187189
heap_check_free( heap );
188190
g_hash_table_foreach( heap->mtable, (GHFunc) heap_check_managed, heap );

src/imagepresent.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,6 @@ imagepresent_ruler_hide_cb( GtkWidget *wid, GtkWidget *host, Imagepresent *ip )
14831483
static void
14841484
imagepresent_init( Imagepresent *ip )
14851485
{
1486-
GtkWidget *port;
14871486
GtkWidget *bar;
14881487
GtkWidget *table;
14891488

@@ -1539,8 +1538,6 @@ imagepresent_init( Imagepresent *ip )
15391538
gtk_signal_connect( GTK_OBJECT( ip->swin ), "scroll_event",
15401539
GTK_SIGNAL_FUNC( imagepresent_scroll_event_cb ), ip );
15411540

1542-
port = gtk_bin_get_child( GTK_BIN( ip->swin ) );
1543-
g_assert( GTK_IS_VIEWPORT( port ) );
15441541
gtk_signal_connect( GTK_OBJECT( ip->hadj ), "changed",
15451542
GTK_SIGNAL_FUNC( imagepresent_hadj_changed_cb ), ip );
15461543
gtk_signal_connect( GTK_OBJECT( ip->hadj ), "value_changed",

src/link.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,15 @@ symbol_ndirty( Symbol *sym )
420420
void *
421421
symbol_fix_counts( Symbol *sym )
422422
{
423+
#ifdef DEBUG
423424
int old_count = sym->ndirtychildren;
425+
#endif /*DEBUG*/
424426

425427
sym->ndirtychildren = symbol_ndirty( sym );
426428

429+
#ifdef DEBUG
427430
g_assert( sym->ndirtychildren == old_count );
431+
#endif /*DEBUG*/
428432

429433
symbol_state_change( sym );
430434

src/plot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ plot_unpack( Plot *plot, DOUBLEMASK *mask )
164164
break;
165165

166166
default:
167+
columns = 1;
167168
g_assert( 0 );
168169
}
169170

src/tree.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ tree_copy( Compile *compile, ParseNode *node )
491491

492492
case NODE_NONE:
493493
default:
494+
copy = NULL;
494495
g_assert( FALSE );
495496
}
496497

0 commit comments

Comments
 (0)