starpu_check_braces.sh 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. # StarPU --- Runtime system for heterogeneous multicore architectures.
  3. #
  4. # Copyright (C) 2016-2020 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
  5. #
  6. # StarPU is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU Lesser General Public License as published by
  8. # the Free Software Foundation; either version 2.1 of the License, or (at
  9. # your option) any later version.
  10. #
  11. # StarPU is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. #
  15. # See the GNU Lesser General Public License in COPYING.LGPL for more details.
  16. #
  17. SHOW=cat
  18. SHOW=less
  19. my_grep()
  20. {
  21. cat $2 | grep -v ".${3}:[0-9]*:[[:space:]]*${1}$" | grep -v printf | grep -v define | grep -v '\\' | grep -v '//' > /tmp/braces2
  22. if test -s /tmp/braces2
  23. then
  24. $SHOW /tmp/braces2
  25. fi
  26. }
  27. DIRS="tools src tests examples mpi"
  28. for d in ${1:-$DIRS}
  29. do
  30. for ext in c h cl cu doxy
  31. do
  32. grep -rsn "{" $d |grep ".${ext}:" | grep -v "}" > /tmp/braces
  33. my_grep "{" /tmp/braces $ext
  34. grep -rsn "}" $d |grep ".${ext}:" | grep -v "{" | grep -v "};" > /tmp/braces
  35. my_grep "}" /tmp/braces $ext
  36. done
  37. done