summaryrefslogtreecommitdiffstats
path: root/bin/trace
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2021-08-17 19:55:18 (GMT)
committerGitHub <noreply@github.com>2021-08-17 19:55:18 (GMT)
commitc0ef1fd6de3ff20cc8fc49c05ca71254c784bea6 (patch)
treefb2bdf05e276e3614b3b5c343447cd82f4e6718b /bin/trace
parent2bca2ca6f1ef1b60bb8541413c5f2e68ff5549d3 (diff)
downloadhdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.zip
hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.gz
hdf5-c0ef1fd6de3ff20cc8fc49c05ca71254c784bea6.tar.bz2
Reverts PR 906 and 907 due to binary compatibility issues (#918)
Diffstat (limited to 'bin/trace')
-rwxr-xr-xbin/trace38
1 files changed, 6 insertions, 32 deletions
diff --git a/bin/trace b/bin/trace
index 80eaa5f..2b519e4 100755
--- a/bin/trace
+++ b/bin/trace
@@ -343,33 +343,10 @@ sub rewrite_func ($$$$$) {
# Compose the trace macro
$trace = "H5TRACE" . scalar(@arg_str) . "(\"$rettype\", \"";
$trace .= join("", @arg_str) . "\"";
- $argtrace .= join("", @arg_str) . "\"";
-
- # Add 4 for indenting the line
- my $len = 4 + length($trace);
-
- for my $i (0 .. $#arg_name) {
- # Handle wrapping
-
- # Be VERY careful here! clang-format and this script MUST agree
- # on which lines get wrapped or there will be churn as each tries
- # to undo the other's output.
- #
- # TWO cases must be handled:
- # 1) The argument is that last one and ');' will be appended
- # 2) The argument is NOT the last one and ',' will be appended
- #
- # NB: clang-format does NOT consider terminal newlines when
- # counting columns for the ColumnLimit
- #
- # The extra '2' added after $len includes the ', ' that would be
- # added BEFORE the argument.
- #
- my $adjust = ($i + 1 == scalar(@arg_str)) ? 2 : 1;
- my $len_if_added = $len + 2 + length($arg_name[$i]) + $adjust;
-
- # Wrap lines that will be longer than the limit
- if ($len_if_added > $max_trace_macro_line_len) {
+ my $len = 4 + length $trace; # Add 4, for indenting the line
+ for (@arg_name) {
+ # 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
@@ -385,11 +362,8 @@ sub rewrite_func ($$$$$) {
}
# Append argument
- $trace .= "$arg_name[$i]";
- $argtrace .= ", $arg_name[$i]";
-
- # Add length of appended argument name
- $len += length($arg_name[$i]);
+ $trace .= "$_";
+ $len += length; # Add length of appended argument name
}
# Append final ');' for macro