From b981911f6708b8baf639f2b83fa6be2e70aed8e4 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 13 Aug 2020 12:51:56 +0100 Subject: [PATCH] remove redefinition of typedefs We had this in a couple of places: typedef struct _A A; typedef struct _A A; Some old gccs (eg. centos6) throw errors for this. See https://github.com/libvips/libvips/issues/1774 --- ChangeLog | 1 + libvips/foreign/ppmsave.c | 4 ++-- libvips/include/vips/image.h | 16 +++++++++------- libvips/include/vips/region.h | 6 ++++-- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8f448f8e..c790522a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 9/8/20 started 8.10.1 - fix markdown -> xml conversion in doc generation +- remove typedef redefinitions to please old gccs 24/1/20 started 8.10.0 - more conformat IIIF output from dzsave [regisrob] diff --git a/libvips/foreign/ppmsave.c b/libvips/foreign/ppmsave.c index cbfaf787..39b0320b 100644 --- a/libvips/foreign/ppmsave.c +++ b/libvips/foreign/ppmsave.c @@ -62,7 +62,7 @@ typedef struct _VipsForeignSavePpm VipsForeignSavePpm; typedef int (*VipsSavePpmFn)( VipsForeignSavePpm *, VipsImage *, VipsPel * ); -typedef struct _VipsForeignSavePpm { +struct _VipsForeignSavePpm { VipsForeignSave parent_object; VipsTarget *target; @@ -74,7 +74,7 @@ typedef struct _VipsForeignSavePpm { /* Deprecated. */ gboolean squash; -} VipsForeignSavePpm; +}; typedef VipsForeignSaveClass VipsForeignSavePpmClass; diff --git a/libvips/include/vips/image.h b/libvips/include/vips/image.h index 01b59968..a73f565b 100644 --- a/libvips/include/vips/image.h +++ b/libvips/include/vips/image.h @@ -133,8 +133,8 @@ typedef enum { VIPS_ACCESS_LAST } VipsAccess; -typedef void *(*VipsStartFn)( struct _VipsImage *out, void *a, void *b ); -typedef int (*VipsGenerateFn)( struct _VipsRegion *out, +typedef void *(*VipsStartFn)( VipsImage *out, void *a, void *b ); +typedef int (*VipsGenerateFn)( VipsRegion *out, void *seq, void *a, void *b, gboolean *stop ); typedef int (*VipsStopFn)( void *seq, void *a, void *b ); @@ -143,7 +143,7 @@ typedef int (*VipsStopFn)( void *seq, void *a, void *b ); */ typedef struct _VipsProgress { /*< private >*/ - struct _VipsImage *im; /* Image we are part of */ + VipsImage *im; /* Image we are part of */ /*< public >*/ int run; /* Time we have been running */ @@ -169,7 +169,9 @@ typedef struct _VipsProgress { (G_TYPE_INSTANCE_GET_CLASS( (obj), \ VIPS_TYPE_IMAGE, VipsImageClass )) -typedef struct _VipsImage { +/* Matching typedef in basic.h. + */ +struct _VipsImage { VipsObject parent_instance; /*< private >*/ @@ -281,7 +283,7 @@ typedef struct _VipsImage { /* The VipsImage (if any) we should signal eval progress on. */ - struct _VipsImage *progress_signal; + VipsImage *progress_signal; /* Record the file length here. We use this to stop ourselves mapping * things beyond the end of the file in the case that the file has @@ -309,7 +311,7 @@ typedef struct _VipsImage { */ gboolean delete_on_close; char *delete_on_close_filename; -} VipsImage; +}; typedef struct _VipsImageClass { VipsObjectClass parent_class; @@ -519,7 +521,7 @@ void vips_value_set_array_image( GValue *value, int n ); /* Defined in reorder.c, but really a function on image. */ int vips_reorder_prepare_many( VipsImage *image, - struct _VipsRegion **regions, VipsRect *r ); + VipsRegion **regions, VipsRect *r ); void vips_reorder_margin_hint( VipsImage *image, int margin ); #ifdef __cplusplus diff --git a/libvips/include/vips/region.h b/libvips/include/vips/region.h index d52a3fa7..9d7a0e6c 100644 --- a/libvips/include/vips/region.h +++ b/libvips/include/vips/region.h @@ -77,8 +77,10 @@ typedef enum { } VipsRegionShrink; /* Sub-area of image. + * + * Matching typedef in basic.h. */ -typedef struct _VipsRegion { +struct _VipsRegion { VipsObject parent_object; /*< public >*/ @@ -112,7 +114,7 @@ typedef struct _VipsRegion { * dropped. */ gboolean invalid; -} VipsRegion; +}; typedef struct _VipsRegionClass { VipsObjectClass parent_class;