From aea00d0e58a51c9e79bf9fbc37ab179aacfc8731 Mon Sep 17 00:00:00 2001 From: Dana Robinson <43805+derobins@users.noreply.github.com> Date: Thu, 27 Jul 2023 09:14:32 -0700 Subject: Remove unused files (#3276) --- bin/README.md | 1 - bin/checkposix | 263 ------------------------------------------------------- src/.indent.pro | 150 ------------------------------- src/hdf5-lin.lnt | 21 ----- src/hdf5-win.lnt | 39 --------- src/hdf5.lnt | 85 ------------------ 6 files changed, 559 deletions(-) delete mode 100755 bin/checkposix delete mode 100644 src/.indent.pro delete mode 100644 src/hdf5-lin.lnt delete mode 100644 src/hdf5-win.lnt delete mode 100644 src/hdf5.lnt diff --git a/bin/README.md b/bin/README.md index 856f348..e2e2570 100644 --- a/bin/README.md +++ b/bin/README.md @@ -6,7 +6,6 @@ Programs run via `autogen.sh` (or the equivalent in CMake) are indicated. |-------|-------| |`buildhdf5`|Convenience script to build HDF5 using the Autotools| |`checkapi`|Checks if public API calls are used in internal functions| -|`checkposix`|Checks if C/POSIX calls are prefixed with `HD`| |`chkcopyright`|Checks if files have appropriate copyright statements| |`cmakehdf5`|Convenience script to build HDF5 using CMake| |`debug-ohdr`|Examines debug output from `H5O_open/close` to look for open objects| diff --git a/bin/checkposix b/bin/checkposix deleted file mode 100755 index bb6b81b..0000000 --- a/bin/checkposix +++ /dev/null @@ -1,263 +0,0 @@ -#!/usr/bin/env perl -require 5.003; -use warnings; - -# -# 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://www.hdfgroup.org/licenses. -# If you do not have access to either file, you may request a copy from -# help@hdfgroup.org. -# -# Dana Robinson -# Spring 2019 -# (Original by Robb Matzke) -# -# Purpose: Given the names of C source files this script will print the -# file name, line number, and function name of any function that -# doesn't begin with the letter 'h' or 'H' as stipulated by the -# HDF5 programming style guide. -# -# Emacs users can run this script as the compile command and -# use 'next-error' (usually bound to M-`) to find each name -# violation. - -use File::Basename; - -# Loop over all files passed to the function -foreach $arg (@ARGV) { - - # Get the filename from the path - $filename = fileparse($arg); - - # Skip files that don't include H5private.h - # H5system. has to be inspected by hand since it wraps POSIX files - # - # H5detect and H5make_libsettings are created before the library exists - # so calls that link to function replacements won't work. We'll ignore - # it here. - # - # If a user specifies one file, process it no matter what so people - # can inspect files we normally skip (like H5system.c). - - $ignore = 0; - - # Ignored files in src/ - if($#ARGV gt 0 and $filename =~ /H5FDmulti|H5FDstdio|H5VLpassthru|H5system|H5detect|H5make_libsettings/) { - $ignore = 1; - } - # Ignored atomic test files in test/ - if($#ARGV gt 0 and $filename =~ /atomic_reader|atomic_writer/) { - $ignore = 1; - } - # Ignored filter plugins in test/ - if($#ARGV gt 0 and $filename =~ /^filter_plugin\d_/) { - $ignore = 1; - } - # Ignored generators in test/ - if($#ARGV gt 0 and $filename =~ /^gen_/) { - $ignore = 1; - } - - if($ignore) { - print "$filename is exempt from using Standard library macro wrappers\n"; - next; - } - - # Open the file - open(my $fh, "<", $arg) or do { - warn "NOTE: Unable to open $arg: !$\n"; - next; - }; - - # Loop over all lines in the file to find undecorated functions - while (<$fh>) { - - # Get rid of comments by removing the inside part. - s|/\*.*?\*/||g; - if ($in_comment) { - if (/\*\//) { - s|.*?\*/||; - $in_comment = 0; - } else { - $_="\n"; - } - } elsif (m|/\*|) { - s|/\*.*||; - $in_comment = 1; - } - - # Get rid of string constants if they begin and end on this line. - s/([\'\"])([^\1]|\\\1)*?\1/$1$1/g; - - # Get rid of preprocessor directives - s/^\#.*//; - - # Skip callbacks invoked as methods in a struct - next if $_ =~ /\b(\)?]?->|\.)\(?([a-z_A-Z]\w*)\s*\(/; - - # Now find all function calls on this line which don't start with 'H' - while (($name)=/\b([a-z_A-GI-Z]\w*)\s*\(/) { - $_ = $'; - - # Ignore C statements that look sort of like function - # calls. - next if $name =~ /^(if|for|offsetof|return|sizeof|switch|while|void)$/; - - # Ignore things that get misdetected because of the simplified - # parsing that takes place here. - next if $name =~ /^(int|herr_t|_term_interface|_term_package)$/; - - # These are really HDF5 functions/macros even though they don't - # start with `h' or `H'. - next if $name =~ /^FUNC_(ENTER|LEAVE)(_(NO)?API|_PACKAGE|_STATIC)?(_NAMECHECK_ONLY|_NOFS|_NOCLEAR|_NOINIT|_NOPUSH)?(_NOFUNC|_TAG)?$/; - next if $name =~ /^(BEGIN|END)_FUNC$/; - next if $name =~ /^U?INT(8|16|32|64)(ENCODE|DECODE)(_VAR)?$/; - next if $name =~ /^CI_(PRINT_STATS|INC_SRC|INC_DST)$/; - next if $name =~ /^(ABS|ADDR_OVERFLOW|ALL_MEMBERS|BOUND|CONSTR|DETECT_[I|F|M]|DOWN)$/; - next if $name =~ /^(MIN3?|MAX3?|NELMTS|POWER_OF_TWO|REGION_OVERFLOW)$/; - next if $name =~ /^(SIZE_OVERFLOW|UNIQUE_MEMBERS|S_ISDIR)$/; - next if $name =~ /^addr_defined$/; - next if $name =~ /^TERMINATOR$/; - - # Ignore callback invocation - next if $name =~ /^(op|cb|OP|iter_op|func)$/; - - # Ignore main - next if $name =~ /^main$/; - - # This often appears in preprocessor lines that span multiple lines - next if $name =~ /^(defined)$/; - - # These are Windows system calls. Ignore them. - next if $name =~ /^(_get_osfhandle|GetFileInformationByHandle|SetFilePointer|GetLastError|SetEndOfFile)$/; - next if $name =~ /^(FindNextFile|FindClose|_tzset|Wgettimeofday|GetSystemTimeAsFileTime|GetUserName)$/; - next if $name =~ /^(DeleteCriticalSection|TlsFree|TlsGetValue|CreateThread)$/; - next if $name =~ /^(ExpandEnvironmentStringsA|LockFileEx|UnlockFileEx)$/; - next if $name =~ /^(DllMain|LocalAlloc|LocalFree)$/; - next if $name =~ /^(FindFirstFileA|FindNextFileA)$/; - next if $name =~ /^(_beginthread|(Initialize|Enter|Leave)CriticalSection|TlsAlloc)$/; - - # These are MPI function calls. Ignore them. - next if $name =~ /^(MPI_)/; - - # These are POSIX threads function calls. Ignore them. - next if $name =~ /^pthread_/; - - # These are zlib & szlib function calls. Ignore them. - next if $name =~ /^(inflate|SZ_)/; - next if $name =~ /^compress2$/; - - # These is an H5Dfill function. Ignore it in this file. - if($filename =~ /H5Dfill/) { - next if $name =~ /^(alloc_func)$/; - } - - # These are H5Zscaleoffset functions. Ignore them in this file. - if($filename =~ /H5Zscaleoffset/) { - next if $name =~ /^(pow_fun|round_fun|abs_fun|lround_fun|llround_fun)$/; - } - - # This is a macro parameter in H5Rint.c. Ignore it in this file. - if($filename =~ /H5Rint/) { - next if $name =~ /^(func)$/; - } - - # Internal calls in the HDFS VFD (H5FDhdfs.c). Ignore it in this file. - if($filename =~ /H5FDhdfs/) { - next if $name =~ /^(hdfs)/; - } - - # Macros, etc. from the mirror VFD (H5FDmirror.c). Ignore in this file. - if($filename =~ /H5FDmirror/) { - next if $name =~ /^(LOG)/; - next if $name =~ /^(BSWAP_64|is_host_little_endian)$/; - } - - # These are things in H5FDs3comms.c and H5FDros3.c. Ignore them in these files. - if($filename =~ /H5FDs3comms|H5FDros3/) { - next if $name =~ /^(curl_|curlwritecallback|gmnow)/; - next if $name =~ /^(ros3_|ROS3_|S3COMMS_)/; - next if $name =~ /^(EVP_sha256|SHA256|ISO8601NOW)$/; - } - - # TESTING (not comprehensive - just noise reduction) - - # Test macros and functions (testhdf5.h) - next if $name =~ /^(AddTest|TestErrPrintf|TestSummary|TestCleanup|TestShutdown)$/; - next if $name =~ /^(CHECK|CHECK_PTR|CHECK_PTR_NULL|CHECK_PTR_EQ|CHECK_I)$/; - next if $name =~ /^(VERIFY|VERIFY_STR|VERIFY_TYPE|MESSAGE|ERROR)$/; - - # Test macros and functions (h5test.h) - next if $name =~ /^(TESTING|PASSED|SKIPPED|PUTS_ERROR|FAIL_PUTS_ERROR|FAIL_STACK_ERROR|TEST_ERROR|AT)$/; - next if $name =~ /^(GetTestExpress)$/; - - # Ignore functions that start with test_ or check_ - next if $name =~ /^test_/; - next if $name =~ /^check_/; - - # Ignore functions that start with h5_ - next if $name =~ /^h5_/; - - # Ignore process completed status - next if $name =~ /(WIFEXITED|WEXITSTATUS|WIFSIGNALED|WTERMSIG|WCOREDUMP|WIFSTOPPED|WSTOPSIG)/; - - # Ignore usage functions - next if $name =~ /^usage$/; - - # Ignore callbacks - next if $name =~ /(_cb\d?)$/; - - # Specific tests (not even remotely comprehensive) - - # accum test code - if($filename =~ /accum/) { - next if $name =~ /^(accum_)/; - } - - # cache test code - if($filename =~ /cache/) { - next if $name =~ /(_entry|_entries|_cache|_check|_dependency|_status|_op)$/; - next if $name =~ /^(verify_|smoke_check_|row_major_|col_major_)/; - next if $name =~ /^(resize_configs_are_equal|CACHE_ERROR)$/ - } - - # Splitter VFD test code. Ignore in vfd.c. - if($filename =~ /vfd/) { - next if $name =~ /^(SPLITTER_|splitter_)/; - next if $name =~ /(_splitter_)/; - next if $name =~ /^(file_exists)$/; - } - - # S3 VFD test code. Ignore in ros3.c and s3comms.c. - # HDFS VFD test code. Ignore in hdfs.c. - if($filename =~ /ros3|s3comms|hdfs/) { - next if $name =~ /^(JSVERIFY|JSFAILED_|JSERR_|jserr_|FAIL_)/; - next if $name =~ /^(curl_)/; - next if $name =~ /^(S3COMMS_FORMAT_CREDENTIAL|ISO8601NOW|gmnow)$/; - } - - # VDS test code. Ignore in vds.c. - if($filename =~ /vds/) { - next if $name =~ /^(vds_)/; - } - - print "$filename:$.: $name\n"; - } - - } - - # Close the file - close($fh); -} - -if($#ARGV gt 0) { - print "\n"; - print "NOTE:\n"; - print "If any files were skipped due to being exempt, you can inspect them manually\n"; - print "by using this script on them one at a time, which will always process the file.\n"; -} diff --git a/src/.indent.pro b/src/.indent.pro deleted file mode 100644 index fa375f0..0000000 --- a/src/.indent.pro +++ /dev/null @@ -1,150 +0,0 @@ --bad /* Blank line after declarations */ --bap /* Blank line after procedure */ --bbb /* No blank line before boxed comments */ --bbo /* Try to break long lines at boolean operators && and || */ --nbc /* Don't force newlines after commas in declarations */ --br /* Put braces on the same line as the statement (not -bl) */ --brs /* Put braces on the same line as the struct declaration (not -bls) */ --nbs /* Don't put a space between a sizeof operator and it's object */ --c33 /* Start comments after code in column 33 */ --cbi0 /* Indent braces below a case statement 0 spaces to right of case statement */ --cd33 /* Start comments after declarations in column 33 */ --ncdb /* Don't put comment delimiters on their own lines */ --cdw /* "Cuddle" while statements onto the same line as the closing do statement's brace */ --nce /* Don't "Cuddle" else statements onto the same line as the closing if statement's brace */ --ci8 /* Align continued code 8 spaces from initial indention */ --cli4 /* Indent case statements 4 spaces to right of switch statement */ --cp0 /* Start comments after pre-processor directives immediately after the directive */ --ncs /* Don't put a space between a cast operator and it's object */ --d0 /* Align comments on their own line with the surrounding code */ --nbfda /* Don't force newlines after commas in function argument declarations */ --di24 /* Align identifiers in declarations in column 24 */ --nfc1 /* Don't format comments in the first column */ --nfca /* Don't format comments on their own line */ --hnl /* Honor existing new-lines in long boolean statements */ --i4 /* Indent space spaces */ --ip8 /* Don't add any extra indention for nested parentheses */ --l78 /* Try to break long lines in column 78 */ --lc78 /* Try to break long comment lines in column 78 */ --nlp /* Don't align lines continued onto further lines with the opening parentheses */ --lps /* Leave spaces in preprocessor directives alone */ --npcs /* Don't put a space between the procedure name and it's parameters */ --npcs /* Don't put a space between the procedure name and it's parameters */ --pi4 /* Extra indentation per open parentheses */ --pmt /* Preserve modification times on modified files */ --nprs /* Don't add spaces around parentheses */ --psl /* Force the return type of a procedure to be on it's own line */ --nsaf /* Don't put a space between a for statement and it's initial parentheses */ --nsai /* Don't put a space between an if statement and it's initial parentheses */ --nsaw /* Don't put a space between a while statement and it's initial parentheses */ --sbi0 /* Indent braces after a struct, union or enum 0 spaces */ --sc /* Put stars at the beginning of multi-line comments */ --nsob /* Don't swallow optional blank lines */ --ss /* Put a space before the semicolon if its the only statement in a for or while loop */ --ts8 /* Hard tab characters are 8 spaces */ -/* The rest are typedefs used by the library, feel free to add missing ones, */ -/* but try to keep them alphabetized */ --T H5AC_class_t --T H5AC_prot_t --T H5AC_slot_t --T H5AC_subid_t --T H5AC_t --T H5A_t --T H5Asearch_func_t --T H5B_class_t --T H5B_ins_t --T H5B_key_t --T H5B_subid_t --T H5B_t --T H5C_class_t --T H5C_t --T H5D_create_t --T H5D_layout_t --T H5D_t --T H5E_error_t --T H5E_major_mesg_t --T H5E_major_t --T H5E_minor_mesg_t --T H5E_minor_t --T H5E_t --T H5F_create_t --T H5F_shared_t --T H5F_isop_t --T H5F_istore_key_t --T H5F_istore_ud1_t --T H5F_low_class_t --T H5F_low_t --T H5F_search_t --T H5F_t --T H5Fget_create_t --T H5G_bt_ud1_t --T H5G_bt_ud2_t --T H5G_cache_t --T H5G_cwgstk_t --T H5G_entry_t --T H5G_node_key_t --T H5G_node_t --T H5G_t --T H5G_type_t --T H5H_free_t --T H5H_t --T H5H_type_t --T H5M_find_t --T H5O_chunk_t --T H5O_class_t --T H5O_cont_t --T H5O_efl_t --T H5O_layout_t --T H5O_mesg_t --T H5O_name_t --T H5O_stab_t --T H5O_t --T H5P_class_t --T H5P_simple_t --T H5P_t --T H5T_class_t --T H5T_conv_t --T H5T_cset_t --T H5T_member_t --T H5T_norm_t --T H5T_order_t --T H5T_pad_t --T H5T_path_t --T H5T_sign_t --T H5T_soft_t --T H5T_str_t --T H5T_t --T H5Tget_member_t --T H5_exit_t --T H5_init_t --T H5_t --T H5_term_t --T access_t --T atom_group_t --T atom_info_t --T cache_t --T child_t --T chunk_t --T create_t --T data_t --T detected_t --T group_t --T haddr_t --T hbool_t --T heap_t --T herr_t --T hid_t --T hobjtype_t --T hsize_t --T hssize_t --T ino_t --T mem_t --T memb_t --T mesg_t --T message_t --T meta_func_t --T new_t --T off_t --T size_t --T ssize_t --T time_t diff --git a/src/hdf5-lin.lnt b/src/hdf5-lin.lnt deleted file mode 100644 index 23ceed2..0000000 --- a/src/hdf5-lin.lnt +++ /dev/null @@ -1,21 +0,0 @@ -// Define the __func__ macro so we don't get warnings about using it. --d__func__="NoFunctionName" - -// Needed for gcc assert() macro --function(exit,__assert_fail) - -// Needed to allow 'long long' with gcc -+fll - -// Suppress message about "Constant value boolean" in assert macros --emacro(506,assert) - -// Turn off warnings about not using the return value from these functions: --emacro(534,HDfflush,HDgetrusage,HDgettimeofday,HDputc) - -// Suppress message about "Expression with side effects passed to repeated parameter 1 in macro 'assert'" --esym(666,assert) - -// Include shared lint options file -hdf5.lnt - diff --git a/src/hdf5-win.lnt b/src/hdf5-win.lnt deleted file mode 100644 index 350b603..0000000 --- a/src/hdf5-win.lnt +++ /dev/null @@ -1,39 +0,0 @@ -// Define the __FUNCTION__ so we don't get warnings about using it. --d__FUNCTION__="NoFunctionName" - -// Turn off warnings about "Ignoring return value of function" for -// H5open() in public error macros --emacro(534, H5Epush_ret, H5Epush_goto) - -// Suppress message about "Suspicious cast" in FUNC_ENTER* macros --emacro(611,FUNC_ENTER_API,FUNC_ENTER_NOAPI) - -// Suppress message about "Boolean within 'if' always evaluates false" in FUNC_ENTER* macros --emacro(774,FUNC_ENTER_API,FUNC_ENTER_NOAPI) - -// Suppress message about "Static variable found within inline function" in FUNC_ENTER* macros --emacro(1534,FUNC_ENTER_NOINIT) - -// Suppress message about "Shift right of signed quantity" in H5I_GRP macro --emacro(702,H5I_GRP) - -// Suppress message about "Constant expression evaluates to 0 in expression" in H5FL_ARR* macros --emacro(778,H5FL_ARR_DEFINE_COMMON) - -// Suppress message about "Union initialization" in H5FL_ARR* macros --emacro(708,H5FL_ARR_DEFINE_COMMON) - -// Suppress message about "enum constant not used within defaulted switch" --e788 - -// Indicate functions that are like printf() --printf(2,HDfprintf) - -// Tell lint about additional printf() format codes that HDfprintf understands --printf_code(a,haddr_t) --printf_code(Hu,hsize_t) --printf_code(Hd,hssize_t) --printf_code(Zu,size_t) --printf_code(Zd,ssize_t) - - diff --git a/src/hdf5.lnt b/src/hdf5.lnt deleted file mode 100644 index 7b0f384..0000000 --- a/src/hdf5.lnt +++ /dev/null @@ -1,85 +0,0 @@ -// Lint options shared by both PC-Lint for Windows and Flexelint for Linux - -// Turn off warnings about not using the inlined H5V* functions: --esym(528, H5VM_vector_reduce_product, H5VM_vector_inc) --esym(528, H5VM_vector_cmp_s) --esym(528, H5VM_vector_zerop_s, H5VM_vector_zerop_u) - -// Suppress message about using 'goto' in a few functions --efunc(801,H5_term_library,H5_trace) - -// Suppress message about "boolean test of a paranthesized assignment" --efunc(820,H5_term_library) - -// Suppress message about "Constant value boolean" in FUNC_ENTER* macros --emacro(506,FUNC_ENTER_API,FUNC_ENTER_API_NOCLEAR, FUNC_ENTER_NOAPI) - -// Suppress message about "Constant value boolean" in TRUE macros --emacro(506,TRUE) - -// Suppress message about our use of 'goto' in our error macros --emacro(801,HGOTO_DONE, H5Epush_goto) - -// Turn off warnings about not using the return value from these functions: --esym(534, HDfprintf, HDsnprintf, HDvsnprintf) --esym(534, H5E_clear_stack, H5E_push_stack) --esym(534, H5FL_arr_free, H5FL_blk_free, H5FL_reg_free, H5FL_seq_free) --esym(534, H5CS_push, H5CS_pop) --esym(534, H5I_clear_type, H5I_dec_type_ref) --esym(534, H5MM_xfree) --esym(534, H5UC_decr) --esym(534, H5VM_array_fill) - -/* So far, the following files have been linted with these options: - H5.c - H5A.c - H5AC.c - H5B.c - - H5D.c - H5Dcompact.c - H5Dcontig.c - H5Defl.c - H5Dio.c - H5Distore.c - H5E.c - H5F.c - H5FD.c - H5FDcore.c - H5FDfamily.c - H5FDlog.c - H5FDmulti.c - H5FDsec2.c - H5FDstdio.c - H5FL.c - H5FO.c - - H5Tcommit.c - H5Tcompound.c - - H5Tcset.c - H5Tenum.c - H5Tfields.c - H5Tfixed.c - H5Tfloat.c - H5Tnative.c - H5Toffset.c - H5Topaque.c - H5Torder.c - H5Tpad.c - H5Tprecis.c - H5Tstrpad.c - H5Tvlen.c - H5V.c - H5Z.c - H5Zdeflate.c - H5Zfletcher32.c - H5Zshuffle.c - H5Zszip.c - - The following files have had their FUNC_ENTER, FUNC_LEAVE & HGOTO* - macros cleaned up, but have not been linted - due to their dependencies on features that we don't support on Windows: - H5FDmpio.c - H5FDstream.c -*/ -- cgit v0.12