Skip to content

Commit

Permalink
Removes alternative function enter/leave macro scheme (HDFGroup#678)
Browse files Browse the repository at this point in the history
* Committing clang-format changes

* Converted BEGIN_FUNC, etc. macros to FUNC_ENTER

* Rips out the BEGIN_FUNC, etc. macros

* Removes 'end if', etc. comments from H5HL package

* Committing clang-format changes

* Fixes an H5EA iterate issue

* Fixes an issue in the H5FA iterator code

* Further cleanup in bin/trace after macro removal

* Iterator changes in H5EA and H5FA

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
derobins and github-actions[bot] committed May 30, 2021
1 parent f4be95c commit b698d82
Show file tree
Hide file tree
Showing 33 changed files with 2,674 additions and 2,264 deletions.
31 changes: 9 additions & 22 deletions bin/trace
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,8 @@ my $file_api = 0;
my $file_args = 0;
my $total_api = 0;
my $total_args = 0;
sub rewrite_func ($$$$$$$$) {
my ($file, $begin, $type, $aftertype, $name, $args, $close, $body) = @_;
sub rewrite_func ($$$$$) {
my ($file, $type, $name, $args, $body) = @_;
my ($arg, $trace, $argtrace);
my (@arg_name, @arg_str, @arg_type);
local $_;
Expand Down Expand Up @@ -459,7 +459,7 @@ sub rewrite_func ($$$$$$$$) {
}

error:
return "\n$begin$type$aftertype$name($orig_args)$close$body";
return "\n$type\n$name($orig_args)\n$body";
}

##############################################################################
Expand All @@ -481,25 +481,12 @@ for $file (@ARGV) {
# Make a copy of the original data
my $original = $Source;

# Check which style of function declaration is used in this file
if ( $Source =~ /BEGIN_FUNC/ ) {
# Make modifications
$Source =~ s/\n(BEGIN_FUNC.*?\n) #begin
([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**) #type
(.*?\n) #aftertype
(H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
\s*\((.*?)\)\s* #args
(\)) #close
(\n.*?\nEND_FUNC\([^\n]*) #body
/rewrite_func($file,$1,$2,$4,$5,$6,$7,$8)/segx;
} else {
# Make modifications
$Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
(H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
\s*\((.*?)\)\s* #args
(\{.*?\n\}[^\n]*) #body
/rewrite_func($file,"",$1,"\n",$3,$4,"\n",$5)/segx;
}
# Make modifications
$Source =~ s/\n([A-Za-z]\w*(\s+[A-Za-z]\w*)*\s*\**)\n #type
(H5[A-Z]{0,2}_?[a-zA-Z0-9_]\w*) #name
\s*\((.*?)\)\s* #args
(\{.*?\n\}[^\n]*) #body
/rewrite_func($file,$1,$3,$4,$5)/segx;

# If the source changed then print out the new version
if ($original ne $Source) {
Expand Down
4 changes: 0 additions & 4 deletions src/H5.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,6 @@ hbool_t H5_PKG_INIT_VAR = FALSE;
/* Library Private Variables */
/*****************************/

/* HDF5 API Entered variable */
/* (move to H5.c when new FUNC_ENTER macros in actual use -QAK) */
hbool_t H5_api_entered_g = FALSE;

/* statically initialize block for pthread_once call used in initializing */
/* the first global mutex */
#ifdef H5_HAVE_THREADSAFE
Expand Down
Loading

0 comments on commit b698d82

Please sign in to comment.