File: replace_itkStaticConstMacro.sh

package info (click to toggle)
insighttoolkit5 5.4.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 704,404 kB
  • sloc: cpp: 783,697; ansic: 628,724; xml: 44,704; fortran: 34,250; python: 22,874; sh: 4,078; pascal: 2,636; lisp: 2,158; makefile: 461; yacc: 328; asm: 205; perl: 203; lex: 146; tcl: 132; javascript: 98; csh: 81
file content (22 lines) | stat: -rwxr-xr-x 753 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

for ff in $( git grep -l "itkStaticConstMacro.*;" |fgrep -v ThirdParty |fgrep -v ITKv5Preparation |fgrep -v itkMacro.h); do
  cat $ff | \
  sed -e 's/itkStaticConstMacro *( *\([^ ,]*\)[ ,]*\([^,]*\)[ ,]*\([^)]*\)) *;/static constexpr \2 \1 = \3;/g' > /tmp/temp_file
  mv  /tmp/temp_file $ff
done

for ff in $( git grep -l "static *constexpr.*;" |fgrep -v ThirdParty |fgrep -v ITKv5Preparation |fgrep -v itkMacro.h); do
  cat $ff | \
  sed -e 's/static *constexpr *\(.*\)  *;/static constexpr \1;/g' > /tmp/temp_file
  mv  /tmp/temp_file $ff
done

cat > /tmp/cmt_msg << EOF
STYLE: Replace itkStaticConstMacro with static constexpr

Use static constexpr directly now that C++11 conformance
is required by all compilers.
EOF

cat /tmp/cmt_msg