Skip to content

Commit

Permalink
Hdf5 merge issue 486 v112 (#489)
Browse files Browse the repository at this point in the history
* Snapshot version 1.12 release 1-3.  Update  version to 1.12.1-4.

* First cut of the H5 public API documentation. (#80)

* First cut of the H5 public API documentation.

* Added H5Z "bonus track."

* Applied Quincey's patch.

* Added the missing patches from Quincey's original patch.

* H5PL (complete) and basic H5VL API documentation.

* Added H5I API docs.

* Added H5L API docs.

* First installment from Elena's H5T batch.

* Second installment of Elena's H5T batch.

* Final installment of Elena's H5T batch.

* Full set of current H5F documentation. (#105)

* First cut of the H5 public API documentation.

* Added H5Z "bonus track."

* Applied Quincey's patch.

* Added the missing patches from Quincey's original patch.

* H5PL (complete) and basic H5VL API documentation.

* Added H5I API docs.

* Added H5L API docs.

* First installment from Elena's H5T batch.

* Second installment of Elena's H5T batch.

* Final installment of Elena's H5T batch.

* Migrated documentation for SWMR functions.

* Catching up on MDC functions.

* Integrated the H5F MDC function documentation.

* Added MDC and parallel H5F functions.

* Slightly updated main page.

* Added doxygen/dox/H5AC_cache_config_t.dox to MANIFEST.

* Doxygen - added (mostly) beginner functions (#112)

* Doxygen - added (mostly) beginner functions

* Removed duplicate H5Pset_szip function

* Add src/H5module.h to MANIFEST.

* close #195. (#196)

* Update HDF5PluginMacros.cmake

* Update HDF5PluginMacros.cmake

* Avoid aligned access for references by decoding into temporary buffer and then copying the result into the actual buffer.   Update test to be more thorough with using compound datatype fields everywhere. (#206)

* Modify temporary rpath for testing in java example scripts. (#230)

* Fix undefined left shifting of negative numbers (#338)

Undefined Bahavior Sanitizer errored here about left shifting negative numbers.

* Fixes various warnings noticed on Windows (#425)

* Fixes various warnings noticed on Windows

- Adds a prototype for our implementation of vasprintf
- Return type of H5_get_utf16_str() is now non-const
- Fixes possible uninitialized return type in Wremove_utf8
- Better isolation of fork() code in accum.c:test_swmr_write_big()
- Better isolation of non-zlib code in dsets.c:test_filter_delete()
- Removed unused variable in trefer.c:test_reference_cmpnd_obj()

* Fixes clang-format issues

* Applied clang-tidy readability-non-const-parameter warning fixes auto… (#429)

* Automatically applied clang-tidy readability-avoid-const-params-in-decls fixes

Removes useless const declarations.

* Fixed most readability-non-const-parameter warnings

These changes were made automatically by clang-tidy, but I manually reverted the changes related to the H5Z_func_t signature.

* Reformat source with clang v10.0.1.

Co-authored-by: Larry Knox <[email protected]>

* Added C++11 override keyword where appropriate (#433)

Added H5_OVERRIDE macro for compatibility with both C++11 and older.

* Various clang tidy warning fixes (#448)

* Fixed clang-tidy bugprone-reserved-identifier warnings

* Fixed clang-tidy bugprone-assert-side-effect warnings

* Fixed clang-tidy bugprone-copy-constructor-init warning

* Fixed clang-tidy readability-redundant-preprocessor warning

For error_test.c the removed code was already dead, because it was in the else of an `#if H5_USE_16_API` block.

Based on H5Location.h, I think p_get_ref_obj_type was meant to be in `#ifndef DOXYGEN_SHOULD_SKIP_THIS` and an `#endif` was missing.  Similarly, in the header, getObjTypeByIdx is only in H5_NO_DEPRECATED_SYMBOLS, not DOXYGEN_SHOULD_SKIP_THIS.

* Fixed clang-tidy readability-redundant-string-init warnings

* Fixed some clang-tidy performance-type-promotion-in-math-fn warnings

* Fixed clang-tidy performance-unnecessary-value-param warnings

* Reformat source with clang v10.0.1.

Co-authored-by: Larry Knox <[email protected]>

* Removed checks/workarounds for pre-C++89 compatibility (#449)

After 30+ years, just assume that the following exist:
- extension-less includes
- namespaces
- std::
- static_cast
- bool

* Fixed all clang-tidy bugprone-suspicious-string-compare warnings (#451)

* Fixed all clang-tidy bugprone-suspicious-string-compare warnings

This change was generated entirely by clang-tidy itself.

* Reformat code with clang v10.0.1.

Co-authored-by: Larry Knox <[email protected]>

* Remove 2 functions incorrectly merged from develop in a cherry-pick merge of PR #451.

* Simplified hl parsing (#399)

* Stop using global variables to share parse context with the lexer.

The lexer uses an unconventional strategy for parsing lexical categories
NUMBER (decimal numbers) and STRING (double-quoted strings) that involves
sharing the parse context with the lexer using global variables. There
are a couple of problems with that. First, the lexer is too complicated
for the simple tokenization it performs—it's hard to tell if it is
correct. Second, as @seanm points out, the shared global variables
spill into the namespace shared by other libraries and application
programs—e.g., VTK.

* Regenerate source files from *.[yl].

* Replace strndup, which isn't available on Windows, with a custom
routine, `trim_quotes`, that produces a copy of its `const char *`
argument with leading and trailing double quotes ('"') removed.

While I am here, remove the unnecessary statement `BEGIN INITIAL;`,
which I should have deleted in a previous commit.

* Regenerate .c from .l.

* You haven't programmed in C until you have programmed in High-Definition
(HD) C.

* \#include "H5private.h" for HD* definitions.

* Regenerate *.[ch] from *.[yl].

* Removed workarounds for pre-standard inline keyword (#423)

Fixes -Wreserved-identifier warnings due to multiple underscores in H5_HAVE___INLINE.

* Replaces checks for fork, etc. with checks for unistd.h (#457)

* Replaces checks for fork, etc. with H5_HAVE_UNISTD_H

Code previously checked for individual POSIX API calls using
H5_HAVE_FORK, etc. The calls we use have been standardized for
decades and available via unistd.h.

Some test messages that were missing when tests are skipped
due to a lack of unistd.h were also added.

The configure checks for individual POSIX API calls will be
removed in a later commit.

* Stupid formatter

* develop JNI export references and java updates (#467)

* OESS-98 convert plugin option to FetchContent, add tests

* Fixes for pkcfg files because of plugin option

* OESS-98 fix tools test for plugins

* Keep doxygen comments under 100 chars long - format hint

* Whitespace

* HDFFV-11144 - Reclassify CMake messages

* HDFFV-11099/11100 added help text

* Reworked switch statement to compare string instead

* Fix typo

* Update CDash mode

* Correct name of threadsafe

* Correct option name

* Undo accidental commit

* Note LLVM 10 to 11 format default changes

* Update format plugin

* Undo clang-format version 11 changes

* One more correction

* Update supported platforms

* Revert whitespace changes

* Correct whitespace

* Changes from PR#3

* HDFFV-11213 added option to control gcc10 warnings diagnostics

* HDFFV-11212 Use the new references correctly in JNI utility and tests

* format source

* Fix typo

* Add new test file

* HDFFV-11212 - update test and remove unused arg

* Minor non-space formatting changes

* Use H5I_INVALID_ID instead of "-1"

* source formatting

* add missing testfile, update jni function

* Undo commit of debug code

* remove mislocated file

* Fix h5repack test for handling of fapls and id close

* Update h5diff test files usage text

* HDFFV-11212 add new ref tests for JNI export dataset

* src format update

* Remove blank line typo

* src format typo

* long double requires %Lg

* Another long double foramt specifer S.B. %Lg

* issue with t128bit test

* Windows issue with h5dump and type.

* Fix review issues

* refactor function nesting and fix error checks

* format fixes

* Remove untested functions and javadoc quiet comments

* Restore TRY block.

* Change string append errors to memory exception

* revert to H5_JNI_FATAL_ERROR - support functions need work

* Add assertion error for h5util functions

* remove duplicate function

* format fix

* Revert HD function error handling

* Update copyright comments

* GH #386 java folder copyright corrections

* Whitespace

* GH #359 implement and fix tools 1.6 API usage

* remove excessive comments

* Flip inits to correct ifdef section

* rework ifdef to be simpler

* format issue

* Reformat ifdef inits

* remove static attribute

* format compliance

* Update names

* Revert because logic relies on float not being int

* Changes noticed from creating merge of #412

* Double underscore change

* Correct compiler version variable used

* Remove header guard underscores

* Whitespace cleanup

* Split format source and commit changes on repo push

* remove pre-split setting

* Change windows TS to use older VS.

* correct window os name

* HDFFV-11212 JNI export util and Javadoc

* Suggested review changes

* Another change found

* Committing clang-format changes

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

* Update h5LT files with latest flex and Bison available on jelly  (#502)

* Modify temporary rpath for testing in java example scripts.

* Update URL in source file Copyright headers for web copy of COPYING (license) file.

* Add release_docs/code-conventions.md file.

* Add script to test h5py.

* Fix script error.

* Add file h5pytest.yml.

* Test declaration of counter variables in for loops.

* Committing clang-format changes

* Committing clang-format changes

* Added [] to line 126 of H5LTanalyze.l.
Ran bin/genparser with flex v2.6.4 and Bison v3.0.4 on jelly.

* Revert "Added [] to line 126 of H5LTanalyze.l."

This reverts commit e4a9cee.

* Revert extra commits to match canonical develop.

* Added [] to H5LTanalyze.l line 126 to eliminate warning "rule could not be
matched".
Ran bin/genparser hl/src with flex v2.6.4 and Bison v3.0.4 on jelly.

* Added HD to strdup in H5LTparse.y line 338.
Ran bin/genparser hlsrc again.

* Removed line 126 from H5LTanalyze.l - previous line matches.
Added previously removed line 318 of H5LTparse.y to fix hl_test_lite
failure.
Ran bin/genparser.

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>

Co-authored-by: Gerd Heber <[email protected]>
Co-authored-by: bljhdf <[email protected]>
Co-authored-by: H. Joe Lee <[email protected]>
Co-authored-by: Quincey Koziol <[email protected]>
Co-authored-by: Sean McBride <[email protected]>
Co-authored-by: Dana Robinson <[email protected]>
Co-authored-by: David Young <[email protected]>
Co-authored-by: Allen Byrne <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
10 people authored Mar 24, 2021
1 parent 62fe5a7 commit ddab4f2
Show file tree
Hide file tree
Showing 18 changed files with 2,156 additions and 2,105 deletions.
1,842 changes: 923 additions & 919 deletions hl/src/H5LTanalyze.c

Large diffs are not rendered by default.

91 changes: 29 additions & 62 deletions hl/src/H5LTanalyze.l
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,15 @@
*/

%{
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>

#include "H5private.h"
#include "H5LTparse.h"

static char *trim_quotes(const char *);
int my_yyinput(char *, int);
#undef YY_INPUT
#define YY_INPUT(b, r, ms) (r=my_yyinput(b, ms))
Expand All @@ -37,43 +41,8 @@ int my_yyinput(char *, int);
extern char *myinput;
extern size_t input_len;

#define STACK_SIZE 16

/*variables for compound type*/
struct cmpd_info {
hid_t id;
hbool_t is_field;
hbool_t first_memb;
};
extern struct cmpd_info cmpd_stack[STACK_SIZE];
extern int csindex;

/*variables for array type*/
struct arr_info {
hsize_t dims[H5S_MAX_RANK];
int ndim;
hbool_t is_dim;
};
extern struct arr_info arr_stack[STACK_SIZE];
extern int asindex;

/*variables for enumerate type*/
extern hbool_t is_enum;
extern hbool_t is_enum_memb;

/*variables for string type*/
extern hbool_t is_str_size;

/*variables for opaque type*/
extern hbool_t is_opq_size;
extern hbool_t is_opq_tag;

hbool_t first_quote = 1;

%}

%s TAG_STRING

%%

H5T_STD_I8BE {return hid(H5T_STD_I8BE_TOKEN);}
Expand Down Expand Up @@ -138,32 +107,12 @@ OPQ_SIZE {return token(OPQ_SIZE_TOKEN);}
OPQ_TAG {return token(OPQ_TAG_TOKEN);}

[0-9]+ {
if( is_str_size || (is_enum && is_enum_memb) ||
is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) ||
(csindex>-1 && cmpd_stack[csindex].is_field) ) {
H5LTyylval.ival = atoi(yytext);
return NUMBER;
} else
REJECT;
H5LTyylval.ival = HDatoi(yytext);
return NUMBER;
}

"\"" {
/*if it's first quote, and is a compound field name or an enum symbol*/
if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field))
&& first_quote) {
first_quote = 0;
BEGIN TAG_STRING;
} else /*if it's second quote*/
first_quote = 1;
return token('"');
}
<TAG_STRING>[^\"]+ {
#ifdef H5_HAVE_WIN32_API
H5LTyylval.sval = _strdup(yytext);
#else /* H5_HAVE_WIN32_API */
H5LTyylval.sval = strdup(yytext);
#endif /* H5_HAVE_WIN32_API */
BEGIN INITIAL;
["][^\"]+["] {
H5LTyylval.sval = trim_quotes(yytext);
return STRING;
}

Expand All @@ -174,21 +123,39 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);}
":" {return token(':');}
";" {return token(';');}
[ \t\n]* ;
"\n" { return 0; }

%%

/* Allocate a copy of `quoted` with the double quote character at
* the beginning and the one at the end both removed. The caller is
* responsible for free()ing the copy.
*/
static char *
trim_quotes(const char *quoted)
{
size_t len = HDstrlen(quoted);
char *trimmed;

HDassert(quoted[0] == '"' && quoted[len - 1] == '"');

trimmed = HDstrdup(quoted + 1);
trimmed[len - 2] = '\0';

return trimmed;
}

int my_yyinput(char *buf, int max_size)
{
int ret;

memcpy(buf, myinput, input_len);
HDmemcpy(buf, myinput, input_len);
ret = (int)input_len;
return ret;
}

int H5LTyyerror(const char *msg)
{
printf("ERROR: %s before \"%s\".\n", msg, yytext);
HDprintf("ERROR: %s before \"%s\".\n", msg, yytext);
return 0;
}

Expand Down
Loading

0 comments on commit ddab4f2

Please sign in to comment.