1. 03 May, 2019 1 commit
  2. 08 Mar, 2019 1 commit
  3. 14 Jan, 2019 1 commit
  4. 18 Jul, 2018 1 commit
    • Victor Poughon's avatar
      COMP: add missing string includes · fc923078
      Victor Poughon authored
      Before this commit, many files are using std::string without including
      <string>. It can work accidentally but causes issues when refactoring,
      especially if using operator <<() which is included implicitly by some
      compilers.
      
      To find guilty header files, I used:
      
          grep -l "^ *std::string" $(grep -L "#include <string>" $(find . -type f -name "*.h"))
      
      which finds all files containing "std::string" at the beginning of a line
      (usually a member or variable declaration), but not "#include <string>".
      And then this script to add the includes (plus some manual ediing):
      
          #!/usr/bin/env python3
      
          import re
          import argparse
      
          def fix_file(filename, header):
      
              with open(filename, "r") as f:
                  content = f.read()
      
              matches = list(re.finditer(r"(#include .*\n)\n", content))
              if len(matches) == 0:
                  print("no include!")
                  sys.exit(-1)
      
              pos = matches[-1].end(1)
              open(filename, "w").write(content[:pos] + "#include <{}>\n".format(header) + content[pos:])
      
          if __name__ == "__main__":
              parser = argparse.ArgumentParser()
              parser.add_argument('--header', type=str, required=True)
              parser.add_argument('files', type=str, nargs='+')
              args = parser.parse_args()
      
              for filename in args.files:
                  fix_file(filename, args.header)
      fc923078
  5. 20 Jun, 2018 2 commits
  6. 07 Jun, 2018 1 commit
  7. 12 Mar, 2018 1 commit
  8. 27 Jun, 2017 1 commit
  9. 19 Jun, 2017 1 commit
  10. 18 May, 2017 1 commit
  11. 05 Apr, 2017 1 commit
  12. 08 Mar, 2017 2 commits
  13. 15 Sep, 2016 1 commit
  14. 13 Jun, 2016 1 commit
    • Manuel Grizonnet's avatar
      ENH: Remove double underscore in header guards (.txx & __otb*_h form) · 82842d15
      Manuel Grizonnet authored
      Used the following command:
      
      find . \( -iname *.txx -and ! -path *ThirdParty* \) -exec perl -pi -w -e 's/__otb(.*)_txx/otb$1_txx/g;' {} \;
      find . \( -iname *.h -and ! -path *ThirdParty* \) -exec perl -pi -w -e 's/__otb(.*)_h/otb$1_h/g;' {} \;
      
      Fixes many, but not all, clang -Wreserved-id-macro warnings.
      82842d15
  15. 10 Jun, 2016 1 commit
    • Manuel Grizonnet's avatar
      ENH: Explicitly recognize virtual functions · 3de2b346
      Manuel Grizonnet authored
          clang-tidy tool can insert missing override keyword as a macro so that missing [optional] virtual identifiers can be easily added.
      
          build otb with clang 3.8 and use cmake option CMAKE_EXPORT_COMPILE_COMMANDS=ON. Most modules and third parties have been activated.
      
          #Save override occurences in otb code
          cd src/Modules ; grep -nR "override" * > ~/temporary/override_otb.txt
      
          #Run clang modernize check using utility script which allow to process the code in parallel
          python run-clang-tidy.py -clang-tidy-binary ~/software/clang+llvm-3.8.0-x86_64-linux-gnu-ubuntu-14.04/bin/clang-tidy -checks=-*,modernize-use-override -header-filter=/home/grizonnetm/projets/otb/src/OTB/Modules/.*/.*/include/.* -j8 -fix -p ~/projets/otb/bin/release/OTB-clang3.8/ ~/projets/otb/src/OTB/Modules/*/*/src/*.cxx ~/projets/otb/src/OTB/Examples/*/*.cxx ~/projets/otb/src/OTB/Modules/*/*/test/*.cxx > ~/temporary/run-clang-tidy-log.txt
      
          #Replace override by ITK macro (to maintain compat with c++98)
          find . -type f -print -name "*.h" -o -name "*.txx" |xargs perl -pi -e 's/\ override/\ ITK_OVERRIDE/g'
      3de2b346
  16. 27 Feb, 2015 1 commit
  17. 18 Feb, 2015 2 commits