From 36ddc717352be169183c75821d81bdf14e0a5743 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 08:51:46 -0600 Subject: HDFFV-10398 add sanitize attribute --- src/H5detect.c | 1038 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 527 insertions(+), 511 deletions(-) diff --git a/src/H5detect.c b/src/H5detect.c index 75a1dba..2cc8366 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -27,23 +27,23 @@ static const char *FileHeader = "\n\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"; /* * - * Created: H5detect.c - * 10 Aug 1997 - * Robb Matzke + * Created: H5detect.c + * 10 Aug 1997 + * Robb Matzke * - * Purpose: This code was borrowed heavily from the `detect.c' - * program in the AIO distribution from Lawrence - * Livermore National Laboratory. + * Purpose: This code was borrowed heavily from the `detect.c' + * program in the AIO distribution from Lawrence + * Livermore National Laboratory. * - * Detects machine byte order and floating point - * format and generates a C source file (H5Tinit.c) - * to describe those paramters. + * Detects machine byte order and floating point + * format and generates a C source file (H5Tinit.c) + * to describe those paramters. * * Assumptions: We have an ANSI compiler. We're on a Unix like - * system or configure has detected those Unix - * features which aren't available. We're not - * running on a Vax or other machine with mixed - * endianess. + * system or configure has detected those Unix + * features which aren't available. We're not + * running on a Vax or other machine with mixed + * endianess. * * Modifications: * @@ -54,9 +54,19 @@ static const char *FileHeader = "\n\ #include "H5Tpublic.h" #include "H5Rpublic.h" +#if defined(__has_attribute) +#if __has_attribute(no_sanitize) +#define HDF_NO_UBSAN __attribute__((no_sanitize("undefined"))) +#else +#define HDF_NO_UBSAN +#endif +#else +#define HDF_NO_UBSAN +#endif + #define MAXDETECT 64 -/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals. +/* The ALIGNMENT test code may generate the SIGBUS, SIGSEGV, or SIGILL signals. * We use setjmp/longjmp in the signal handlers for recovery. But setjmp/longjmp * do not necessary restore the signal blocking status while sigsetjmp/siglongjmp * do. If sigsetjmp/siglongjmp are not supported, need to use sigprocmask to @@ -66,19 +76,19 @@ static const char *FileHeader = "\n\ /* supported. */ #if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP) /* Always save blocked signals to be restore by siglongjmp. */ -#define H5JMP_BUF sigjmp_buf -#define H5SETJMP(buf) HDsigsetjmp(buf, 1) -#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) -#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */ +#define H5JMP_BUF sigjmp_buf +#define H5SETJMP(buf) HDsigsetjmp(buf, 1) +#define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) +#define H5HAVE_SIGJMP /* sigsetjmp/siglongjmp are supported. */ #elif defined(H5_HAVE_LONGJMP) -#define H5JMP_BUF jmp_buf -#define H5SETJMP(buf) HDsetjmp(buf) -#define H5LONGJMP(buf, val) HDlongjmp(buf, val) +#define H5JMP_BUF jmp_buf +#define H5SETJMP(buf) HDsetjmp(buf) +#define H5LONGJMP(buf, val) HDlongjmp(buf, val) #endif /* ALIGNMENT and signal-handling status codes */ -#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */ -#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */ +#define STA_NoALIGNMENT 0x0001 /* No ALIGNMENT Test */ +#define STA_NoHandlerVerify 0x0002 /* No signal handler Tests */ /* @@ -133,11 +143,11 @@ static void detect_C99_integers32(void); static void detect_C99_integers64(void); static void detect_alignments(void); static unsigned int align_g[] = {1, 2, 4, 8, 16}; -static int align_status_g = 0; /* ALIGNMENT Signal Status */ -static int sigbus_handler_called_g = 0; /* how many times called */ +static int align_status_g = 0; /* ALIGNMENT Signal Status */ +static int sigbus_handler_called_g = 0; /* how many times called */ static int sigsegv_handler_called_g = 0;/* how many times called */ -static int sigill_handler_called_g = 0; /* how many times called */ -static int signal_handler_tested_g = 0; /* how many times tested */ +static int sigill_handler_called_g = 0; /* how many times called */ +static int signal_handler_tested_g = 0; /* how many times tested */ #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) static int verify_signal_handlers(int signum, void (*handler)(int)); #endif @@ -145,16 +155,16 @@ static int verify_signal_handlers(int signum, void (*handler)(int)); static H5JMP_BUF jbuf_g; #endif - + /*------------------------------------------------------------------------- - * Function: precision + * Function: precision * - * Purpose: Determine the precision and offset. + * Purpose: Determine the precision and offset. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * Thursday, June 18, 1998 + * Programmer: Robb Matzke + * Thursday, June 18, 1998 * * Modifications: * @@ -167,7 +177,7 @@ precision (detected_t *d) if (0 == d->msize) { /* - * An integer. The permutation can have negative values at the + * An integer. The permutation can have negative values at the * beginning or end which represent padding of bytes. We must adjust * the precision and offset accordingly. */ @@ -201,36 +211,36 @@ precision (detected_t *d) } } - + /*------------------------------------------------------------------------- - * Function: DETECT_I/DETECT_BYTE + * Function: DETECT_I/DETECT_BYTE * - * Purpose: These macro takes a type like `int' and a base name like - * `nati' and detects the byte order. The VAR is used to - * construct the names of the C variables defined. + * Purpose: These macro takes a type like `int' and a base name like + * `nati' and detects the byte order. The VAR is used to + * construct the names of the C variables defined. * * DETECT_I is used for types that are larger than one byte, * DETECT_BYTE is used for types that are exactly one byte. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * * Modifications: * - * Robb Matzke, 4 Nov 1996 - * The INFO.perm now contains `-1' for bytes that aren't used and - * are always zero. This happens on the Cray for `short' where - * sizeof(short) is 8, but only the low-order 4 bytes are ever used. + * Robb Matzke, 4 Nov 1996 + * The INFO.perm now contains `-1' for bytes that aren't used and + * are always zero. This happens on the Cray for `short' where + * sizeof(short) is 8, but only the low-order 4 bytes are ever used. * - * Robb Matzke, 4 Nov 1996 - * Added a `padding' field to indicate how many zero bytes appear to - * the left (N) or right (-N) of the value. + * Robb Matzke, 4 Nov 1996 + * Added a `padding' field to indicate how many zero bytes appear to + * the left (N) or right (-N) of the value. * - * Robb Matzke, 5 Nov 1996 - * Removed HFILE and CFILE arguments. + * Robb Matzke, 5 Nov 1996 + * Removed HFILE and CFILE arguments. * * Neil Fortner, 6 Sep 2013 * Split macro into DETECT_I and DETECT_BYTE macros, extracted @@ -273,27 +283,27 @@ precision (detected_t *d) DETECT_I_BYTE_CORE(TYPE,VAR,INFO,int) \ } -#define DETECT_I(TYPE,VAR,INFO) { \ +#define DETECT_I(TYPE,VAR,INFO) { \ HDcompile_assert(sizeof(TYPE) > 1); \ \ DETECT_I_BYTE_CORE(TYPE,VAR,INFO,TYPE) \ } - + /*------------------------------------------------------------------------- - * Function: DETECT_F + * Function: DETECT_F * - * Purpose: This macro takes a floating point type like `double' and - * a base name like `natd' and detects byte order, mantissa - * location, exponent location, sign bit location, presence or - * absence of implicit mantissa bit, and exponent bias and - * initializes a detected_t structure with those properties. + * Purpose: This macro takes a floating point type like `double' and + * a base name like `natd' and detects byte order, mantissa + * location, exponent location, sign bit location, presence or + * absence of implicit mantissa bit, and exponent bias and + * initializes a detected_t structure with those properties. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12 1996 * *------------------------------------------------------------------------- */ @@ -383,31 +393,31 @@ precision (detected_t *d) } \ } - + /*------------------------------------------------------------------------- - * Function: DETECT_M + * Function: DETECT_M * - * Purpose: This macro takes only miscellaneous structures or pointer + * Purpose: This macro takes only miscellaneous structures or pointer * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It - * constructs the names and decides the alignment in structure. + * constructs the names and decides the alignment in structure. * - * Return: void + * Return: void * - * Programmer: Raymond Lu - * slu@ncsa.uiuc.edu - * Dec 9, 2002 + * Programmer: Raymond Lu + * slu@ncsa.uiuc.edu + * Dec 9, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -#define DETECT_M(TYPE,VAR,INFO) { \ - INFO.name = #VAR; \ - COMP_ALIGNMENT(TYPE, INFO.comp_align); \ +#define DETECT_M(TYPE,VAR,INFO) { \ + INFO.name = #VAR; \ + COMP_ALIGNMENT(TYPE, INFO.comp_align); \ } /* Detect alignment for C structure */ -#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \ +#define COMP_ALIGNMENT(TYPE,COMP_ALIGN) { \ struct { \ char c; \ TYPE x; \ @@ -417,67 +427,67 @@ precision (detected_t *d) } #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) -#define ALIGNMENT(TYPE,INFO) { \ - char *volatile _buf = NULL; \ - TYPE _val = 1, _val2; \ - volatile size_t _ano = 0; \ - void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ - void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ - void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \ - \ - _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ - if(H5SETJMP(jbuf_g)) _ano++; \ - if(_ano < NELMTS(align_g)) { \ - *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ - _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\ - /* Cray Check: This section helps detect alignment on Cray's */ \ +#define ALIGNMENT(TYPE,INFO) { \ + char *volatile _buf = NULL; \ + TYPE _val = 1, _val2; \ + volatile size_t _ano = 0; \ + void (*_handler)(int) = HDsignal(SIGBUS, sigbus_handler); \ + void (*_handler2)(int) = HDsignal(SIGSEGV, sigsegv_handler);\ + void (*_handler3)(int) = HDsignal(SIGILL, sigill_handler); \ + \ + _buf = (char*)HDmalloc(sizeof(TYPE) + align_g[NELMTS(align_g) - 1]); \ + if(H5SETJMP(jbuf_g)) _ano++; \ + if(_ano < NELMTS(align_g)) { \ + *((TYPE*)(_buf+align_g[_ano])) = _val; /*possible SIGBUS or SEGSEGV*/ \ + _val2 = *((TYPE*)(_buf+align_g[_ano])); /*possible SIGBUS or SEGSEGV*/\ + /* Cray Check: This section helps detect alignment on Cray's */ \ /* vector machines (like the SV1) which mask off */ \ - /* pointer values when pointing to non-word aligned */ \ - /* locations with pointers that are supposed to be */ \ - /* word aligned. -QAK */ \ - HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ + /* pointer values when pointing to non-word aligned */ \ + /* locations with pointers that are supposed to be */ \ + /* word aligned. -QAK */ \ + HDmemset(_buf, 0xff, sizeof(TYPE)+align_g[NELMTS(align_g)-1]); \ /*How to handle VAX types?*/ \ - if(INFO.perm[0]) /* Big-Endian */ \ - HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ - else /* Little-Endian */ \ - HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ - _val2 = *((TYPE*)(_buf+align_g[_ano])); \ - H5_GCC_DIAG_OFF(float-equal) \ - if(_val!=_val2) \ - H5LONGJMP(jbuf_g, 1); \ - H5_GCC_DIAG_ON(float-equal) \ - /* End Cray Check */ \ - (INFO.align)=align_g[_ano]; \ - } else { \ - (INFO.align)=0; \ - fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ - } \ - HDfree(_buf); \ - HDsignal(SIGBUS, _handler); /*restore original handler*/ \ - HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ - HDsignal(SIGILL, _handler3); /*restore original handler*/ \ + if(INFO.perm[0]) /* Big-Endian */ \ + HDmemcpy(_buf+align_g[_ano]+(INFO.size-((INFO.offset+INFO.precision)/8)),((char *)&_val)+(INFO.size-((INFO.offset+INFO.precision)/8)),(size_t)(INFO.precision/8)); \ + else /* Little-Endian */ \ + HDmemcpy(_buf+align_g[_ano]+(INFO.offset/8),((char *)&_val)+(INFO.offset/8),(size_t)(INFO.precision/8)); \ + _val2 = *((TYPE*)(_buf+align_g[_ano])); \ + H5_GCC_DIAG_OFF(float-equal) \ + if(_val!=_val2) \ + H5LONGJMP(jbuf_g, 1); \ + H5_GCC_DIAG_ON(float-equal) \ + /* End Cray Check */ \ + (INFO.align)=align_g[_ano]; \ + } else { \ + (INFO.align)=0; \ + fprintf(stderr, "unable to calculate alignment for %s\n", #TYPE); \ + } \ + HDfree(_buf); \ + HDsignal(SIGBUS, _handler); /*restore original handler*/ \ + HDsignal(SIGSEGV, _handler2); /*restore original handler*/ \ + HDsignal(SIGILL, _handler3); /*restore original handler*/ \ } #else -#define ALIGNMENT(TYPE,INFO) { \ - align_status_g |= STA_NoALIGNMENT; \ - (INFO.align)=0; \ +#define ALIGNMENT(TYPE,INFO) { \ + align_status_g |= STA_NoALIGNMENT; \ + (INFO.align)=0; \ } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigsegv_handler + * Function: sigsegv_handler * - * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGSEGV. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Robb Matzke - * Thursday, March 18, 1999 + * Programmer: Robb Matzke + * Thursday, March 18, 1999 * * Modifications: * @@ -502,20 +512,20 @@ sigsegv_handler(int H5_ATTR_UNUSED signo) } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigbus_handler + * Function: sigbus_handler * - * Purpose: Handler for SIGBUS. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGBUS. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Robb Matzke - * Thursday, March 18, 1999 + * Programmer: Robb Matzke + * Thursday, March 18, 1999 * * Modifications: * @@ -540,20 +550,20 @@ sigbus_handler(int H5_ATTR_UNUSED signo) } #endif - + #if defined(H5LONGJMP) && defined(H5_HAVE_SIGNAL) /*------------------------------------------------------------------------- - * Function: sigill_handler + * Function: sigill_handler * - * Purpose: Handler for SIGILL. We use signal() instead of sigaction() - * because it's more portable to non-Posix systems. Although - * it's not nearly as nice to work with, it does the job for - * this simple stuff. + * Purpose: Handler for SIGILL. We use signal() instead of sigaction() + * because it's more portable to non-Posix systems. Although + * it's not nearly as nice to work with, it does the job for + * this simple stuff. * - * Return: Returns via H5LONGJMP to jbuf_g. + * Return: Returns via H5LONGJMP to jbuf_g. * - * Programmer: Raymond Lu - * 28 October 2013 + * Programmer: Raymond Lu + * 28 October 2013 * *------------------------------------------------------------------------- */ @@ -576,17 +586,17 @@ sigill_handler(int H5_ATTR_UNUSED signo) } #endif - + /*------------------------------------------------------------------------- - * Function: print_results + * Function: print_results * - * Purpose: Prints information about the detected data types. + * Purpose: Prints information about the detected data types. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 14, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 14, 1996 * * Modifications: * @@ -596,7 +606,7 @@ static void print_results(int nd, detected_t *d, int na, malign_t *misc_align) { int byte_order=0; /*byte order of data types*/ - int i, j; + int i, j; /* Include files */ printf("\ @@ -610,11 +620,11 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) /***********/\n\ /* Headers */\n\ /***********/\n\ -#include \"H5private.h\" /* Generic Functions */\n\ -#include \"H5Eprivate.h\" /* Error handling */\n\ -#include \"H5FLprivate.h\" /* Free Lists */\n\ -#include \"H5Iprivate.h\" /* IDs */\n\ -#include \"H5Tpkg.h\" /* Datatypes */\n\ +#include \"H5private.h\" /* Generic Functions */\n\ +#include \"H5Eprivate.h\" /* Error handling */\n\ +#include \"H5FLprivate.h\" /* Free Lists */\n\ +#include \"H5Iprivate.h\" /* IDs */\n\ +#include \"H5Tpkg.h\" /* Datatypes */\n\ \n\ \n\ /****************/\n\ @@ -663,15 +673,15 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) printf("\n\ \n\ /*-------------------------------------------------------------------------\n\ - * Function: H5T__init_native\n\ + * Function: H5T__init_native\n\ *\n\ - * Purpose: Initialize pre-defined native datatypes from code generated\n\ + * Purpose: Initialize pre-defined native datatypes from code generated\n\ * during the library configuration by H5detect.\n\ *\n\ - * Return: Success: non-negative\n\ - * Failure: negative\n\ + * Return: Success: non-negative\n\ + * Failure: negative\n\ *\n\ - * Programmer: Robb Matzke\n\ + * Programmer: Robb Matzke\n\ * Wednesday, December 16, 1998\n\ *\n\ *-------------------------------------------------------------------------\n\ @@ -679,8 +689,8 @@ print_results(int nd, detected_t *d, int na, malign_t *misc_align) herr_t\n\ H5T__init_native(void)\n\ {\n\ - H5T_t *dt = NULL;\n\ - herr_t ret_value = SUCCEED;\n\ + H5T_t *dt = NULL;\n\ + herr_t ret_value = SUCCEED;\n\ \n\ FUNC_ENTER_PACKAGE\n"); @@ -702,20 +712,20 @@ H5T__init_native(void)\n\ } } - /* Print a comment to describe this section of definitions. */ - printf("\n /*\n"); - iprint(d+i); - printf(" */\n"); + /* Print a comment to describe this section of definitions. */ + printf("\n /*\n"); + iprint(d+i); + printf(" */\n"); - /* The part common to fixed and floating types */ - printf("\ + /* The part common to fixed and floating types */ + printf("\ if(NULL == (dt = H5T__alloc()))\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_NOSPACE, FAIL, \"datatype allocation failed\")\n\ dt->shared->state = H5T_STATE_IMMUTABLE;\n\ dt->shared->type = H5T_%s;\n\ dt->shared->size = %d;\n", - d[i].msize ? "FLOAT" : "INTEGER",/*class */ - d[i].size); /*size */ + d[i].msize ? "FLOAT" : "INTEGER",/*class */ + d[i].size); /*size */ if(byte_order==-1) printf("\ @@ -732,18 +742,18 @@ H5T__init_native(void)\n\ dt->shared->u.atomic.prec = %d;\n\ dt->shared->u.atomic.lsb_pad = H5T_PAD_ZERO;\n\ dt->shared->u.atomic.msb_pad = H5T_PAD_ZERO;\n", - d[i].offset, /*offset */ - d[i].precision); /*precision */ + d[i].offset, /*offset */ + d[i].precision); /*precision */ /*HDassert((d[i].perm[0]>0)==(byte_order>0));*/ /* Double-check that byte-order doesn't change */ - if (0 == d[i].msize) { - /* The part unique to fixed point types */ - printf("\ + if (0 == d[i].msize) { + /* The part unique to fixed point types */ + printf("\ dt->shared->u.atomic.u.i.sign = H5T_SGN_%s;\n", - d[i].sign ? "2" : "NONE"); - } else { - /* The part unique to floating point types */ - printf("\ + d[i].sign ? "2" : "NONE"); + } else { + /* The part unique to floating point types */ + printf("\ dt->shared->u.atomic.u.f.sign = %d;\n\ dt->shared->u.atomic.u.f.epos = %d;\n\ dt->shared->u.atomic.u.f.esize = %d;\n\ @@ -752,22 +762,22 @@ H5T__init_native(void)\n\ dt->shared->u.atomic.u.f.msize = %d;\n\ dt->shared->u.atomic.u.f.norm = H5T_NORM_%s;\n\ dt->shared->u.atomic.u.f.pad = H5T_PAD_ZERO;\n", - d[i].sign, /*sign location */ - d[i].epos, /*exponent loc */ - d[i].esize, /*exponent size */ - (unsigned long)(d[i].bias), /*exponent bias */ - d[i].mpos, /*mantissa loc */ - d[i].msize, /*mantissa size */ - d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ - } - - /* Atomize the type */ - printf("\ + d[i].sign, /*sign location */ + d[i].epos, /*exponent loc */ + d[i].esize, /*exponent size */ + (unsigned long)(d[i].bias), /*exponent bias */ + d[i].mpos, /*mantissa loc */ + d[i].msize, /*mantissa size */ + d[i].imp ? "IMPLIED" : "NONE"); /*normalization */ + } + + /* Atomize the type */ + printf("\ if((H5T_NATIVE_%s_g = H5I_register(H5I_DATATYPE, dt, FALSE)) < 0)\n\ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \"can't register ID for built-in datatype\")\n", - d[i].varname); - printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", - d[i].varname, (unsigned long)(d[i].align)); + d[i].varname); + printf(" H5T_NATIVE_%s_ALIGN_g = %lu;\n", + d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ if(!HDstrcmp(d[i].varname, "SCHAR") || !HDstrcmp(d[i].varname, "SHORT") || @@ -809,69 +819,69 @@ done:\n\ /* Print the ALIGNMENT and signal-handling status as comments */ printf("\n" - "/****************************************/\n" - "/* ALIGNMENT and signal-handling status */\n" - "/****************************************/\n"); + "/****************************************/\n" + "/* ALIGNMENT and signal-handling status */\n" + "/****************************************/\n"); if (align_status_g & STA_NoALIGNMENT) - printf("/* ALIGNAMENT test is not available */\n"); + printf("/* ALIGNAMENT test is not available */\n"); if (align_status_g & STA_NoHandlerVerify) - printf("/* Signal handlers verify test is not available */\n"); + printf("/* Signal handlers verify test is not available */\n"); /* The following is available in H5pubconf.h. Printing them here for */ /* convenience. */ #ifdef H5_HAVE_SIGNAL - printf("/* Signal() support: yes */\n"); + printf("/* Signal() support: yes */\n"); #else - printf("/* Signal() support: no */\n"); + printf("/* Signal() support: no */\n"); #endif #ifdef H5_HAVE_SETJMP - printf("/* setjmp() support: yes */\n"); + printf("/* setjmp() support: yes */\n"); #else - printf("/* setjmp() support: no */\n"); + printf("/* setjmp() support: no */\n"); #endif #ifdef H5_HAVE_LONGJMP - printf("/* longjmp() support: yes */\n"); + printf("/* longjmp() support: yes */\n"); #else - printf("/* longjmp() support: no */\n"); + printf("/* longjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGSETJMP - printf("/* sigsetjmp() support: yes */\n"); + printf("/* sigsetjmp() support: yes */\n"); #else - printf("/* sigsetjmp() support: no */\n"); + printf("/* sigsetjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGLONGJMP - printf("/* siglongjmp() support: yes */\n"); + printf("/* siglongjmp() support: yes */\n"); #else - printf("/* siglongjmp() support: no */\n"); + printf("/* siglongjmp() support: no */\n"); #endif #ifdef H5_HAVE_SIGPROCMASK - printf("/* sigprocmask() support: yes */\n"); + printf("/* sigprocmask() support: yes */\n"); #else - printf("/* sigprocmask() support: no */\n"); + printf("/* sigprocmask() support: no */\n"); #endif /* Print the statics of signal handlers called for debugging */ printf("\n" - "/******************************/\n" - "/* signal handlers statistics */\n" - "/******************************/\n"); + "/******************************/\n" + "/* signal handlers statistics */\n" + "/******************************/\n"); printf("/* signal_handlers tested: %d times */\n", signal_handler_tested_g); printf("/* sigbus_handler called: %d times */\n", sigbus_handler_called_g); printf("/* sigsegv_handler called: %d times */\n", sigsegv_handler_called_g); printf("/* sigill_handler called: %d times */\n", sigill_handler_called_g); } /* end print_results() */ - + /*------------------------------------------------------------------------- - * Function: iprint + * Function: iprint * - * Purpose: Prints information about the fields of a floating point - * format. + * Purpose: Prints information about the fields of a floating point + * format. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -945,22 +955,22 @@ iprint(detected_t *d) } - + /*------------------------------------------------------------------------- - * Function: byte_cmp + * Function: byte_cmp * - * Purpose: Compares two chunks of memory A and B and returns the - * byte index into those arrays of the first byte that - * differs between A and B. Ignores differences where the + * Purpose: Compares two chunks of memory A and B and returns the + * byte index into those arrays of the first byte that + * differs between A and B. Ignores differences where the * corresponding bit in pad_mask is set to 0. * - * Return: Success: Index of differing byte. + * Return: Success: Index of differing byte. * - * Failure: -1 if all bytes are the same. + * Failure: -1 if all bytes are the same. * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: * @@ -980,17 +990,17 @@ byte_cmp(int n, const void *_a, const void *_b, const unsigned char *pad_mask) return -1; } - + /*------------------------------------------------------------------------- - * Function: bit_cmp + * Function: bit_cmp * - * Purpose: Compares two bit vectors and returns the index for the - * first bit that differs between the two vectors. The - * size of the vector is NBYTES. PERM is a mapping from - * actual order to little endian. Ignores differences where + * Purpose: Compares two bit vectors and returns the index for the + * first bit that differs between the two vectors. The + * size of the vector is NBYTES. PERM is a mapping from + * actual order to little endian. Ignores differences where * the corresponding bit in pad_mask is set to 0. * - * Return: Index of first differing bit. + * Return: Index of first differing bit. * *------------------------------------------------------------------------- */ @@ -1021,23 +1031,23 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, return 0; } - + /*------------------------------------------------------------------------- - * Function: fix_order + * Function: fix_order * - * Purpose: Given an array PERM with elements FIRST through LAST - * initialized with zero origin byte numbers, this function - * creates a permutation vector that maps the actual order - * of a floating point number to little-endian. + * Purpose: Given an array PERM with elements FIRST through LAST + * initialized with zero origin byte numbers, this function + * creates a permutation vector that maps the actual order + * of a floating point number to little-endian. * - * This function assumes that the mantissa byte ordering - * implies the total ordering. + * This function assumes that the mantissa byte ordering + * implies the total ordering. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * @@ -1046,81 +1056,81 @@ bit_cmp(unsigned int nbytes, int *perm, void *_a, void *_b, static void fix_order(int n, int last, int *perm, const char **mesg) { - int i; + int i; if (last > 1) { - /* - * We have at least three points to consider. - */ - if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { - /* - * Little endian. - */ - if (mesg) *mesg = "Little-endian"; - for (i = 0; i < n; i++) perm[i] = i; - - } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { - /* - * Big endian. - */ - if (mesg) *mesg = "Big-endian"; - for (i = 0; i < n; i++) perm[i] = (n - 1) - i; - - } else { - /* - * Bi-endian machines like VAX. + /* + * We have at least three points to consider. + */ + if (perm[last] < perm[last - 1] && perm[last - 1] < perm[last - 2]) { + /* + * Little endian. + */ + if (mesg) *mesg = "Little-endian"; + for (i = 0; i < n; i++) perm[i] = i; + + } else if (perm[last] > perm[last-1] && perm[last-1] > perm[last-2]) { + /* + * Big endian. + */ + if (mesg) *mesg = "Big-endian"; + for (i = 0; i < n; i++) perm[i] = (n - 1) - i; + + } else { + /* + * Bi-endian machines like VAX. * (NOTE: This is not an actual determination of the VAX-endianess. * It could have some other endianess and fall into this * case - JKM & QAK) - */ - HDassert(0 == n % 2); - if (mesg) *mesg = "VAX"; - for (i = 0; i < n; i += 2) { - perm[i] = (n - 2) - i; - perm[i + 1] = (n - 1) - i; - } - } + */ + HDassert(0 == n % 2); + if (mesg) *mesg = "VAX"; + for (i = 0; i < n; i += 2) { + perm[i] = (n - 2) - i; + perm[i + 1] = (n - 1) - i; + } + } } else { - fprintf(stderr, - "Failed to detect byte order of %d-byte floating point.\n", n); - HDexit(1); + fprintf(stderr, + "Failed to detect byte order of %d-byte floating point.\n", n); + HDexit(1); } } - + /*------------------------------------------------------------------------- - * Function: imp_bit + * Function: imp_bit * - * Purpose: Looks for an implicit bit in the mantissa. The value - * of _A should be 1.0 and the value of _B should be 0.5. - * Some floating-point formats discard the most significant - * bit of the mantissa after normalizing since it will always - * be a one (except for 0.0). If this is true for the native - * floating point values stored in _A and _B then the function - * returns non-zero. + * Purpose: Looks for an implicit bit in the mantissa. The value + * of _A should be 1.0 and the value of _B should be 0.5. + * Some floating-point formats discard the most significant + * bit of the mantissa after normalizing since it will always + * be a one (except for 0.0). If this is true for the native + * floating point values stored in _A and _B then the function + * returns non-zero. * - * This function assumes that the exponent occupies higher - * order bits than the mantissa and that the most significant - * bit of the mantissa is next to the least signficant bit - * of the exponent. + * This function assumes that the exponent occupies higher + * order bits than the mantissa and that the most significant + * bit of the mantissa is next to the least signficant bit + * of the exponent. * * - * Return: Success: Non-zero if the most significant bit - * of the mantissa is discarded (ie, the - * mantissa has an implicit `one' as the - * most significant bit). Otherwise, - * returns zero. + * Return: Success: Non-zero if the most significant bit + * of the mantissa is discarded (ie, the + * mantissa has an implicit `one' as the + * most significant bit). Otherwise, + * returns zero. * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug that occurs with non-implicit architectures. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug that occurs with non-implicit architectures. * *------------------------------------------------------------------------- */ @@ -1150,26 +1160,26 @@ imp_bit(unsigned int n, int *perm, void *_a, void *_b, const unsigned char *pad_ return (a[perm[major]] >> minor) & 0x01 ? 0 : 1; } - + /*------------------------------------------------------------------------- - * Function: find_bias + * Function: find_bias * - * Purpose: Determines the bias of the exponent. This function should - * be called with _A having a value of `1'. + * Purpose: Determines the bias of the exponent. This function should + * be called with _A having a value of `1'. * - * Return: Success: The exponent bias. + * Return: Success: The exponent bias. * - * Failure: + * Failure: * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 13, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 13, 1996 * * Modifications: * - * Robb Matzke, 6 Nov 1996 - * Fixed a bug with non-implicit architectures returning the - * wrong exponent bias. + * Robb Matzke, 6 Nov 1996 + * Fixed a bug with non-implicit architectures returning the + * wrong exponent bias. * *------------------------------------------------------------------------- */ @@ -1193,17 +1203,17 @@ find_bias(unsigned int epos, unsigned int esize, int *perm, void *_a) return bias; } - + /*------------------------------------------------------------------------- - * Function: print_header + * Function: print_header * - * Purpose: Prints the C file header for the generated file. + * Purpose: Prints the C file header for the generated file. * - * Return: void + * Return: void * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Mar 12 1997 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Mar 12 1997 * * Modifications: * @@ -1213,22 +1223,22 @@ static void print_header(void) { - time_t now = HDtime(NULL); - struct tm *tm = HDlocaltime(&now); - char real_name[30]; - char host_name[256]; - int i; - const char *s; + time_t now = HDtime(NULL); + struct tm *tm = HDlocaltime(&now); + char real_name[30]; + char host_name[256]; + int i; + const char *s; #ifdef H5_HAVE_GETPWUID - struct passwd *pwd = NULL; + struct passwd *pwd = NULL; #else - int pwd = 1; + int pwd = 1; #endif - static const char *month_name[] = + static const char *month_name[] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; - static const char *purpose = "\ + "Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + static const char *purpose = "\ This machine-generated source code contains\n\ information about the various integer and\n\ floating point numeric formats found on this\n\ @@ -1240,7 +1250,7 @@ Each of the numeric formats listed below are\n\ printed from most significant bit to least\n\ significant bit even though the actual bytes\n\ might be stored in a different order in\n\ -memory. The integers above each binary byte\n\ +memory. The integers above each binary byte\n\ indicate the relative order of the bytes in\n\ memory; little-endian machines have\n\ decreasing numbers while big-endian machines\n\ @@ -1251,8 +1261,8 @@ letters with `S' for the mantissa sign bit,\n\ `M' for the mantissa magnitude, and `E' for\n\ the exponent. The exponent has an associated\n\ bias which can be subtracted to find the\n\ -true exponent. The radix point is assumed\n\ -to be before the first `M' bit. Any bit\n\ +true exponent. The radix point is assumed\n\ +to be before the first `M' bit. Any bit\n\ of a floating-point value not falling into one\n\ of these categories is printed as a question\n\ mark. Bits of integer types are printed as\n\ @@ -1271,20 +1281,20 @@ bit.\n"; */ #ifdef H5_HAVE_GETPWUID { - size_t n; - char *comma; - if ((pwd = HDgetpwuid(HDgetuid()))) { - if ((comma = HDstrchr(pwd->pw_gecos, ','))) { - n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); - HDstrncpy(real_name, pwd->pw_gecos, n); - real_name[n] = '\0'; - } else { - HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); - real_name[sizeof(real_name) - 1] = '\0'; - } - } else { - real_name[0] = '\0'; - } + size_t n; + char *comma; + if ((pwd = HDgetpwuid(HDgetuid()))) { + if ((comma = HDstrchr(pwd->pw_gecos, ','))) { + n = MIN(sizeof(real_name)-1, (unsigned)(comma-pwd->pw_gecos)); + HDstrncpy(real_name, pwd->pw_gecos, n); + real_name[n] = '\0'; + } else { + HDstrncpy(real_name, pwd->pw_gecos, sizeof(real_name)); + real_name[sizeof(real_name) - 1] = '\0'; + } + } else { + real_name[0] = '\0'; + } } #else real_name[0] = '\0'; @@ -1295,7 +1305,7 @@ bit.\n"; */ #ifdef H5_HAVE_GETHOSTNAME if (HDgethostname(host_name, sizeof(host_name)) < 0) { - host_name[0] = '\0'; + host_name[0] = '\0'; } #else host_name[0] = '\0'; @@ -1305,24 +1315,24 @@ bit.\n"; * The file header: warning, copyright notice, build information. */ printf("/* Generated automatically by H5detect -- do not edit */\n\n\n"); - HDputs(FileHeader); /*the copyright notice--see top of this file */ + HDputs(FileHeader); /*the copyright notice--see top of this file */ printf(" *\n * Created:\t\t%s %2d, %4d\n", - month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); + month_name[tm->tm_mon], tm->tm_mday, 1900 + tm->tm_year); if (pwd || real_name[0] || host_name[0]) { - printf(" *\t\t\t"); - if (real_name[0]) printf("%s <", real_name); + printf(" *\t\t\t"); + if (real_name[0]) printf("%s <", real_name); #ifdef H5_HAVE_GETPWUID - if (pwd) HDfputs(pwd->pw_name, stdout); + if (pwd) HDfputs(pwd->pw_name, stdout); #endif - if (host_name[0]) printf("@%s", host_name); - if (real_name[0]) printf(">"); - HDputchar('\n'); + if (host_name[0]) printf("@%s", host_name); + if (real_name[0]) printf(">"); + HDputchar('\n'); } printf(" *\n * Purpose:\t\t"); for (s = purpose; *s; s++) { - HDputchar(*s); - if ('\n' == *s && s[1]) printf(" *\t\t\t"); + HDputchar(*s); + if ('\n' == *s && s[1]) printf(" *\t\t\t"); } printf(" *\n * Modifications:\n *\n"); @@ -1335,84 +1345,84 @@ bit.\n"; } - + /*------------------------------------------------------------------------- - * Function: detect_C89_integers + * Function: detect_C89_integers * - * Purpose: Detect C89 integer types + * Purpose: Detect C89 integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C89_integers(void) +detect_C89_integers(void) HDF_NO_UBSAN { - DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; - DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; - DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; - DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; - DETECT_I(int, INT, d_g[nd_g]); nd_g++; - DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; - DETECT_I(long, LONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; + DETECT_BYTE(signed char, SCHAR, d_g[nd_g]); nd_g++; + DETECT_BYTE(unsigned char, UCHAR, d_g[nd_g]); nd_g++; + DETECT_I(short, SHORT, d_g[nd_g]); nd_g++; + DETECT_I(unsigned short, USHORT, d_g[nd_g]); nd_g++; + DETECT_I(int, INT, d_g[nd_g]); nd_g++; + DETECT_I(unsigned int, UINT, d_g[nd_g]); nd_g++; + DETECT_I(long, LONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long, ULONG, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- - * Function: detect_C89_floats + * Function: detect_C89_floats * - * Purpose: Detect C89 floating point types + * Purpose: Detect C89 floating point types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C89_floats(void) +detect_C89_floats(void) HDF_NO_UBSAN { DETECT_F(float, FLOAT, d_g[nd_g]); nd_g++; DETECT_F(double, DOUBLE, d_g[nd_g]); nd_g++; } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers8 + * Function: detect_C99_integers8 * - * Purpose: Detect C99 8 bit integer types + * Purpose: Detect C99 8 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers8(void) +detect_C99_integers8(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT8_T>0 #if H5_SIZEOF_INT8_T==1 DETECT_BYTE(int8_t, INT8, d_g[nd_g]); nd_g++; #else - DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++; + DETECT_I(int8_t, INT8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT8_T>0 #if H5_SIZEOF_UINT8_T==1 - DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; + DETECT_BYTE(uint8_t, UINT8, d_g[nd_g]); nd_g++; #else DETECT_I(uint8_t, UINT8, d_g[nd_g]); nd_g++; #endif @@ -1421,147 +1431,147 @@ detect_C99_integers8(void) #if H5_SIZEOF_INT_LEAST8_T==1 DETECT_BYTE(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; + DETECT_I(int_least8_t, INT_LEAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT_LEAST8_T>0 #if H5_SIZEOF_UINT_LEAST8_T==1 DETECT_BYTE(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; + DETECT_I(uint_least8_t, UINT_LEAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_INT_FAST8_T>0 #if H5_SIZEOF_INT_FAST8_T==1 DETECT_BYTE(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; #else - DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; + DETECT_I(int_fast8_t, INT_FAST8, d_g[nd_g]); nd_g++; #endif #endif #if H5_SIZEOF_UINT_FAST8_T>0 #if H5_SIZEOF_UINT_FAST8_T==1 - DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; + DETECT_BYTE(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; #else DETECT_I(uint_fast8_t, UINT_FAST8, d_g[nd_g]); nd_g++; #endif #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers16 + * Function: detect_C99_integers16 * - * Purpose: Detect C99 16 bit integer types + * Purpose: Detect C99 16 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers16(void) +detect_C99_integers16(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT16_T>0 - DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; + DETECT_I(int16_t, INT16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT16_T>0 - DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; + DETECT_I(uint16_t, UINT16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST16_T>0 - DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; + DETECT_I(int_least16_t, INT_LEAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST16_T>0 - DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; + DETECT_I(uint_least16_t, UINT_LEAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST16_T>0 - DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; + DETECT_I(int_fast16_t, INT_FAST16, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST16_T>0 - DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast16_t, UINT_FAST16, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers32 + * Function: detect_C99_integers32 * - * Purpose: Detect C99 32 bit integer types + * Purpose: Detect C99 32 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers32(void) +detect_C99_integers32(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT32_T>0 - DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; + DETECT_I(int32_t, INT32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT32_T>0 - DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; + DETECT_I(uint32_t, UINT32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST32_T>0 - DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; + DETECT_I(int_least32_t, INT_LEAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST32_T>0 - DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; + DETECT_I(uint_least32_t, UINT_LEAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST32_T>0 - DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; + DETECT_I(int_fast32_t, INT_FAST32, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST32_T>0 - DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast32_t, UINT_FAST32, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers64 + * Function: detect_C99_integers64 * - * Purpose: Detect C99 64 bit integer types + * Purpose: Detect C99 64 bit integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers64(void) +detect_C99_integers64(void) HDF_NO_UBSAN { #if H5_SIZEOF_INT64_T>0 - DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; + DETECT_I(int64_t, INT64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT64_T>0 - DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; + DETECT_I(uint64_t, UINT64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_LEAST64_T>0 - DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; + DETECT_I(int_least64_t, INT_LEAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_LEAST64_T>0 - DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; + DETECT_I(uint_least64_t, UINT_LEAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_INT_FAST64_T>0 - DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; + DETECT_I(int_fast64_t, INT_FAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_UINT_FAST64_T>0 - DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; + DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; #endif #if H5_SIZEOF_LONG_LONG>0 - DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(long long, LLONG, d_g[nd_g]); nd_g++; DETECT_I(unsigned long long, ULLONG, d_g[nd_g]); nd_g++; #else /* @@ -1569,28 +1579,28 @@ detect_C99_integers64(void) * so we'll just make H5T_NATIVE_LLONG the same as H5T_NATIVE_LONG since * `long long' is probably equivalent to `long' here anyway. */ - DETECT_I(long, LLONG, d_g[nd_g]); nd_g++; - DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++; + DETECT_I(long, LLONG, d_g[nd_g]); nd_g++; + DETECT_I(unsigned long, ULLONG, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_C99_integers + * Function: detect_C99_integers * - * Purpose: Detect C99 integer types + * Purpose: Detect C99 integer types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_integers(void) +detect_C99_integers(void) HDF_NO_UBSAN { /* break it down to more subroutines so that each module subroutine */ /* is smaller and takes less time to compile with optimization on. */ @@ -1600,23 +1610,23 @@ detect_C99_integers(void) detect_C99_integers64(); } - + /*------------------------------------------------------------------------- - * Function: detect_C99_floats + * Function: detect_C99_floats * - * Purpose: Detect C99 floating point types + * Purpose: Detect C99 floating point types * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_C99_floats(void) +detect_C99_floats(void) HDF_NO_UBSAN { #if H5_SIZEOF_DOUBLE == H5_SIZEOF_LONG_DOUBLE /* @@ -1625,29 +1635,29 @@ detect_C99_floats(void) * some systems and `long double' is probably the same as `double' here * anyway. */ - DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(double, LDOUBLE, d_g[nd_g]); nd_g++; #elif H5_SIZEOF_LONG_DOUBLE !=0 - DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++; + DETECT_F(long double, LDOUBLE, d_g[nd_g]); nd_g++; #endif } - + /*------------------------------------------------------------------------- - * Function: detect_alignments + * Function: detect_alignments * - * Purpose: Detect structure alignments + * Purpose: Detect structure alignments * - * Return: void + * Return: void * - * Programmer: Albert Cheng - * 2004/05/20 + * Programmer: Albert Cheng + * 2004/05/20 * * Modifications: * *------------------------------------------------------------------------- */ static void -detect_alignments(void) +detect_alignments(void) HDF_NO_UBSAN { /* Detect structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */ DETECT_M(void *, POINTER, m_g[na_g]); na_g++; @@ -1656,7 +1666,7 @@ detect_alignments(void) DETECT_M(hdset_reg_ref_t, HDSETREGREF, m_g[na_g]); na_g++; } - + #if defined(H5SETJMP) && defined(H5_HAVE_SIGNAL) /* Verify the signal handler for signal signum works correctly multiple times. * One possible cause of failure is that the signal handling is blocked or @@ -1664,64 +1674,70 @@ detect_alignments(void) * Return 0 for success, -1 for failure. */ static int verify_signal_handlers(int signum, void (*handler)(int)) -{ - void (*save_handler)(int) = HDsignal(signum, handler); +{ +#if defined(__has_feature) +#if __has_feature(address_sanitizer) || __has_feature(thread_sanitizer) + /* Under the address and thread sanitizers, don't raise any signals. */ + return 0; +#endif +#endif + void (*save_handler)(int) = HDsignal(signum, handler); volatile int i, val; int ntries=5; volatile int nfailures=0; volatile int nsuccesses=0; - - for (i=0;i0 || nsuccesses != ntries){ - fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. " - "Found %d failures and %d successes\n", - signum, ntries, nfailures, nsuccesses); - return(-1); + fprintf(stderr, "verify_signal_handlers for signal %d did %d tries. " + "Found %d failures and %d successes\n", + signum, ntries, nfailures, nsuccesses); + return(-1); }else{ - /* all succeeded */ - return(0); + /* all succeeded */ + return(0); } -} +} #endif - + /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Main entry point. + * Purpose: Main entry point. * - * Return: Success: exit(0) + * Return: Success: exit(0) * - * Failure: exit(1) + * Failure: exit(1) * - * Programmer: Robb Matzke - * matzke@llnl.gov - * Jun 12, 1996 + * Programmer: Robb Matzke + * matzke@llnl.gov + * Jun 12, 1996 * * Modifications: - * Albert Cheng, 2004/05/20 - * Some compilers, e.g., Intel C v7.0, took a long time to compile + * Albert Cheng, 2004/05/20 + * Some compilers, e.g., Intel C v7.0, took a long time to compile * with optimization when a module routine contains many code lines. * Divide up all those types detections macros into subroutines, both * to avoid the compiler optimization error and cleaner codes. @@ -1729,7 +1745,7 @@ static int verify_signal_handlers(int signum, void (*handler)(int)) *------------------------------------------------------------------------- */ int -main(void) +main(void) HDF_NO_UBSAN { #if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) @@ -1738,12 +1754,12 @@ main(void) * Make sure unaligned access generates SIGBUS and doesn't print warning * messages so that we can detect alignment constraints on the DEC Alpha. */ - int nvpairs[2]; + int nvpairs[2]; nvpairs[0] = SSIN_UACPROC; nvpairs[1] = UAC_NOPRINT | UAC_SIGBUS; if (setsysinfo(SSI_NVPAIRS, nvpairs, 1, 0, 0)<0) { - fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", - HDstrerror(errno)); + fprintf(stderr, "H5detect: unable to turn off UAC handling: %s\n", + HDstrerror(errno)); } #endif #endif -- cgit v0.12 From 20ee50c5b92e61169f83738740508605246a522f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 12:48:01 -0600 Subject: HDFFV-10345 splelling and whitespace corrections --- fortran/src/H5Df.c | 10 ++-- fortran/src/H5Gf.c | 42 +++++++------- fortran/src/H5Pf.c | 10 ++-- fortran/src/H5Pff.F90 | 2 +- fortran/src/H5Rff.F90 | 66 +++++++++++----------- hl/fortran/src/H5LTf90proto.h | 4 +- hl/fortran/src/H5TBfc.c | 6 +- hl/test/test_ds.c | 8 +-- src/H5Zscaleoffset.c | 112 +++++++++++++++++++------------------- src/H5detect.c | 4 +- tools/src/h5import/h5import.c | 4 +- tools/test/h5copy/h5copygentest.c | 2 +- 12 files changed, 135 insertions(+), 135 deletions(-) diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index 588ea9f..14fac6b 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -567,7 +567,7 @@ DONE: * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -641,7 +641,7 @@ DONE: * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -882,7 +882,7 @@ h5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH * dims[1] = number of elements of VL type - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -956,7 +956,7 @@ DONE: * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -1209,7 +1209,7 @@ h5dwrite_f_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, * dims[1] = number of elements of VL type * OUTPUTS * buf - data buffer - * len - array element lenghts + * len - array element lengths * RETURNS * 0 on success, -1 on failure * AUTHOR diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 720bd49..b829b20 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -47,7 +47,7 @@ */ int_f h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, - hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) + hid_t_f *grp_id, hid_t_f *lcpl_id, hid_t_f *gcpl_id, hid_t_f *gapl_id ) /******/ { hid_t c_gcpl_id = -1; /* Group creation property list */ @@ -69,11 +69,11 @@ h5gcreate_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, else { /* Create the group creation property list */ if((c_gcpl_id = H5Pcreate(H5P_GROUP_CREATE)) < 0) - goto DONE; + goto DONE; /* Set the local heap size hint */ if(H5Pset_local_heap_size_hint(c_gcpl_id, (size_t)*size_hint) < 0) - goto DONE; + goto DONE; /* Create the group */ c_grp_id = H5Gcreate2((hid_t)*loc_id, c_name, H5P_DEFAULT, c_gcpl_id, H5P_DEFAULT); @@ -308,9 +308,9 @@ h5gclose_c(hid_t_f *grp_id) * link_type - link type * current_name - name of the existing object for hard link, * anything for the soft link - * current_namelen - current name lenghth + * current_namelen - current name length * new_name - new name for the object - * new_namelen - new_name lenghth + * new_namelen - new_name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -365,7 +365,7 @@ h5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, goto DONE; break; /* End of the warnings fix */ - + default: /* Unknown/unhandled link type */ goto DONE; } /* end switch */ @@ -390,12 +390,12 @@ DONE: * cur_name - name of the existing object for hard link releative * to cur_loc_id location, * anything for the soft link - * current_namelen - current name lenghth + * current_namelen - current name length * link_type - link type * new_loc_id - location identifier * new_name - new name for the object releative to the new_loc_id * location - * new_namelen - new_name lenghth + * new_namelen - new_name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -515,9 +515,9 @@ DONE: * INPUTS * loc_id - identifier of file or group * src_name - name of the original object - * src_namelen - original name lenghth + * src_namelen - original name length * dst_name - new name for the object - * dst_namelen - new name lenghth + * dst_namelen - new name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -565,10 +565,10 @@ DONE: * INPUTS * src_loc_id - identifier of file or group * src_name - name of the original object relative to src_loc_id - * src_namelen - original name lenghth + * src_namelen - original name length * dst_loc_id - new location identifier * dst_name - new name for the object relative to dst_loc_id - * dst_namelen - new name lenghth + * dst_namelen - new name length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -617,8 +617,8 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of the object that symbolic link points to - * namelen - the name lenghth - * size - lenghth of retrurned value + * namelen - the name length + * size - length of retrurned value * OUTPUTS * value - name to be returned * RETURNS @@ -681,9 +681,9 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset - * namelen - the name lenghth + * namelen - the name length * comment - the new comment - * commentlen - new comment lenghth + * commentlen - new comment length * RETURNS * 0 on success, -1 on failure * AUTHOR @@ -732,7 +732,7 @@ DONE: * INPUTS * loc_id - identifier of file or group * name - name of object whose comment is to be set or reset - * namelen - the name lenghth + * namelen - the name length * bufsize - at most bufsize characters * comment - the new comment * RETURNS @@ -948,8 +948,8 @@ done: */ int_f h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, - int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) + int_f *index_type, int_f *order, hsize_t_f *n, hid_t_f *lapl_id, + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted ) /******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ @@ -965,7 +965,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, * Call H5Gget_info_by_idx function. */ if(H5Gget_info_by_idx((hid_t)*loc_id,c_group_name, (H5_index_t)*index_type,(H5_iter_order_t)*order,(hsize_t)*n, - &ginfo, (hid_t)*lapl_id) < 0) + &ginfo, (hid_t)*lapl_id) < 0) HGOTO_DONE(FAIL); /* Unpack the structure */ @@ -1018,7 +1018,7 @@ h5gget_info_by_idx_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, */ int_f h5gget_info_by_name_c(hid_t_f *loc_id, _fcd group_name, size_t_f *group_namelen, hid_t_f *lapl_id, - int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) + int_f *storage_type, int_f *nlinks, int_f *max_corder, int_f *mounted) /******/ { char *c_group_name = NULL; /* Buffer to hold group name C string */ diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index a114e8b..9fdd19b 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -2638,7 +2638,7 @@ h5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * INPUTS * parent - property list class identifier * name - name of the new class - * name_len - lenght of the "name" buffer + * name_len - length of the "name" buffer * OUTPUTS * class - new class identifier * RETURNS @@ -3415,8 +3415,8 @@ h5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) * mem_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names - * len - array with the lenght of each name - * lenmax - lenght of the name a sdeclared in Fortran + * len - array with the length of each name + * lenmax - length of the name a sdeclared in Fortran * flag - flag allowing partila access when one of the files is missing * RETURNS * 0 on success, -1 on failure @@ -3537,12 +3537,12 @@ h5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) * Call H5Pget_fapl_multi to set multi file dirver * INPUTS * prp_id - file_creation property list identifier - * lenmax - lenght of the name a sdeclared in Fortran + * lenmax - length of the name a sdeclared in Fortran * OUTPUTS * memb_map - memory mapping array * memb_fapl - property list for each memory usage type * memb_name - array with members names - * len - array with the lenght of each name + * len - array with the length of each name * flag - flag allowing partila access when one of the files is missing * RETURNS * 0 on success, -1 on failure diff --git a/fortran/src/H5Pff.F90 b/fortran/src/H5Pff.F90 index b69d4d0..178aa80 100644 --- a/fortran/src/H5Pff.F90 +++ b/fortran/src/H5Pff.F90 @@ -5313,7 +5313,7 @@ CONTAINS ! ! expression - buffer to hold transform expression ! hdferr - Error code -! Success: Actual lenght of the expression +! Success: Actual length of the expression ! If provided buffer "expression" is ! smaller, than expression will be ! truncated to fit into diff --git a/fortran/src/H5Rff.F90 b/fortran/src/H5Rff.F90 index 6d6371b..f5a9c6e 100644 --- a/fortran/src/H5Rff.F90 +++ b/fortran/src/H5Rff.F90 @@ -38,7 +38,7 @@ ! !***** -MODULE H5R +MODULE H5R USE, INTRINSIC :: ISO_C_BINDING, ONLY : C_PTR, C_CHAR, C_SIGNED_CHAR USE H5GLOBAL @@ -62,7 +62,7 @@ MODULE H5R END INTERFACE - TYPE :: hdset_reg_ref_t_f03 + TYPE :: hdset_reg_ref_t_f03 INTEGER(C_SIGNED_CHAR), DIMENSION(1:H5R_DSET_REG_REF_BUF_SIZE_F) :: ref END TYPE hdset_reg_ref_t_f03 @@ -165,16 +165,16 @@ CONTAINS ! Retrieves the type of object that an object reference points to. ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the objects -! ref - reference to open +! ref - reference to open ! OUTPUTS -! obj_type - object_type, possible values: +! obj_type - object_type, possible values: ! H5G_UNKNOWN_F -! H5G_GROUP_F +! H5G_GROUP_F ! H5G_DATASET_F ! H5G_TYPE_F -! hdferr - Returns 0 if successful and -1 if fails +! hdferr - Returns 0 if successful and -1 if fails ! ! AUTHOR ! Elena Pourmal @@ -227,17 +227,17 @@ CONTAINS ! Retrieves a dataspace with the specified region selected ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the regions -! ref - reference to open +! ref - reference to open ! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal ! August 12, 1999 ! -! HISTORY +! HISTORY ! Explicit Fortran interfaces were added for ! called C functions (it is needed for Windows ! port). February 28, 2001 @@ -276,16 +276,16 @@ CONTAINS ! h5rget_region_ptr_f ! ! PURPOSE -! Retrieves a dataspace with the specified region +! Retrieves a dataspace with the specified region ! selected using pointer ! ! INPUTS -! dset_id - identifier of the dataset containing +! dset_id - identifier of the dataset containing ! reference to the regions -! ref - reference to open +! ref - reference to open ! OUTPUTS -! space_id - dataspace identifier -! hdferr - Returns 0 if successful and -1 if fails +! space_id - dataspace identifier +! hdferr - Returns 0 if successful and -1 if fails ! AUTHOR ! M. Scot Breitenfeld ! August 4, 2012 @@ -319,7 +319,7 @@ CONTAINS ! loc_id - location identifier ! name - name of the object at the specified location ! Outputs: -! ref - reference to the specified object +! ref - reference to the specified object ! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -363,11 +363,11 @@ CONTAINS ! Creates reference to the dataset region ! ! INPUTS -! loc_id - location identifier -! name - name of the dataset at the specified location -! space_id - dataspace identifier that describes selected region +! loc_id - location identifier +! name - name of the dataset at the specified location +! space_id - dataspace identifier that describes selected region ! OUTPUTS -! ref - reference to the dataset region +! ref - reference to the dataset region ! hdferr - returns 0 if successful and -1 if fails ! AUTHOR ! Elena Pourmal @@ -424,12 +424,12 @@ CONTAINS ! ! Inputs: ! loc_id - location identifier -! name - name of the dataset at the specified location +! name - name of the dataset at the specified location ! ref_type - type of reference: ! H5R_OBJECT ! H5T_STD_REF_DSETREG ! Outputs: -! ref - reference created by the function call. +! ref - reference created by the function call. ! hdferr - returns 0 if successful and -1 if fails. ! OPTIONAL ! space_id - dataspace identifier that describes selected region @@ -474,7 +474,7 @@ CONTAINS ! Inputs: ! dset_id - identifier of the dataset containing ! reference -! ref - reference to open +! ref - reference to open ! Outputs: ! obj_id - object_identifier ! hdferr - returns 0 if successful and -1 if fails @@ -515,8 +515,8 @@ CONTAINS ! ! Inputs: ! dset_id - identifier of the dataset containing -! reference to teh regions -! ref - reference to open +! reference to the regions +! ref - reference to open ! Outputs: ! obj_id - dataspace identifier ! hdferr - returns 0 if successful and -1 if fails @@ -585,7 +585,7 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Identifier of referenced object INTEGER, INTENT(OUT) :: hdferr ! Error code -!***** +!***** hdferr = h5rdereference_ptr_c(obj_id, ref_type, ref, ref_obj_id) END SUBROUTINE h5rdereference_ptr_f @@ -600,14 +600,14 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. +! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. ! hdferr - Returns 0 if successful and -1 if fails. ! ! Optional parameters: -! size - The size of the name buffer, returning 0 (zero) if no name is associated +! size - The size of the name buffer, returning 0 (zero) if no name is associated ! with the identifier. ! ! AUTHOR @@ -648,7 +648,7 @@ CONTAINS ! ! Inputs: ! loc_id - Identifier for the file containing the reference or for any object in that file. -! ref - An object or dataset region reference. +! ref - An object or dataset region reference. ! ! Outputs: ! name - A name associated with the referenced object or dataset region. @@ -747,12 +747,12 @@ CONTAINS ! ref - Reference to query. ! ! Outputs: - ! obj_type - Type of referenced object. + ! obj_type - Type of referenced object. ! H5G_UNKNOWN_F ! H5G_GROUP_F ! H5G_DATASET_F ! H5G_TYPE_F - ! + ! ! hdferr - Returns 0 if successful and -1 if fails. ! ! AUTHOR diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index 35b08a1..031db2c 100644 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -303,7 +303,7 @@ h5tbmake_table_c(size_t_f *namelen1, hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ _fcd buf); /* field_names */ @@ -334,7 +334,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, hsize_t_f *chunk_size, void *fill_data, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, /* field_names */ void *data); diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index c0d053f..331f0bc 100644 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -38,7 +38,7 @@ int_f h5tbmake_table_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names) /* field_names */ { @@ -143,7 +143,7 @@ h5tbmake_table_ptr_c(size_t_f *namelen1, _fcd name1, hid_t_f *loc_id, size_t_f * _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, size_t_f *field_offset, hid_t_f *field_types, hsize_t_f *chunk_size, void *fill_data, int_f *compress, - size_t_f *char_len_field_names, /* field_names lenghts */ + size_t_f *char_len_field_names, /* field_names lengths */ size_t_f *max_char_size_field_names, /* char len of fields */ char *field_names, void *data) /* field_names */ @@ -638,7 +638,7 @@ done: int_f h5tbget_field_info_c(hid_t_f *loc_id, size_t_f *namelen, _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size, - size_t_f *namelen2, /* field_names lenghts */ + size_t_f *namelen2, /* field_names lengths */ size_t_f *lenmax, /* character len max */ _fcd field_names, /* field_names */ size_t_f *maxlen_out) diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 91f1505..49dc72f 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -3080,7 +3080,7 @@ static int test_simple(void) /*------------------------------------------------------------------------- - * get the label using a static buffer smaller than the string lenght + * get the label using a static buffer smaller than the string length *------------------------------------------------------------------------- */ @@ -3118,7 +3118,7 @@ static int test_simple(void) *------------------------------------------------------------------------- */ - /* get the lenght of the scale name (pass NULL in name) */ + /* get the length of the scale name (pass NULL in name) */ if((name_len=H5DSget_scale_name(dsid,NULL,(size_t)0)) < 0) goto out; @@ -3151,7 +3151,7 @@ static int test_simple(void) goto out; /*------------------------------------------------------------------------- - * get the scale name using a static buffer smaller than the string lenght + * get the scale name using a static buffer smaller than the string length *------------------------------------------------------------------------- */ @@ -4925,7 +4925,7 @@ static int test_errors2(void) hsize_t dimd[2] = {3,3}; /* size of data dataset */ hsize_t dims[1] = {3}; /* size of scale dataset */ char lbuf[255]; /* label buffer */ - ssize_t label_len; /* label lenght */ + ssize_t label_len; /* label length */ int scale_idx; /* scale index */ int nscales; /* number of scales in DIM */ int count; /* visitor data */ diff --git a/src/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index b86d785..58bcf8b 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -13,16 +13,16 @@ #include "H5Zmodule.h" /* This source code file is part of the H5Z module */ -#include "H5private.h" /* Generic Functions */ -#include "H5ACprivate.h" /* Metadata cache */ -#include "H5Eprivate.h" /* Error handling */ -#include "H5Iprivate.h" /* IDs */ -#include "H5MMprivate.h" /* Memory management */ +#include "H5private.h" /* Generic Functions */ +#include "H5ACprivate.h" /* Metadata cache */ +#include "H5Eprivate.h" /* Error handling */ +#include "H5Iprivate.h" /* IDs */ +#include "H5MMprivate.h" /* Memory management */ #include "H5Pprivate.h" /* Property lists */ #include "H5Oprivate.h" /* Object headers */ -#include "H5Sprivate.h" /* Dataspaces */ -#include "H5Tprivate.h" /* Datatypes */ -#include "H5Zpkg.h" /* Data filters */ +#include "H5Sprivate.h" /* Dataspaces */ +#include "H5Tprivate.h" /* Datatypes */ +#include "H5Zpkg.h" /* Data filters */ /* Struct of parameters needed for compressing/decompressing one atomic datatype */ typedef struct { @@ -78,13 +78,13 @@ static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, uns /* This message derives from H5Z */ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ - H5Z_FILTER_SCALEOFFSET, /* Filter id number */ + H5Z_FILTER_SCALEOFFSET, /* Filter id number */ 1, /* Assume encoder present: check before registering */ 1, /* decoder_present flag (set to true) */ - "scaleoffset", /* Filter name for debugging */ - H5Z_can_apply_scaleoffset, /* The "can apply" callback */ + "scaleoffset", /* Filter name for debugging */ + H5Z_can_apply_scaleoffset, /* The "can apply" callback */ H5Z_set_local_scaleoffset, /* The "set local" callback */ - H5Z_filter_scaleoffset, /* The actual filter function */ + H5Z_filter_scaleoffset, /* The actual filter function */ }}; /* Local macros */ @@ -665,15 +665,15 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ H5Z_scaleoffset_modify_4(i, type, pow_fun, buf, d_nelmts, min, D_val) \ } - + /*------------------------------------------------------------------------- - * Function: H5Z_can_apply_scaleoffset + * Function: H5Z_can_apply_scaleoffset * - * Purpose: Check the parameters for scaleoffset compression for + * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Xiaowen Wu * Friday, February 4, 2005 @@ -685,7 +685,7 @@ H5Z_class2_t H5Z_SCALEOFFSET[1] = {{ static htri_t H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ATTR_UNUSED space_id) { - const H5T_t *type; /* Datatype */ + const H5T_t *type; /* Datatype */ H5T_class_t dtype_class; /* Datatype's class */ H5T_order_t dtype_order; /* Datatype's endianness order */ htri_t ret_value = TRUE; /* Return value */ @@ -694,20 +694,20 @@ H5Z_can_apply_scaleoffset(hid_t H5_ATTR_UNUSED dcpl_id, hid_t type_id, hid_t H5_ /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Get datatype's class, for checking the "datatype class" */ if((dtype_class = H5T_get_class(type, TRUE)) == H5T_NO_CLASS) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") /* Get datatype's size, for checking the "datatype size" */ if(H5T_get_size(type) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") if(dtype_class == H5T_INTEGER || dtype_class == H5T_FLOAT) { /* Get datatype's endianness order */ if((dtype_order = H5T_get_order(type)) == H5T_ORDER_ERROR) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order") /* Range check datatype's endianness order */ if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE) @@ -719,17 +719,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_can_apply_scaleoffset() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_get_type + * Function: H5Z_scaleoffset_get_type * - * Purpose: Get the specific integer type based on datatype size and sign + * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size * - * Return: Success: id number of integer type - * Failure: 0 + * Return: Success: id number of integer type + * Failure: 0 * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * * Modifications: @@ -784,14 +784,14 @@ done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- - * Function: H5Z_scaleoffset_set_parms_fillval + * Function: H5Z_scaleoffset_set_parms_fillval * - * Purpose: Get the fill value of the dataset and store in cd_values[] + * Purpose: Get the fill value of the dataset and store in cd_values[] * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * * Programmer: Xiaowen Wu * Monday, March 7, 2005 @@ -836,17 +836,17 @@ done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_scaleoffset_set_parms_fillval() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_set_local_scaleoffset + * Function: H5Z_set_local_scaleoffset * - * Purpose: Set the "local" dataset parameters for scaleoffset + * Purpose: Set the "local" dataset parameters for scaleoffset * compression. * - * Return: Success: Non-negative - * Failure: Negative + * Return: Success: Non-negative + * Failure: Negative * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Friday, February 4, 2005 * * Modifications: @@ -857,8 +857,8 @@ static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) { H5P_genplist_t *dcpl_plist; /* Property list pointer */ - H5T_t *type; /* Datatype */ - const H5S_t *ds; /* Dataspace */ + H5T_t *type; /* Datatype */ + const H5S_t *ds; /* Dataspace */ unsigned flags; /* Filter flags */ size_t cd_nelmts = H5Z_SCALEOFFSET_USER_NPARMS; /* Number of filter parameters */ unsigned cd_values[H5Z_SCALEOFFSET_TOTAL_NPARMS]; /* Filter parameters */ @@ -879,14 +879,14 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype */ if(NULL == (type = (H5T_t *)H5I_object_verify(type_id, H5I_DATATYPE))) - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") /* Initialize the parameters to a known state */ HDmemset(cd_values, 0, sizeof(cd_values)); /* Get the filter's current parameters */ if(H5P_get_filter_by_id(dcpl_plist, H5Z_FILTER_SCALEOFFSET, &flags, &cd_nelmts, cd_values, (size_t)0, NULL, NULL) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get scaleoffset parameters") /* Get dataspace */ if(NULL == (ds = (H5S_t *)H5I_object_verify(space_id, H5I_DATASPACE))) @@ -930,7 +930,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Get datatype's size */ if((dtype_size = H5T_get_size(type)) == 0) - HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") + HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") /* Set "local" parameter for datatype size */ H5_CHECK_OVERFLOW(dtype_size, size_t, unsigned); @@ -1008,23 +1008,23 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Modify the filter's parameters for this dataset */ if(H5P_modify_filter(dcpl_plist, H5Z_FILTER_SCALEOFFSET, flags, (size_t)H5Z_SCALEOFFSET_TOTAL_NPARMS, cd_values) < 0) - HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") + HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local scaleoffset parameters") done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_set_local_scaleoffset() */ - + /*------------------------------------------------------------------------- - * Function: H5Z_filter_scaleoffset + * Function: H5Z_filter_scaleoffset * - * Purpose: Implement an I/O filter for storing packed integer + * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. * - * Return: Success: Size of buffer filtered - * Failure: 0 + * Return: Success: Size of buffer filtered + * Failure: 0 * - * Programmer: Xiaowen Wu + * Programmer: Xiaowen Wu * Monday, February 7, 2005 * * Modifications: @@ -1051,13 +1051,13 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value unsigned char *outbuf = NULL; /* pointer to new output buffer */ unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */ unsigned i; /* index */ - parms_atomic p; /* paramters needed for compress/decompress functions */ + parms_atomic p; /* parameters needed for compress/decompress functions */ FUNC_ENTER_NOAPI_NOINIT /* check arguments */ if(cd_nelmts != H5Z_SCALEOFFSET_TOTAL_NPARMS) - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of paramters") + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid scaleoffset number of parameters") /* Check if memory byte order matches dataset datatype byte order */ switch(H5T_native_order_g) { @@ -1107,7 +1107,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value /* if scale_factor is less than 0 for integer, library will reset it to 0 * in this case, library will calculate the minimum-bits */ - if(scale_factor < 0) scale_factor = 0; + if(scale_factor < 0) scale_factor = 0; } /* fixed-minimum-bits method is not implemented and is forbidden */ @@ -1128,7 +1128,7 @@ H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, const unsigned cd_value minbits = (uint32_t)scale_factor; } - /* prepare paramters to pass to compress/decompress functions */ + /* prepare parameters to pass to compress/decompress functions */ p.size = cd_values[H5Z_SCALEOFFSET_PARM_SIZE]; p.mem_order = H5T_native_order_g; @@ -1310,7 +1310,7 @@ done: * atomic datatype is treated on byte basis */ - + /* change byte order of input buffer either from little-endian to big-endian * or from big-endian to little-endian 2/21/2005 */ diff --git a/src/H5detect.c b/src/H5detect.c index 2cc8366..ff163cf 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -37,7 +37,7 @@ static const char *FileHeader = "\n\ * * Detects machine byte order and floating point * format and generates a C source file (H5Tinit.c) - * to describe those paramters. + * to describe those parameters. * * Assumptions: We have an ANSI compiler. We're on a Unix like * system or configure has detected those Unix @@ -75,7 +75,7 @@ static const char *FileHeader = "\n\ /* Define H5SETJMP/H5LONGJMP depending on if sigsetjmp/siglongjmp are */ /* supported. */ #if defined(H5_HAVE_SIGSETJMP) && defined(H5_HAVE_SIGLONGJMP) -/* Always save blocked signals to be restore by siglongjmp. */ +/* Always save blocked signals to be restored by siglongjmp. */ #define H5JMP_BUF sigjmp_buf #define H5SETJMP(buf) HDsigsetjmp(buf, 1) #define H5LONGJMP(buf, val) HDsiglongjmp(buf, val) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 36a8c21..76e78af 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -1405,7 +1405,7 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; const char *err14b = "Error in retrieving the compression parameter from %s.\n"; const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; - const char *err15b = "Error in retrieving the external storage paramters from %s.\n"; + const char *err15b = "Error in retrieving the external storage parameters from %s.\n"; const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n"; const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n"; @@ -3690,7 +3690,7 @@ static int getCompressionParameter(struct Input *in, FILE *strm) { /* currently supports only GZIP */ /* can be extended by adding more values to COMPRESSION-TYPE and */ - /* handling the paramters here by adding more cases */ + /* handling the parameters here by adding more cases */ int ival; const char *err1 = "Unable to get integer value.\n"; diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 35f9132..9f5d916 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -225,7 +225,7 @@ static void gent_compressed(hid_t loc_id) /*------------------------------------------------------------------------- * Function: gent_named_vl * - * Purpose: Generate a variable lenght named datatype for a dataset in + * Purpose: Generate a variable length named datatype for a dataset in LOC_ID * *------------------------------------------------------------------------- -- cgit v0.12 From f1cffac626e3e1ecbee0f55d7a970643b9c6b397 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 5 Feb 2018 16:14:52 -0600 Subject: Remove old dependency construct --- CMakeLists.txt | 1 - tools/CMakeLists.txt | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 00ec70a..3c7bb38 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -725,7 +725,6 @@ if (BUILD_TESTING) if (NOT HDF5_EXTERNALLY_CONFIGURED) if (EXISTS "${HDF5_SOURCE_DIR}/test" AND IS_DIRECTORY "${HDF5_SOURCE_DIR}/test") - add_subdirectory (tools/lib) add_subdirectory (test) endif () if (H5_HAVE_PARALLEL) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8d442e0..41a9fdc 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -9,9 +9,7 @@ add_definitions (${HDF_EXTRA_C_FLAGS}) # -------------------------------------------------------------------- # If testing was NOT enabled, then we need to build the tools library # -------------------------------------------------------------------- -if (NOT BUILD_TESTING) - add_subdirectory (lib) -endif () +add_subdirectory (lib) #----------------------------------------------------------------------------- # Setup include Directories -- cgit v0.12