From 70b60e1dd57e85150349d4eea78a47b9b91638f5 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 22 Jan 2015 13:19:21 +0000 Subject: [PATCH] tiny cleanup --- ChangeLog | 1 + libvips/draw/draw_flood.c | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 69582455..0bd1b986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ - disable chroma subsample in jpeg-tiff if Q >= 90 - try to handle tiffs with old-style 8-bit colormaps - rename vipsthumbnail -o as -f, -o stays as a hidden flag +- fix some small leaks 24/12/14 started 7.42.1 - add gobject-2.0 to Requires: in vips and vips-cpp .pc files diff --git a/libvips/draw/draw_flood.c b/libvips/draw/draw_flood.c index 135b1076..8f5f5029 100644 --- a/libvips/draw/draw_flood.c +++ b/libvips/draw/draw_flood.c @@ -100,9 +100,9 @@ typedef struct _Buffer { Scan scan[PBUFSIZE]; } Buffer; -/* What we track during a flood. We have this in a separet struct so that we +/* What we track during a flood. We have this in a separate struct so that we * can support vips__draw_flood_direct() ... a fast path for - * vips_labelregions() taht avoids all of the GObject call overhead. This + * vips_labelregions() that avoids all of the GObject call overhead. This * gives a huge speedup, >x10 in many cases. */ typedef struct _Flood { @@ -184,7 +184,7 @@ buffer_free( Buffer *buf ) /* Add a scanline to a buffer, prepending a new buffer if necessary. Return * the new head buffer. */ -static inline Buffer * +static Buffer * buffer_add( Buffer *buf, Flood *flood, int x1, int x2, int y, int dir ) { /* Clip against image size. @@ -218,7 +218,7 @@ buffer_add( Buffer *buf, Flood *flood, int x1, int x2, int y, int dir ) * whether we are flooding to the edge boundary or flooding edge-coloured * pixels. p is a pel in @test. */ -static inline gboolean +static gboolean flood_connected( Flood *flood, VipsPel *p ) { int j; @@ -234,7 +234,7 @@ flood_connected( Flood *flood, VipsPel *p ) /* Is p painted? p is a pel in @image. */ -static inline gboolean +static gboolean flood_painted( Flood *flood, VipsPel *p ) { int j; @@ -246,7 +246,7 @@ flood_painted( Flood *flood, VipsPel *p ) return( j == flood->psize ); } -static inline void +static void flood_pel( Flood *flood, VipsPel *q ) { int j; @@ -491,8 +491,7 @@ vips_draw_flood_build( VipsObject *object ) if( flood.equal ) { /* Edge is set by colour of the start pixel in @test. */ - if( !(flood.edge = - (VipsPel *) im_malloc( object, flood.tsize )) ) + if( !(flood.edge = VIPS_ARRAY( object, flood.tsize, VipsPel )) ) return( -1 ); memcpy( flood.edge, VIPS_IMAGE_ADDR( flood.test, @@ -651,8 +650,7 @@ vips__draw_flood_direct( VipsImage *image, VipsImage *test, flood.top = y; flood.bottom = y; - if( !(flood.edge = - (VipsPel *) im_malloc( image, flood.tsize )) ) + if( !(flood.edge = VIPS_ARRAY( image, flood.tsize, VipsPel )) ) return( -1 ); memcpy( flood.edge, VIPS_IMAGE_ADDR( test, x, y ), flood.tsize );