Skip to content

Commit dcb1f6d

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents e61939c + a68ca51 commit dcb1f6d

File tree

16 files changed

+72
-44
lines changed

16 files changed

+72
-44
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ nip2-7.*.tar.gz
88
.*.swp
99
TAGS
1010
Makefile
11+
scan
1112
Makefile.in
1213
config.*
1314
autom4te.cache

src/classmodel.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,8 @@ classmodel_buildedit_member( Classmodel *classmodel,
683683
{
684684
GtkWidget *widget;
685685

686+
widget = NULL;
687+
686688
switch( m->type ) {
687689
case CLASSMODEL_MEMBER_INT:
688690
case CLASSMODEL_MEMBER_ENUM:

src/colour.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ colour_set_colour( Colour *colour,
133133
for( i = 0; i < 3; i++ )
134134
if( !DEQ( value[i], colour->value[i] ) )
135135
break;
136-
if( i == 3 && strcmp( colour_space, colour->colour_space ) == 0 )
136+
if( i == 3 &&
137+
colour_space &&
138+
strcmp( colour_space, colour->colour_space ) == 0 )
137139
return;
138140

139141
for( i = 0; i < 3; i++ )
@@ -176,8 +178,11 @@ colour_ii_new( Colour *colour )
176178
static void
177179
colour_get_rgb( Colour *colour, double rgb[4] )
178180
{
181+
int i;
179182
Imageinfo *imageinfo;
180183

184+
for( i = 0; i < 4; i++ )
185+
rgb[i] = 0.0;
181186
if( (imageinfo = colour_ii_new( colour )) )
182187
imageinfo_to_rgb( imageinfo, rgb );
183188
}

src/expr.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ expr_tip_sub( Expr *expr, VipsBuf *buf )
617617
vips_buf_appends( buf, " " );
618618
}
619619

620-
if( compile && is_class( compile ) ) {
620+
if( compile &&
621+
is_class( compile ) ) {
621622
vips_buf_appends( buf, _( "class" ) );
622623
vips_buf_appends( buf, " " );
623624
if( compile->nparam == 0 ) {
@@ -634,7 +635,7 @@ expr_tip_sub( Expr *expr, VipsBuf *buf )
634635
else if( expr->sym->type == SYM_PARAM )
635636
vips_buf_appendf( buf, _( "parameter \"%s\"" ),
636637
IOBJECT( expr->sym )->name );
637-
else {
638+
else if( compile ) {
638639
if( is_member( expr->sym ) ) {
639640
vips_buf_appends( buf, _( "member" ) );
640641
vips_buf_appends( buf, " " );

src/heap.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ heap_map_list( PElement *base, heap_map_list_fn fn, void *a, void *b )
12521252
/* Apply user function to the head.
12531253
*/
12541254
PEGETHD( &head, &e );
1255-
if(( res = fn( &head, a, b )) )
1255+
if( (res = fn( &head, a, b )) )
12561256
return( res );
12571257

12581258
/* Reduce the tail.
@@ -2094,7 +2094,7 @@ lisp_list( VipsBuf *buf, PElement *base,
20942094
/* Print a [char] ... fall back to lisp_list() if we hit a non-char
20952095
* element. base is the RHS of a cons, so it can be a managedstring too.
20962096
*/
2097-
static void
2097+
static gboolean
20982098
lisp_string( VipsBuf *buf, PElement *base,
20992099
GSList **back, gboolean fn, int indent )
21002100
{
@@ -2113,7 +2113,8 @@ lisp_string( VipsBuf *buf, PElement *base,
21132113
vips_buf_appendf( buf, "%c", PEGETCHAR( &pe ) );
21142114

21152115
PEPOINTRIGHT( hn, &pe );
2116-
lisp_string( buf, &pe, back, fn, indent );
2116+
(void) lisp_string( buf,
2117+
&pe, back, fn, indent );
21172118
}
21182119
else {
21192120
vips_buf_appends( buf, "\":[" );
@@ -2133,6 +2134,8 @@ lisp_string( VipsBuf *buf, PElement *base,
21332134
vips_buf_appends( buf, PEGETMANAGEDSTRING( base )->string );
21342135
else if( !PEISELIST( base ) )
21352136
error = TRUE;
2137+
2138+
return( error );
21362139
}
21372140

21382141
/* Print a graph LISP-style.
@@ -2192,7 +2195,7 @@ lisp_node( VipsBuf *buf, HeapNode *hn, GSList **back, gboolean fn, int indent )
21922195
if( PEISCHAR( &p1 ) ) {
21932196
vips_buf_appendf( buf, "\"%c", PEGETCHAR( &p1 ) );
21942197
PEPOINTRIGHT( hn, &p2 );
2195-
lisp_string( buf, &p2, back, fn, indent );
2198+
(void) lisp_string( buf, &p2, back, fn, indent );
21962199
vips_buf_appends( buf, "\"" );
21972200
}
21982201
else {

src/idialog.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,8 @@ idialog_build( GtkWidget *widget )
527527
else {
528528
/* If there's just 1 OK, that gets Esc too.
529529
*/
530-
if( g_slist_length( idlg->ok_but_l ) == 1 )
530+
if( idlg->ok_but_l &&
531+
g_slist_length( idlg->ok_but_l ) == 1 )
531532
gtk_widget_add_accelerator(
532533
GTK_WIDGET( idlg->ok_but_l->data ), "clicked",
533534
iwnd->accel_group, GDK_Escape, 0, 0 );

src/imageinfo.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,10 @@ imageinfo_check_paintable( Imageinfo *imageinfo, GtkWidget *parent,
11571157
{
11581158
IMAGE *im = imageinfo_get( FALSE, imageinfo );
11591159

1160-
if( im_isfile( im ) &&
1161-
!imageinfo->dfile && !imageinfo->ok_to_paint ) {
1160+
if( im &&
1161+
im_isfile( im ) &&
1162+
!imageinfo->dfile &&
1163+
!imageinfo->ok_to_paint ) {
11621164
iDialog *idlg;
11631165

11641166
idlg = box_yesno( parent,
@@ -1178,7 +1180,9 @@ imageinfo_check_paintable( Imageinfo *imageinfo, GtkWidget *parent,
11781180

11791181
return( FALSE );
11801182
}
1181-
else if( !im_isfile( im ) && !imageinfo->ok_to_paint ) {
1183+
else if( im &&
1184+
!im_isfile( im ) &&
1185+
!imageinfo->ok_to_paint ) {
11821186
if( !imageinfo_make_paintable( imageinfo ) ) {
11831187
nfn( sys, IWINDOW_ERROR );
11841188
return( FALSE );

src/iregiongroupview.c

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -165,24 +165,23 @@ iregiongroupview_refresh( vObject *vobject )
165165
iregiongroupview->classmodel =
166166
iregiongroupview_get_classmodel( iregiongroupview );
167167

168-
iregiongroupview->classmodel =
169-
iregiongroupview_get_classmodel( iregiongroupview );
170-
171-
/* Make a note of all the displays we have now, loop over the
172-
* displays we should have, reusing when possible ... remove any
173-
* unused displays at the end.
174-
*/
175-
irs.classmodel = iregiongroupview->classmodel;
176-
irs.notused = g_slist_copy( irs.classmodel->views );
177-
irs.iregiongroupview = iregiongroupview;
168+
if( iregiongroupview->classmodel ) {
169+
/* Make a note of all the displays we have now, loop over the
170+
* displays we should have, reusing when possible ... remove
171+
* any unused displays at the end.
172+
*/
173+
irs.classmodel = iregiongroupview->classmodel;
174+
irs.notused = g_slist_copy( irs.classmodel->views );
175+
irs.iregiongroupview = iregiongroupview;
178176

179-
slist_map( irs.classmodel->iimages,
180-
(SListMapFn) iregiongroupview_refresh_iimage, &irs );
177+
slist_map( irs.classmodel->iimages,
178+
(SListMapFn) iregiongroupview_refresh_iimage, &irs );
181179

182-
/* Remove all the regionviews we've not used.
183-
*/
184-
slist_map( irs.notused, (SListMapFn) object_destroy, NULL );
185-
IM_FREEF( g_slist_free, irs.notused );
180+
/* Remove all the regionviews we've not used.
181+
*/
182+
slist_map( irs.notused, (SListMapFn) object_destroy, NULL );
183+
IM_FREEF( g_slist_free, irs.notused );
184+
}
186185

187186
VOBJECT_CLASS( parent_class )->refresh( vobject );
188187
}

src/itext.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,16 @@ itext_decompile_element( VipsBuf *buf, PElement *base, gboolean top )
238238
vips_buf_appends( buf, ")" );
239239
}
240240
else if( PEISMANAGED( base ) ) {
241-
Managed *managed = PEGETMANAGED( base );
242-
243-
vips_buf_appendf( buf, "<%s ", G_OBJECT_TYPE_NAME( managed ) );
244-
iobject_info( IOBJECT( managed ), buf );
245-
vips_buf_appends( buf, ">" );
241+
Managed *managed;
242+
243+
if( !(managed = PEGETMANAGED( base )) )
244+
vips_buf_appendf( buf, "<NULL managed>" );
245+
else {
246+
vips_buf_appendf( buf, "<%s ",
247+
G_OBJECT_TYPE_NAME( managed ) );
248+
iobject_info( IOBJECT( managed ), buf );
249+
vips_buf_appends( buf, ">" );
250+
}
246251
}
247252
else if( PEISCLASS( base ) ) {
248253
Compile *compile = PEGETCLASSCOMPILE( base );

src/mainw.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,7 @@ mainw_auto_recover_cb( iWindow *iwnd,
11691169
filename, filename )) ) {
11701170
progress_end();
11711171
nfn( sys, IWINDOW_ERROR );
1172+
return;
11721173
}
11731174

11741175
filemodel_set_filename( FILEMODEL( new_wsg ), NULL );

src/parse.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1662,7 +1662,8 @@ parse_set_symbol( void )
16621662
if( !(sym = compile_lookup( compile, ident )) )
16631663
nip2yyerror( _( "'%s' does not exist" ),
16641664
ident );
1665-
if( !sym->expr || !sym->expr->compile )
1665+
if( !sym->expr ||
1666+
!sym->expr->compile )
16661667
nip2yyerror( _( "'%s' has no members" ),
16671668
ident );
16681669
compile = sym->expr->compile;

src/path.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ path_rewrite_add( const char *old, const char *new, gboolean lock )
200200
printf( "path_rewrite_add: adding\n" );
201201
#endif /*DEBUG_REWRITE*/
202202

203-
rewrite = path_rewrite_new( old, new, lock );
203+
(void) path_rewrite_new( old, new, lock );
204204
}
205205

206206
/* Keep longest old first, in case one old is a prefix of

src/program.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ program_edit_dia( Program *program, Tool *tool )
619619
{
620620
GtkWidget *ss = stringset_new();
621621

622-
g_assert( tool->type == TOOL_DIA );
622+
g_assert( tool && tool->type == TOOL_DIA );
623623

624624
stringset_child_new( STRINGSET( ss ),
625625
_( "Name" ), IOBJECT( tool )->name, _( "Menu item text" ) );

src/regionview.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -594,19 +594,21 @@ regionview_destroy( GtkObject *object )
594594
g_return_if_fail( IS_REGIONVIEW( object ) );
595595

596596
regionview = REGIONVIEW( object );
597-
id = regionview->ip->id;
598597

599598
if( !regionview->first )
600599
regionview_queue_draw( regionview );
601600
regionview->first = FALSE;
602601

603602
regionview_detach( regionview );
604603

605-
FREESID( regionview->expose_sid, id );
606-
FREESID( regionview->destroy_sid, id );
607-
FREESID( regionview->event_sid, id );
608-
FREESID( regionview->changed_sid, id->conv );
609-
FREESID( regionview->conv_destroy_sid, id->conv );
604+
if( (id = regionview->ip->id) ) {
605+
FREESID( regionview->expose_sid, id );
606+
FREESID( regionview->destroy_sid, id );
607+
FREESID( regionview->event_sid, id );
608+
FREESID( regionview->changed_sid, id->conv );
609+
FREESID( regionview->conv_destroy_sid, id->conv );
610+
}
611+
610612
FREESID( regionview->model_changed_sid, regionview->classmodel );
611613
IM_FREEF( g_source_remove, regionview->dash_crawl );
612614
IM_FREEF( iwindow_cursor_context_destroy, regionview->cntxt );

src/row.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,9 @@ row_info( iObject *iobject, VipsBuf *buf )
516516
vips_buf_appends( buf, "\n" );
517517
}
518518
}
519-
if( row == row->top_row && row->sym->dirty ) {
519+
if( row == row->top_row &&
520+
row->sym &&
521+
row->sym->dirty ) {
520522
Symbol *sym = row->sym;
521523

522524
if( sym->ndirtychildren ) {
@@ -2017,7 +2019,8 @@ row_set_status( Row *row )
20172019

20182020
vips_buf_appends( &buf, " = " );
20192021

2020-
if( row->ws->mode != WORKSPACE_MODE_FORMULA )
2022+
if( row->ws &&
2023+
row->ws->mode != WORKSPACE_MODE_FORMULA )
20212024
vips_buf_appends( &buf, NN( itext->formula ) );
20222025
else
20232026
vips_buf_appends( &buf, vips_buf_all( &itext->value ) );

src/watch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ watch_int_update( Watch *watch )
594594
{
595595
WatchInt *watch_int = WATCH_INT( watch );
596596
Expr *expr = watch->row->expr;
597-
PElement *root = &watch->row->expr->root;
597+
PElement *root;
598598

599599
#ifdef DEBUG
600600
printf( "watch_int_update: %s\n", NN( IOBJECT( watch )->name ) );

0 commit comments

Comments
 (0)