From 288c7760a4a55d56df7a9019a8522625e305b9b7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 15 Mar 2014 22:13:52 -0500 Subject: [svn-r24803] Description: Rename GCC_DIAG_OFF/ON macros to H5_GCC_DIAG_OFF/ON and move from src/H5private.h to src/H5public.h. Wrap typedef of hsize_t and hssize_t in DIAG_OFF(long-long) macros. Clean up a bunch of "macro '-' is unused" warnings. Tested on: Mac OSX/64 10.9.2 (amazon) w/gcc 4.8.2, C++, FORTRAN, parallel (too minor to require h5committest) --- hl/tools/gif2h5/decompress.c | 6 --- hl/tools/gif2h5/gif2mem.c | 2 - hl/tools/gif2h5/hdfgifwr.c | 65 ------------------------- perform/sio_engine.c | 12 ----- perform/zip_perf.c | 6 --- src/H5Tconv.c | 108 +++++++++++++++++++++--------------------- src/H5private.h | 19 -------- src/H5public.h | 21 ++++++++ test/cross_read.c | 2 + test/gen_cross.c | 2 + test/gen_new_group.c | 7 --- test/h5test.c | 1 - test/testmeta.c | 2 - test/titerate.c | 1 - test/ttime.c | 2 + test/ttsafe_dcreate.c | 1 - test/tunicode.c | 3 -- test/tvltypes.c | 5 -- tools/h5jam/getub.c | 23 ++++----- tools/h5jam/h5jamgentest.c | 31 +----------- tools/h5jam/tellub.c | 23 ++++----- tools/misc/h5repart_gentest.c | 1 - 22 files changed, 103 insertions(+), 240 deletions(-) diff --git a/hl/tools/gif2h5/decompress.c b/hl/tools/gif2h5/decompress.c index 2e44f1c..d4e4cdc 100644 --- a/hl/tools/gif2h5/decompress.c +++ b/hl/tools/gif2h5/decompress.c @@ -17,12 +17,6 @@ #include "gif.h" -#define NEXTBYTE (*ptr++) - -#define IMAGESEP 0x2c -#define INTERLACEMASK 0x40 -#define COLORMAPMASK 0x80 - WORD iWIDE, iHIGH, eWIDE, eHIGH, expand, numcols, strip, nostrip; unsigned long cols[256]; char *cmd; diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 7995bb4..ac4b0ec 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -37,8 +37,6 @@ #include "gif.h" -#define GIF2VERSION "1.00" - GIFTOMEM Gif2Mem(BYTE *MemGif) { diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index 1771d06..d828226 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -56,31 +56,6 @@ typedef BYTE byte; typedef long int count_int; -/* indicies into conv24MB */ -#define CONV24_8BIT 0 -#define CONV24_24BIT 1 -#define CONV24_SEP1 2 -#define CONV24_LOCK 3 -#define CONV24_SEP2 4 -#define CONV24_FAST 5 -#define CONV24_SLOW 6 -#define CONV24_BEST 7 -#define CONV24_MAX 8 - -/* values 'picType' can take */ -#define PIC8 CONV24_8BIT -#define PIC24 CONV24_24BIT - -/* MONO returns total intensity of r,g,b components */ -#define MONO(rd,gn,bl) (((rd)*11 + (gn)*16 + (bl)*5) >> 5) /*.33R+ .5G+ .17B*/ - -#ifdef UNUSED -static int Width, Height; -static int curx, cury; -static long CountDown; -static int Interlace; -#endif /* UNUSED */ - #ifdef __STDC__ static void compress(int, FILE *, byte *, int); static void output(int); @@ -95,20 +70,12 @@ static void char_init(), char_out(), flush_char(); #endif /* __STDC__ */ static byte pc2nc[256]; -#ifdef UNUSED -static byte r1[256],g1[256],b1[256]; -#endif /* UNUSED */ /*************************************************************/ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, byte *gmap, byte *bmap, byte *pc2ncmap, int numcols, int colorstyle, int BitsPerPixel) { -#ifdef UNUSED - int RWidth, RHeight; - int LeftOfs, TopOfs; - int ColorMapSize, Background; -#endif /* UNUSED */ int InitCodeSize; int i; byte *pic8 = pic; @@ -121,39 +88,15 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, numcols=numcols; colorstyle=colorstyle; -#ifdef UNUSED - Interlace = 0; - Background = 0; -#endif /* UNUSED */ - for (i = 0; i < 256; i++) { pc2nc[i] = pc2ncmap[i]; -#ifdef UNUSED - r1[i] = rmap[i]; - g1[i] = gmap[i]; - b1[i] = bmap[i]; -#endif /* UNUSED */ } -#ifdef UNUSED - ColorMapSize = 1 << BitsPerPixel; - - RWidth = Width = w; - RHeight = Height = h; - LeftOfs = TopOfs = 0; - - CountDown = w * h; /* # of pixels we'll be doing */ -#endif /* UNUSED */ - if (BitsPerPixel <= 1) InitCodeSize = 2; else InitCodeSize = BitsPerPixel; -#ifdef UNUSED - curx = cury = 0; -#endif /* UNUSED */ - if (!fp) { fprintf(stderr, "WriteGIF: file not open for writing\n" ); return (1); @@ -172,11 +115,7 @@ static unsigned long cur_accum = 0; static int cur_bits = 0; #define MAXCODE(n_bits) ( (1 << (n_bits)) - 1) -#ifndef min -#define min(a,b) ((a>b) ? b : a) -#endif /* min */ #define XV_BITS 12 /* BITS was already defined on some systems */ -#define MSDOS 1 #define HSIZE 5003 /* 80% occupancy */ typedef unsigned char char_type; @@ -203,10 +142,6 @@ static int hsize = HSIZE; /* for dynamic table sizing */ * used to be 8000 characters). */ -#define tab_prefixof(i) CodeTabOf(i) -#define tab_suffixof(i) ((char_type *)(htab))[i] -#define de_stack ((char_type *)&tab_suffixof(1<__file #endif /* RISCOS */ -#ifndef GZ_SUFFIX -# define GZ_SUFFIX ".gz" -#endif /* GZ_SUFFIX */ - #define ONE_KB 1024 #define ONE_MB (ONE_KB * ONE_KB) #define ONE_GB (ONE_MB * ONE_KB) diff --git a/src/H5Tconv.c b/src/H5Tconv.c index bf686b8..58b0b46 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -8039,9 +8039,9 @@ H5T__conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8066,9 +8066,9 @@ H5T__conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8093,9 +8093,9 @@ H5T__conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8120,9 +8120,9 @@ H5T__conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8148,9 +8148,9 @@ H5T__conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8177,9 +8177,9 @@ H5T__conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8205,9 +8205,9 @@ H5T__conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8232,9 +8232,9 @@ H5T__conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8259,9 +8259,9 @@ H5T__conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8286,9 +8286,9 @@ H5T__conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8314,9 +8314,9 @@ H5T__conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_INTEGER*/ @@ -8343,9 +8343,9 @@ H5T__conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8371,9 +8371,9 @@ H5T__conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8398,9 +8398,9 @@ H5T__conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8425,9 +8425,9 @@ H5T__conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8452,9 +8452,9 @@ H5T__conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8480,9 +8480,9 @@ H5T__conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8509,9 +8509,9 @@ H5T__conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_UINT */ @@ -8537,9 +8537,9 @@ H5T__conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8564,9 +8564,9 @@ H5T__conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8591,9 +8591,9 @@ H5T__conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8618,9 +8618,9 @@ H5T__conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } @@ -8646,9 +8646,9 @@ H5T__conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_INTEGER*/ @@ -8675,9 +8675,9 @@ H5T__conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_LDOUBLE_INTEGER */ @@ -8704,9 +8704,9 @@ H5T__conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(FLOAT, LLONG, float, long long, LLONG_MIN, LLONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /* H5T_CONV_INTERNAL_FP_LLONG */ @@ -8760,9 +8760,9 @@ H5T__conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(DOUBLE, LLONG, double, long long, LLONG_MIN, LLONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_FP_LLONG*/ @@ -8816,9 +8816,9 @@ H5T__conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t UNUSED bkg_stride, void *buf, void UNUSED *bkg, hid_t UNUSED dxpl_id) { -GCC_DIAG_OFF(float-equal) +H5_GCC_DIAG_OFF(float-equal) H5T_CONV_Fx(LDOUBLE, LLONG, long double, long long, LLONG_MIN, LLONG_MAX); -GCC_DIAG_ON(float-equal) +H5_GCC_DIAG_ON(float-equal) } #endif /*H5T_CONV_INTERNAL_LDOUBLE_LLONG*/ diff --git a/src/H5private.h b/src/H5private.h index 26ccf57..d1dcd84 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -2357,25 +2357,6 @@ func_init_failed: \ #define HDcompile_assert(e) do { typedef struct { unsigned int b: (e); } x; } while(0) */ -/* Macros for enabling/disabling particular GCC warnings */ -/* (see the following web-sites for more info: - * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html - * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas - */ -/* These pragmas are only implemented usefully in gcc 4.6+ */ -#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 - #define GCC_DIAG_STR(s) #s - #define GCC_DIAG_JOINSTR(x,y) GCC_DIAG_STR(x ## y) - #define GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) - #define GCC_DIAG_PRAGMA(x) GCC_DIAG_DO_PRAGMA(GCC diagnostic x) - - #define GCC_DIAG_OFF(x) GCC_DIAG_PRAGMA(push) GCC_DIAG_PRAGMA(ignored GCC_DIAG_JOINSTR(-W,x)) - #define GCC_DIAG_ON(x) GCC_DIAG_PRAGMA(pop) -#else - #define GCC_DIAG_OFF(x) - #define GCC_DIAG_ON(x) -#endif - /* Private functions, not part of the publicly documented API */ H5_DLL herr_t H5_init_library(void); H5_DLL void H5_term_library(void); diff --git a/src/H5public.h b/src/H5public.h index 544f7be..35207df 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -72,6 +72,25 @@ extern "C" { #endif +/* Macros for enabling/disabling particular GCC warnings */ +/* (see the following web-sites for more info: + * http://www.dbp-consulting.com/tutorials/SuppressingGCCWarnings.html + * http://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#Diagnostic-Pragmas + */ +/* These pragmas are only implemented usefully in gcc 4.6+ */ +#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 406 + #define H5_GCC_DIAG_STR(s) #s + #define H5_GCC_DIAG_JOINSTR(x,y) H5_GCC_DIAG_STR(x ## y) + #define H5_GCC_DIAG_DO_PRAGMA(x) _Pragma (#x) + #define H5_GCC_DIAG_PRAGMA(x) H5_GCC_DIAG_DO_PRAGMA(GCC diagnostic x) + + #define H5_GCC_DIAG_OFF(x) H5_GCC_DIAG_PRAGMA(push) H5_GCC_DIAG_PRAGMA(ignored H5_GCC_DIAG_JOINSTR(-W,x)) + #define H5_GCC_DIAG_ON(x) H5_GCC_DIAG_PRAGMA(pop) +#else + #define H5_GCC_DIAG_OFF(x) + #define H5_GCC_DIAG_ON(x) +#endif + /* Version numbers */ #define H5_VERS_MAJOR 1 /* For major interface/format changes */ #define H5_VERS_MINOR 9 /* For minor interface/format changes */ @@ -148,8 +167,10 @@ typedef long long ssize_t; * type. */ #if H5_SIZEOF_LONG_LONG >= 8 +H5_GCC_DIAG_OFF(long-long) typedef unsigned long long hsize_t; typedef signed long long hssize_t; +H5_GCC_DIAG_ON(long-long) # define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG # define H5_SIZEOF_HSSIZE_T H5_SIZEOF_LONG_LONG #else diff --git a/test/cross_read.c b/test/cross_read.c index 308a0c1..ba99c9e 100644 --- a/test/cross_read.c +++ b/test/cross_read.c @@ -50,8 +50,10 @@ const char *FILENAME[] = { #define DATASETNAME15 "Fletcher_float_data_be" #define DATASETNAME16 "Deflate_float_data_le" #define DATASETNAME17 "Deflate_float_data_be" +#ifdef H5_HAVE_FILTER_SZIP #define DATASETNAME18 "Szip_float_data_le" #define DATASETNAME19 "Szip_float_data_be" +#endif /* H5_HAVE_FILTER_SZIP */ #define DATASETNAME20 "Shuffle_float_data_le" #define DATASETNAME21 "Shuffle_float_data_be" #define DATASETNAME22 "Nbit_float_data_le" diff --git a/test/gen_cross.c b/test/gen_cross.c index 8cbb2f5..bdc2835 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -46,8 +46,10 @@ #define DATASETNAME15 "Fletcher_float_data_be" #define DATASETNAME16 "Deflate_float_data_le" #define DATASETNAME17 "Deflate_float_data_be" +#ifdef H5_HAVE_FILTER_SZIP #define DATASETNAME18 "Szip_float_data_le" #define DATASETNAME19 "Szip_float_data_be" +#endif /* H5_HAVE_FILTER_SZIP */ #define DATASETNAME20 "Shuffle_float_data_le" #define DATASETNAME21 "Shuffle_float_data_be" #define DATASETNAME22 "Nbit_float_data_le" diff --git a/test/gen_new_group.c b/test/gen_new_group.c index 6d16031..b998913 100644 --- a/test/gen_new_group.c +++ b/test/gen_new_group.c @@ -31,13 +31,6 @@ #define FILENAME "group_new.h5" -#ifndef TRUE -#define TRUE 1 -#endif /* TRUE */ -#ifndef FALSE -#define FALSE 0 -#endif /* FALSE */ - int main(void) { hid_t fid = -1; /* File ID */ diff --git a/test/h5test.c b/test/h5test.c index f361c49..a5f81ef 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -75,7 +75,6 @@ char *paraprefix = NULL; /* for command line option para-prefix */ MPI_Info h5_io_info_g=MPI_INFO_NULL;/* MPI INFO object for IO */ #endif -#define FILENAME_BUF_SIZE 1024 #define READ_BUF_SIZE 4096 /* diff --git a/test/testmeta.c b/test/testmeta.c index 9aa4972..a008cc7 100644 --- a/test/testmeta.c +++ b/test/testmeta.c @@ -29,14 +29,12 @@ #define FILEN "testmeta.h5" -#define MEMB_SIZE 100000000 #define CHUNK_SIZE 512 #define NDATAARRAYS 3 /*#define NPOINTS 2048*/ #define NPOINTS 20 #define NEXTARRAYS 10 -#define NWATTRS 2 #define NDATAOBJECTS 100000 int main(void) diff --git a/test/titerate.c b/test/titerate.c index d41df84..049e258 100644 --- a/test/titerate.c +++ b/test/titerate.c @@ -40,7 +40,6 @@ #define NAMELEN 80 /* 1-D dataset with fixed dimensions */ -#define SPACE1_NAME "Space1" #define SPACE1_RANK 1 #define SPACE1_DIM1 4 diff --git a/test/ttime.c b/test/ttime.c index 4762656..16acd3e 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -26,7 +26,9 @@ #include "hdf5.h" #define DATAFILE "ttime.h5" +#ifdef NOT_YET #define DATASETNAME "Dataset" +#endif /* NOT_YET */ /**************************************************************** ** diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index f83332d..df51f72 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -45,7 +45,6 @@ #ifdef H5_HAVE_THREADSAFE #define FILENAME "ttsafe_dcreate.h5" -#define DATASETNAME_LENGTH 10 #define NUM_THREAD 16 void *tts_dcreate_creator(void *); diff --git a/test/tunicode.c b/test/tunicode.c index 7dfda16..7793ea3 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -29,16 +29,13 @@ #define LONG_BUF_SIZE (2 * MAX_STRING_LENGTH + 4) #define DSET1_NAME "fl_string_dataset" -#define DSET2_NAME "dataset2" #define DSET3_NAME "dataset3" #define DSET4_NAME "dataset4" #define VL_DSET1_NAME "vl_dset_1" -#define VL_DSET2_NAME "vl_dset_2" #define GROUP1_NAME "group1" #define GROUP2_NAME "group2" #define GROUP3_NAME "group3" #define GROUP4_NAME "group4" -#define SLINK_NAME "soft_link" #define RANK 1 #define COMP_INT_VAL 7 diff --git a/test/tvltypes.c b/test/tvltypes.c index ab4d880..516974e 100644 --- a/test/tvltypes.c +++ b/test/tvltypes.c @@ -32,11 +32,6 @@ #define SPACE1_RANK 1 #define SPACE1_DIM1 4 -/* 2-D dataset with fixed dimensions */ -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 - /* 1-D dataset with fixed dimensions */ #define SPACE3_RANK 1 #define SPACE3_DIM1 128 diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 3aff2b4..776eaeb 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -26,9 +26,6 @@ void parse_command_line (int argc, const char *argv[]); -#define TRUE 1 -#define FALSE 0 - /* Name of tool */ #define PROGRAMNAME "getub" char *nbytes = NULL; @@ -79,21 +76,21 @@ usage (const char *prog) void parse_command_line (int argc, const char *argv[]) { - int opt = FALSE; + int opt; /* parse command line options */ while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'c': - nbytes = HDstrdup (opt_arg); - break; - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'c': + nbytes = HDstrdup (opt_arg); + break; + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } if (argc <= opt_ind) diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index ca3d86c..9636597 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -28,7 +28,9 @@ #include "hdf5.h" #include "H5private.h" +/* not used yet #define UBTXT1 "u0.txt" +*/ #define UBTXT2 "u10.txt" #define UBTXT3 "u511.txt" #define UBTXT4 "u512.txt" @@ -69,24 +71,7 @@ char pattern[11] = "abcdefghij"; #define BUF_SIZE 1024 -#define LENSTR 50 -#define LENSTR2 11 - -#define SPACE2_RANK 2 -#define SPACE2_DIM1 10 -#define SPACE2_DIM2 10 - -#define SPACE1_RANK 1 -#define SPACE1_DIM1 4 - -#define DIM1 20 -#define DIM2 10 -#define CDIM1 DIM1/2 -#define CDIM2 DIM2/2 -#define RANK 2 - /* Element selection information */ -#define POINT1_NPOINTS 10 typedef enum{ RED, @@ -106,22 +91,10 @@ typedef struct s1_t { /* 1-D array datatype */ #define ARRAY1_RANK 1 -#define ARRAY1_DIM1 4 - -/* 3-D array datatype */ -#define ARRAY2_RANK 3 -#define ARRAY2_DIM1 3 -#define ARRAY2_DIM2 4 -#define ARRAY2_DIM3 5 /* 2-D array datatype */ -#define ARRAY3_RANK 2 -#define ARRAY3_DIM1 6 #define ARRAY3_DIM2 3 -/* VL string datatype name */ -#define VLSTR_TYPE "vl_string_type" - /* A UD link traversal function. Shouldn't actually be called. */ static hid_t UD_traverse(const char UNUSED * link_name, hid_t UNUSED cur_group, const void UNUSED * udata, size_t UNUSED udata_size, hid_t UNUSED lapl_id) diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index 0169d71..b4f87af 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -24,9 +24,6 @@ #include "h5tools.h" #include "h5tools_utils.h" -#define TRUE 1 -#define FALSE 0 - /* Name of tool */ #define PROGRAMNAME "tellub" @@ -85,21 +82,21 @@ usage (const char *prog) static void parse_command_line (int argc, const char *argv[]) { - int opt = FALSE; + int opt; /* parse command line options */ while ((opt = get_option (argc, argv, s_opts, l_opts)) != EOF) { switch ((char) opt) - { - case 'h': - usage (h5tools_getprogname()); - exit (EXIT_SUCCESS); - case '?': - default: - usage (h5tools_getprogname()); - exit (EXIT_FAILURE); - } + { + case 'h': + usage (h5tools_getprogname()); + exit (EXIT_SUCCESS); + case '?': + default: + usage (h5tools_getprogname()); + exit (EXIT_FAILURE); + } } /* check for file name to be processed */ diff --git a/tools/misc/h5repart_gentest.c b/tools/misc/h5repart_gentest.c index 8420da5..f7d9a73 100644 --- a/tools/misc/h5repart_gentest.c +++ b/tools/misc/h5repart_gentest.c @@ -23,7 +23,6 @@ #include "hdf5.h" #include "H5private.h" -#define KB 1024 #define FAMILY_NUMBER 4 #define FAMILY_SIZE 1024 #define FILENAME "family_file%05d.h5" -- cgit v0.12