From d25e94d0d22c34797cbf48eaececc2b36cf45418 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sat, 15 Oct 2011 12:22:57 +0100 Subject: [PATCH] squash compiler warnings and rename vips_image_write_filename() to vips_image_write_to_file() to be more consistent --- ChangeLog | 5 ++--- TODO | 29 ++++------------------------- libvips/include/vips/image.h | 2 +- libvips/iofuncs/image.c | 14 ++++++++------ libvips/iofuncs/operation.c | 2 +- 5 files changed, 16 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8fc76032..3cc6530a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 20/8/11 started 7.27.0 - version bump for new dev cycle -- im_subtract(), im_avg(), im_min(), im_minpos() redone as classes +- im_subtract(), im_avg(), im_min(), im_minpos(), im_copy() redone as classes - added VIPS_ARGUMENT_APPEND to help control arg ordering - generate has a 'stop' param to signal successful early termination - added optional output args, eg. x/y for min @@ -18,9 +18,8 @@ - im_csv2vips() allows quoted strings, including escaped quotes - added vips_shutdown() - added --vips-leak flag -- added VipsCopy - more VipsImage props -- added vips_image_write(), old one becomes vips_image_write_filename() +- added vips_image_write(), old one becomes vips_image_write_to_file() - jpeg read/write copies over XMP data 12/9/11 started 7.26.4 diff --git a/TODO b/TODO index 053bd0b0..aab606ab 100644 --- a/TODO +++ b/TODO @@ -1,34 +1,15 @@ -- vips_image_write() uses im_copy() to send an image to a file - - but im_copy() now calls vips_copy(), which can't actually write to a - specific descriptor! - - vips_image_write() needs to do some behind-the-scenes magic, I'm not quite - sure what - - just vips_image_generate() with a pointer copy I think, basically - vipscopy without creating the output - - rename as vips_image_write_to_filename(), vips_image_write() should write to - a VipsImage - - im_add() etc. compat functions need to start calling vips_image_write() - instead of im_copy() +- improve CSV parsing a bit more, allow quotes on any field not just strings -- vipscopy - how would we do meta sets? - - vips_object_set_argument_from_string() needs more arg types +- vips_object_set_argument_from_string() needs more arg types must be some way to make this more automatic - - nicolas's convsep patch - add nifti support @@ -38,21 +19,19 @@ - - - do clip/embed etc. in new style, good to get everything that VipsAdd uses in the new stack + - add vips_init_argv() which processes argc/argv for you? handy for tiny progs, perhaps - -- could we generate the code for vips_add() etc. automatically? it might be +- generate the code for vips_add() etc. automatically? it might be nice to have them all in one place at least diff --git a/libvips/include/vips/image.h b/libvips/include/vips/image.h index 9f51c95c..fe0b0632 100644 --- a/libvips/include/vips/image.h +++ b/libvips/include/vips/image.h @@ -474,7 +474,7 @@ void vips_image_set_delete_on_close( VipsImage *image, gboolean delete_on_close ); VipsImage *vips_image_new_disc_temp( const char *format ); int vips_image_write( VipsImage *image, VipsImage *out ); -int vips_image_write_filename( VipsImage *image, const char *filename ); +int vips_image_write_to_file( VipsImage *image, const char *filename ); gboolean vips_image_isMSBfirst( VipsImage *image ); gboolean vips_image_isfile( VipsImage *image ); diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c index 526991fb..bd6e06a0 100644 --- a/libvips/iofuncs/image.c +++ b/libvips/iofuncs/image.c @@ -326,7 +326,7 @@ vips_image_to_string( VipsObject *object, VipsBuf *buf ) static int vips_image_write_object( VipsObject *object, const char *string ) { - return( vips_image_write_filename( VIPS_IMAGE( object ), string ) ); + return( vips_image_write_to_file( VIPS_IMAGE( object ), string ) ); } static void * @@ -1780,8 +1780,10 @@ vips_image_write_gen( VipsRegion *or, * @image: image to write * @out: write to this image * - * A convenience function to write a #VipsImage to another #VipsImage. Unlike - * vips_copy(), you can specify the #VipsImage you want to write to. + * Write @image to @out. Use vips_image_new_mode() and friends to create the + * #VipsImage you want to write to. + * + * See also: vips_image_new_mode(), vips_copy(), vips_image_write_to_file(). * * Returns: 0 on success, or -1 on error. */ @@ -1805,16 +1807,16 @@ vips_image_write( VipsImage *image, VipsImage *out ) } /** - * vips_image_write_filename: + * vips_image_write_to_file: * @image: image to write * @filename: write to this file * - * A convenience function to write a #VipsImage to a file. + * A convenience function to write @image to a file. * * Returns: 0 on success, or -1 on error. */ int -vips_image_write_filename( VipsImage *image, const char *filename ) +vips_image_write_to_file( VipsImage *image, const char *filename ) { VipsImage *out; diff --git a/libvips/iofuncs/operation.c b/libvips/iofuncs/operation.c index 5e58264b..f0a57a47 100644 --- a/libvips/iofuncs/operation.c +++ b/libvips/iofuncs/operation.c @@ -256,7 +256,7 @@ vips_operation_new( const char *name ) g_value_unset( &value ); \ } \ else if( (ARG_CLASS->flags & VIPS_ARGUMENT_OUTPUT) ) { \ - void **arg; \ + void **arg __attribute__ ((unused)); \ \ /* Output args are a pointer to where to send the \ * result. \