From a95ae40c65a33db753c82af92c6fffe1e63d0ad8 Mon Sep 17 00:00:00 2001 From: Clement Jamin Date: Fri, 10 Jun 2016 14:08:16 +0200 Subject: [PATCH] Fix warnings --- CGAL_ImageIO/src/CGAL_ImageIO/fgetns_impl.h | 2 +- CGAL_ImageIO/src/CGAL_ImageIO/gis_impl.h | 20 ++++++++++---------- CGAL_ImageIO/src/CGAL_ImageIO/inr_impl.h | 5 ++--- CGAL_ImageIO/src/CGAL_ImageIO/iris_impl.h | 2 +- CGAL_ImageIO/src/CGAL_ImageIO/pnm_impl.h | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/fgetns_impl.h b/CGAL_ImageIO/src/CGAL_ImageIO/fgetns_impl.h index c1ded434a9d..242f82e8da0 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/fgetns_impl.h +++ b/CGAL_ImageIO/src/CGAL_ImageIO/fgetns_impl.h @@ -32,7 +32,7 @@ CGAL_INLINE_FUNCTION char *fgetns(char *str, int n, _image *im ) { char *ret; - int l; + std::size_t l; memset( str, 0, n ); ret = ImageIO_gets( im, str, n ); diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/gis_impl.h b/CGAL_ImageIO/src/CGAL_ImageIO/gis_impl.h index fbd3b53a819..ba3cf794592 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/gis_impl.h +++ b/CGAL_ImageIO/src/CGAL_ImageIO/gis_impl.h @@ -48,8 +48,8 @@ PTRIMAGE_FORMAT createGisFormat() { CGAL_INLINE_FUNCTION int writeGis( char *name, _image* im) { char *outputName; - int length, extLength=0, res; - + int res; + std::size_t length, extLength = 0; length=strlen(name); outputName= (char *)ImageIO_alloc(length+8); @@ -110,7 +110,7 @@ int writeGis( char *name, _image* im) { } if ( im->dataMode == DM_ASCII ) { - int i, j, n, size; + std::size_t i, j, n, size; char *str = (char*)ImageIO_alloc( _LGTH_STRING_+1 ); size = im->xdim * im->ydim * im->zdim * im->vdim; n = ( im->xdim < 16 ) ? im->xdim : 16; @@ -143,7 +143,7 @@ int writeGis( char *name, _image* im) { if ( j(ImageIO_write( im, str, strlen( str ))); if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); if ( outputName != NULL ) ImageIO_free( outputName ); @@ -162,7 +162,7 @@ int writeGis( char *name, _image* im) { if ( j(ImageIO_write( im, str, strlen( str ))); if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); if ( outputName != NULL ) ImageIO_free( outputName ); @@ -189,7 +189,7 @@ int writeGis( char *name, _image* im) { if ( j(ImageIO_write(im, str, strlen(str))); if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); if ( outputName != NULL ) ImageIO_free( outputName ); @@ -208,7 +208,7 @@ int writeGis( char *name, _image* im) { if ( j(ImageIO_write(im, str, strlen(str))); if ( res <= 0 ) { fprintf(stderr, "writeGis: error when writing data in \'%s\'\n", outputName); if ( outputName != NULL ) ImageIO_free( outputName ); @@ -249,7 +249,7 @@ CGAL_INLINE_FUNCTION int readGisHeader( const char* name,_image* im) { char *s, *str = NULL; - int status; + std::size_t status; int n=0, nusermax = 20; str = (char*)ImageIO_alloc( _LGTH_STRING_+1 ); @@ -468,7 +468,7 @@ int readGisHeader( const char* name,_image* im) /* header is read. close header file and open data file. */ if( name != NULL ) { - int length = strlen(name) ; + std::size_t length = strlen(name) ; char* data_filename = (char *) ImageIO_alloc(length+4) ; if( strcmp( name+length-4, ".dim" ) ) { @@ -510,7 +510,7 @@ int readGisHeader( const char* name,_image* im) only U8 and S8 */ if ( im->dataMode == DM_ASCII ) { - int size = im->xdim * im->ydim * im->zdim * im->vdim * im->wdim; + std::size_t size = im->xdim * im->ydim * im->zdim * im->vdim * im->wdim; unsigned int n; char *tmp; int ret, iv=0; diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/inr_impl.h b/CGAL_ImageIO/src/CGAL_ImageIO/inr_impl.h index dc672626634..7b16dbb4788 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/inr_impl.h +++ b/CGAL_ImageIO/src/CGAL_ImageIO/inr_impl.h @@ -75,7 +75,7 @@ static void concatStringElement(const stringListHead *strhead, /* Writes the given inrimage header in an already opened file.*/ CGAL_INLINE_FUNCTION int _writeInrimageHeader(const _image *im, ENDIANNESS end) { - unsigned int pos, i; + std::size_t pos, i; char type[30], endianness[5], buf[257], scale[20]; std::ostringstream oss; @@ -195,8 +195,7 @@ int _writeInrimageHeader(const _image *im, ENDIANNESS end) { /* Writes the given image body in an already opened file.*/ CGAL_INLINE_FUNCTION int _writeInrimageData(const _image *im) { - unsigned long size, nbv, nwrt, i; - unsigned int v; + std::size_t size, nbv, nwrt, i, v; unsigned char **vp; if(im->openMode != OM_CLOSE) { diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/iris_impl.h b/CGAL_ImageIO/src/CGAL_ImageIO/iris_impl.h index c42f296f688..aff244b2665 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/iris_impl.h +++ b/CGAL_ImageIO/src/CGAL_ImageIO/iris_impl.h @@ -229,7 +229,7 @@ CGAL_INLINE_FUNCTION int readIrisImage( const char *, _image *im ) { byte *rawdata, *rptr; byte *pic824, *bptr, *iptr; - int i, j, size; + std::size_t i, j, size; unsigned short imagic, type; int xsize, ysize, zsize; diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/pnm_impl.h b/CGAL_ImageIO/src/CGAL_ImageIO/pnm_impl.h index 58c5a98ca34..d026f5b7826 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/pnm_impl.h +++ b/CGAL_ImageIO/src/CGAL_ImageIO/pnm_impl.h @@ -565,7 +565,7 @@ int writePgmImage(char *name,_image *im ) ImageIO_write( im, string, strlen( string ) ); if ( im->dataMode == DM_ASCII ) { - int i, j, n, size; + std::size_t i, j, n, size; char *str = (char*)ImageIO_alloc( _LGTH_STRING_+1 ); size = im->xdim * im->ydim * im->zdim * im->vdim; n = ( im->xdim < 16 ) ? im->xdim : 16;