Skip to content

Commit

Permalink
Merge from develop
Browse files Browse the repository at this point in the history
github workflow files
parser files
bin scripts
doc corrections
  • Loading branch information
byrnHDF committed Oct 7, 2020
1 parent 2744238 commit ca32c78
Show file tree
Hide file tree
Showing 21 changed files with 3,735 additions and 3,816 deletions.
5 changes: 4 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ BraceWrapping:
BreakBeforeBraces: Stroustrup
BreakAfterJavaFieldAnnotations: true
BreakStringLiterals: true
ColumnLimit: 110
ColumnLimit: 110 # Update $max_trace_macro_line_len in bin/trace also
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 3
Expand All @@ -33,6 +33,8 @@ IncludeIsMainRegex: '(public)?$'
IndentCaseLabels: true
IndentGotoLabels: false
IndentWidth: 4
MacroBlockBegin: "^BEGIN_FUNC"
MacroBlockEnd: "^END_FUNC"
ObjCBlockIndentWidth: 4
ReflowComments: true
SortIncludes: false
Expand All @@ -58,5 +60,6 @@ StatementMacros:
- HMPI_GOTO_ERROR
- H5_GCC_DIAG_OFF
- H5_GCC_DIAG_ON
- CATCH
...

28 changes: 14 additions & 14 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@
# Order is important. The last matching pattern has the most precedence.
# So if a pull request only touches javascript files, only these owners
# will be requested to review.
*.cmake @byrnHDF
CMakeLists.txt @byrnHDF
CMakeTests.* @byrnHDF
*.cmake @byrnHDF @derobins
CMakeLists.txt @byrnHDF @derobins
CMakeTests.* @byrnHDF @derobins

/bin/ @lrknox @derobins @byrnHDF
/bin/ @lrknox @derobins @qkoziol

/c++/ bmribler@hdfgroup.org
/c++/ @bmribler @byrnHDF

/config/ @lrknox @derobins @byrnHDF
/config/ @lrknox @derobins @qkoziol @byrnHDF

/doc/ @gnuoyd mainzer@hdfgroup.org
/doc/ @gnuoyd @jrmainzer

/examples/ @lrknox @derobins bljones@hdfgroup.org
/examples/ @lrknox @derobins @bljhdf

/fortran/ @brtnfld @epourmal

/hl/ bmribler@hdfgroup.org
/hl/ @bmribler @byrnHDF

/java/ @jhendersonHDF @byrnHDF

/m4/ @lrknox @derobins

/release_docs/ @lrknox bljones@hdfgroup.org @byrnHDF
/release_docs/ @lrknox @bljhdf @byrnHDF

/src/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup mainzer@hdfgroup.org
/src/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer

/test/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup mainzer@hdfgroup.org
/test/ @jhendersonHDF @derobins @fortnern @qkoziol @soumagne @vchoi-hdfgroup @jrmainzer

/testpar/ @jhendersonHDF @rawarren mainzer@hdfgroup.org
/testpar/ @jhendersonHDF @rawarren @jrmainzer @qkoziol

/tools/ @byrnHDF
/tools/ @byrnHDF @bmribler

/utils/ @lrknox @byrnHDF
6 changes: 3 additions & 3 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run clang-format style check for C programs.
uses: DoozyX/clang-format-lint-action@v0.8
uses: DoozyX/clang-format-lint-action@v0.10
with:
source: '.'
extensions: 'c,h,cpp'
extensions: 'c,h,cpp,hpp'
clangFormatVersion: 10
style: file
exclude: './config ./hl/src/H5LTanalyze.c'
exclude: './config ./hl/src/H5LTanalyze.c ./hl/src/H5LTparse.c ./hl/src/H5LTparse.h ./src/H5Epubgen.h ./src/H5Einit.h ./src/H5Eterm.h ./src/H5Edefin.h ./src/H5version.h ./src/H5overflow.h'
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
# Set these env vars so cmake picks the correct compiler
echo "::set-env name=CXX::cl.exe"
echo "::set-env name=CC::cl.exe"
echo "CXX=cl.exe" >> $GITHUB_ENV
echo "CC=cl.exe" >> $GITHUB_ENV
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ jobs:
if: matrix.os == 'windows-latest'
run: |
# Set these env vars so cmake picks the correct compiler
echo "::set-env name=CXX::cl.exe"
echo "::set-env name=CC::cl.exe"
echo "CXX=cl.exe" >> $GITHUB_ENV
echo "CC=cl.exe" >> $GITHUB_ENV
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Get Sources
Expand Down
6 changes: 0 additions & 6 deletions COPYING
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,4 @@ and/or accompanying materials:

-----------------------------------------------------------------------------

HDF5 is available with the SZIP compression library but SZIP is not part
of HDF5 and has separate copyright and license terms. See SZIP Compression
in HDF Products (www.hdfgroup.org/doc_resource/SZIP/) for further details.

-----------------------------------------------------------------------------


1 change: 0 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -3452,7 +3452,6 @@
./config/cmake/HDFCompilerFlags.cmake
./config/cmake/HDFCXXCompilerFlags.cmake
./config/cmake/HDFFortranCompilerFlags.cmake
./config/cmake/HDF5_Process_Flex_Files.cmake
./config/cmake/HDF5Macros.cmake
./config/cmake/HDF5UseFortran.cmake
./config/cmake/jrunTest.cmake
Expand Down
2 changes: 1 addition & 1 deletion bin/errors
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use Text::Tabs;
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
# Robb Matzke, matzke@llnl.gov
# Robb Matzke
# 30 Aug 1997
#
# Purpose: This script will read standard input which should be a
Expand Down
24 changes: 22 additions & 2 deletions bin/format_source
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#!/bin/bash
#
# Recursively format all C & C++ sources and header files, except those in the
# 'config' directory and generated files, such as H5LTanalyze.c, etc.
#
# Note that any files or directories that are excluded here should also be
# added to the 'exclude' list in .github/workflows/clang-format-check.yml
#
# (Remember to update both bin/format_source and bin/format_source_patch)

find . -type d \( -path ./config \) -prune \
-o -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp \
-or \( \( \! \( \
-name H5LTanalyze.c \
-or -name H5LTparse.c \
-or -name H5LTparse.h \
-or -name H5Epubgen.h \
-or -name H5Einit.h \
-or -name H5Eterm.h \
-or -name H5Edefin.h \
-or -name H5version.h \
-or -name H5overflow.h \
\) \) \
-and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp \) \) \
| xargs clang-format -style=file -i -fallback-style=none

exit 0
exit 0
24 changes: 22 additions & 2 deletions bin/format_source_patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#!/bin/bash
#
# Recursively format all C & C++ sources and header files, except those in the
# 'config' directory and generated files, such as H5LTanalyze.c, etc.
#
# Note that any files or directories that are excluded here should also be
# added to the 'exclude' list in .github/workflows/clang-format-check.yml
#
# (Remember to update both bin/format_source and bin/format_source_patch)

find . -type d \( -path ./config \) -prune \
-o -iname *.h -o -iname *.c -o -iname *.cpp -o -iname *.hpp \
-or \( \( \! \( \
-name H5LTanalyze.c \
-or -name H5LTparse.c \
-or -name H5LTparse.h \
-or -name H5Epubgen.h \
-or -name H5Einit.h \
-or -name H5Eterm.h \
-or -name H5Edefin.h \
-or -name H5version.h \
-or -name H5overflow.h \
\) \) \
-and \( -iname *.h -or -iname *.c -or -iname *.cpp -or -iname *.hpp \) \) \
| xargs clang-format -style=file -i -fallback-style=none

git diff > clang_format.patch
Expand All @@ -11,4 +31,4 @@ then
rm clang_format.patch
fi

exit 0
exit 0
29 changes: 19 additions & 10 deletions bin/genparser
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#! /bin/bash
#
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# Copyright by The HDF Group.
# All rights reserved.
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
# If you do not have access to either file, you may request a copy from
Expand Down Expand Up @@ -200,25 +200,29 @@ if [ "$verbose" = true ] ; then
fi
${HDF5_FLEX} --nounistd -PH5LTyy -o ${path_to_hl_src}/H5LTanalyze.c ${path_to_hl_src}/H5LTanalyze.l

# fix H5LTparse.c to declare H5LTyyparse return type as an hid_t
# instead of int. Currently the generated function H5LTyyparse is
# fix H5LTparse.c and H5LTlparse.h to declare H5LTyyparse return type as an
# hid_t instead of int. Currently the generated function H5LTyyparse is
# generated with a return value of type int, which is a mapping to the
# flex yyparse function. The return value in the HL library should be
# an hid_t.
# I propose to not use flex to generate this function, but for now I am
# an hid_t.
# I propose to not use flex to generate this function, but for now I am
# adding a perl command to find and replace this function declaration in
# H5LTparse.c.
perl -0777 -pi -e 's/int yyparse/hid_t yyparse/igs' ${path_to_hl_src}/H5LTparse.c
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' ${path_to_hl_src}/H5LTparse.c
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5LTparse.c
perl -0777 -pi -e 's/int yyparse/hid_t yyparse/igs' ${path_to_hl_src}/H5LTparse.h
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' ${path_to_hl_src}/H5LTparse.h
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' ${path_to_hl_src}/H5LTparse.h

# Add code that disables warnings in the flex/bison-generated code.
#
# Note that the GCC pragmas did not exist until gcc 4.2. Earlier versions
# will simply ignore them, but we want to avoid those warnings.
for f in ${path_to_hl_src}/H5LTparse.c ${path_to_hl_src}/H5LTanalyze.c
do
echo '#if defined __GNUC__ && 402 <= __GNUC__ * 100 + __GNUC_MINOR__ ' >> tmp.out
echo '#if defined (__GNUC__) ' >> tmp.out
echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 402 ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wconversion" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wimplicit-function-declaration" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wlarger-than=" ' >> tmp.out
Expand All @@ -230,11 +234,16 @@ do
echo '#pragma GCC diagnostic ignored "-Wsign-conversion" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wstrict-overflow" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wstrict-prototypes" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=const" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wsuggest-attribute=pure" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wswitch-default" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wunused-function" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wunused-macros" ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wunused-parameter" ' >> tmp.out
echo '#endif ' >> tmp.out
echo '#if ((__GNUC__ * 100) + __GNUC_MINOR__) >= 600 ' >> tmp.out
echo '#pragma GCC diagnostic ignored "-Wnull-dereference" ' >> tmp.out
echo '#endif ' >> tmp.out
echo '#elif defined __SUNPRO_CC ' >> tmp.out
echo '#pragma disable_warn ' >> tmp.out
echo '#elif defined _MSC_VER ' >> tmp.out
Expand Down
2 changes: 1 addition & 1 deletion bin/h5vers
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use strict;
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
#
# Robb Matzke <matzke@llnl.gov>
# Robb Matzke
# 17 July 1998

### Purpose
Expand Down
38 changes: 31 additions & 7 deletions bin/trace
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ $Source = "";
"ssize_t" => "Zs",
);


##############################################################################
# Maximum length of H5TRACE macro line
# If the ColumnLimit in .clang-format is changed, this value will need to be updated
#
my $max_trace_macro_line_len = 110;


##############################################################################
# Print an error message.
#
Expand Down Expand Up @@ -287,7 +295,7 @@ sub rewrite_func ($$$$$) {

# Parse arguments
if ($args eq "void") {
$trace = "H5TRACE0(\"$rettype\",\"\");\n";
$trace = "H5TRACE0(\"$rettype\", \"\");\n";
} else {
# Split arguments. First convert `/*in,out*/' to get rid of the
# comma, then split the arguments on commas.
Expand Down Expand Up @@ -331,18 +339,34 @@ sub rewrite_func ($$$$$) {
}
}
}

# Compose the trace macro
$trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \"";
$trace .= join("", @arg_str) . "\"";
my $len = 4 + length $trace;
my $len = 4 + length $trace; # Add 4, for indenting the line
for (@arg_name) {
if ($len + length >= 77) {
$trace .= ",\n $_";
$len = 13 + length;
# Wrap lines that will be longer than the limit, after ');' is added
if ($len + length >= ($max_trace_macro_line_len - 2)) {
# Wrap line, with indention
$trace .= ",\n ";
$len = 13; # Set to 13, for indention

# Indent an extra space to account for extra digit in 'H5TRACE' macro
if (scalar(@arg_str) >= 10) {
$trace .= " ";
$len++;
}
} else {
$trace .= ", $_";
$len += 1 + length;
$trace .= ", ";
$len += 2; # Add 2, for ', '
}

# Append argument
$trace .= "$_";
$len += length; # Add length of appended argument name
}

# Append final ');' for macro
$trace .= ");\n";
}
goto error if grep {/!/} @arg_str;
Expand Down
2 changes: 1 addition & 1 deletion bin/warnhist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use warnings;
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
#
# Quincey Koziol, koziol@hdfgroup.org
# Quincey Koziol
# 9 Aug 2013
#
# Purpose: Given an input file containing the output from a build of the
Expand Down
Loading

0 comments on commit ca32c78

Please sign in to comment.