Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STYLE: removed double semicolon on files I could #5135

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Modules/Core/Common/src/itkBuildInformation.cxx.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ BuildInformation::GetValue(const MapKeyType & key)
{
return it->second.m_Value;
}
return {};;
return {};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a C++ file, the changes here should be kept.

}

const BuildInformation::MapValueDescriptionType
Expand All @@ -100,7 +100,7 @@ BuildInformation::GetDescription(const MapKeyType & key)
{
return it->second.m_Description;
}
return {};;
return {};
}

const std::vector< BuildInformation::MapKeyType >
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ __kernel void ComputeUpdate(__global const INPIXELTYPE *in, __global BUFPIXELTYP

// centralized derivatives, half directonal derivatives
float dx[3], dx_f, dx_b, delta, Cx, Cxd;
unsigned int tidx, tx, ty, tz;;
unsigned int tidx, tx, ty, tz;
sananthanarayan marked this conversation as resolved.
Show resolved Hide resolved

// shared memory
__local float sm[BLOCK_SIZE+2][BLOCK_SIZE+2][BLOCK_SIZE+2];
Expand Down
60 changes: 30 additions & 30 deletions Modules/ThirdParty/HDF5/src/itkhdf5/c++/src/h5c++.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ fi
case "$CXX" in
gcc)
kind="gcc"
;;
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a shell script. As such, double semicolon has a special meaning, see e.g. https://stackoverflow.com/questions/16905183/dash-double-semicolon-syntax

So are most of the other files in this change list.

mpicc|mpcc|mpicc_r)
# Is this gcc masquarading as an MPI compiler?
if test "`${CXX} -v 2>&1 | sed -n 2p | cut -c1-3`" = "gcc"; then
Expand All @@ -181,10 +181,10 @@ case "$CXX" in
# Nope
kind="$host_os"
fi
;;
;
*)
kind="$host_os"
;;
;
esac

for arg in $@ ; do
Expand All @@ -205,7 +205,7 @@ for arg in $@ ; do

do_link="no"
dash_c="-c"
;;
;
-o)
if test "x$dash_c" = "x-c"; then
compile_args="$compile_args $arg"
Expand All @@ -214,45 +214,45 @@ for arg in $@ ; do
do_link="yes"
get_output_file="yes"
fi
;;
;
-E|-M|-MT)
compile_args="$compile_args $arg"
dash_c="-c"
do_link="no"
;;
;
-l*)
libraries=" $libraries $arg "
;;
;
-prefix=*)
prefix="`expr "$arg" : '-prefix=\(.*\)'`"
;;
;
-echo)
set -x
;;
;
-show)
SHOW="echo"
;;
;
-showconfig)
showconfigure
exit $status
;;
;
-shlib)
USE_SHARED_LIB="yes"
;;
;
-noshlib)
USE_SHARED_LIB="no"
;;
;
-help)
usage
;;
;
*\"*)
qarg="'"$arg"'"
qargs="$qargs $qarg"
;;
;
*\'*)
qarg='"'"$arg"'"'
qargs="$qargs $qarg"
;;
;
*)
if [ -s "$arg" ] ; then
ext=`expr "$arg" : '.*\(\..*\)'`
Expand Down Expand Up @@ -280,7 +280,7 @@ for arg in $@ ; do
compile_args="$compile_args $arg"
link_args="$link_args $arg"
fi
;;
;
esac
done
link_args="$link_args $qargs"
Expand Down Expand Up @@ -312,15 +312,15 @@ if test "x$do_link" = "xyes"; then
# MacOS X doesn't support the "-Wl,-rpath -Wl," style of linker flags.
# It appears to want none of them specified.
case "$host_os" in
darwin*) flag="" ;;
*) flag="-Wl,-rpath -Wl," ;;
darwin*) flag="" ;
*) flag="-Wl,-rpath -Wl," ;
esac
;;
hpux*) flag="-Wl,+b -Wl," ;;
freebsd*|solaris*) flag="-R" ;;
rs6000*|aix*) flag="-L" ;;
sgi) flag="-rpath " ;;
*) flag="" ;;
;
hpux*) flag="-Wl,+b -Wl," ;
freebsd*|solaris*) flag="-R" ;
rs6000*|aix*) flag="-L" ;
sgi) flag="-rpath " ;
*) flag="" ;
esac

if test -n "$flag"; then
Expand All @@ -334,19 +334,19 @@ if test "x$do_link" = "xyes"; then
case "$lib" in
-lhdf5)
new_libraries="$new_libraries ${libdir}/libhdf5.a"
;;
;
-lhdf5_hl)
new_libraries="$new_libraries ${libdir}/libhdf5_hl.a"
;;
;
-lhdf5_cpp)
new_libraries="$new_libraries ${libdir}/libhdf5_cpp.a"
;;
;
-lhdf5_hl_cpp)
new_libraries="$new_libraries ${libdir}/libhdf5_hl_cpp.a"
;;
;
*)
new_libraries="$new_libraries $lib"
;;
;
esac
done
libraries="$new_libraries"
Expand Down
14 changes: 7 additions & 7 deletions Modules/ThirdParty/HDF5/src/itkhdf5/config/cmake/libh5cc.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
prg=$0
if [ ! -e "$prg" ]; then
case $prg in
(*/*) exit 1;;
(*) prg=$(command -v -- "$prg") || exit;;
(*/*) exit 1;
(*) prg=$(command -v -- "$prg") || exit;
esac
fi
dir=$(
Expand Down Expand Up @@ -64,23 +64,23 @@ for arg in $@ ; do
-showconfig)
showconfigure
exit $status
;;
;
-show)
echo @_PKG_CONFIG_COMPILER@ $@ `pkg-config $pc_args --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@`
exit $status
;;
;
-help)
usage
exit $status
;;
;
--*)
# gather pkg-config specific options
pc_args="$pc_args $arg"
;;
;
*)
@_PKG_CONFIG_COMPILER@ $@ `pkg-config $pc_args --define-variable=prefix=$dir --cflags --libs @_PKG_CONFIG_LIBNAME@`
status=$?
exit $status
;;
;
esac
done
12 changes: 6 additions & 6 deletions Utilities/GitSetup/git-review-push
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ force=''
# Parse the command line options.
while test $# != 0; do
case "$1" in
--no-topic) no_topic=1 ;;
--force) force=--force ;;
--dry-run) dry_run=--dry-run ;;
--) shift; break ;;
-*) usage ;;
*) test -z "$remote" || usage ; remote="$1" ;;
--no-topic) no_topic=1 ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also a bash script.

--force) force=--force ;
--dry-run) dry_run=--dry-run ;
--) shift; break ;
-*) usage ;
*) test -z "$remote" || usage ; remote="$1" ;
esac
shift
done
Expand Down
44 changes: 22 additions & 22 deletions Utilities/Hooks/kw-pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ check_whitespace() {
sed 's/^[^:]*: whitespace: //')
if $approx_tab_in_indent; then
case ",$ws," in
*,tab-in-indent,*) check_tab "$1" ;;
*,tab-in-indent,*) check_tab "$1" ;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most hooks are bash scripts, including this one.

esac
fi
case ",$ws," in
*,no-lf-at-eof,*) check_no_lf_at_eof "$1" ;;
*,no-lf-at-eof,*) check_no_lf_at_eof "$1" ;
esac
}
bad=$(git diff-index --name-only --cached $against -- |
Expand All @@ -116,10 +116,10 @@ test -z "$bad" || die "$bad"
# Check file modes and sizes.
mode_looks_exe() {
case "$1" in
*.bat) return 0 ;;
*.cmd) return 0 ;;
*.exe) return 0 ;;
*.com) return 0 ;;
*.bat) return 0 ;
*.cmd) return 0 ;
*.exe) return 0 ;
*.com) return 0 ;
esac
git cat-file blob "$2" | head -1 | grep "^#!/" > /dev/null
}
Expand Down Expand Up @@ -150,10 +150,10 @@ mode_non_file () {
}
check_mode() {
case "$dst_mode" in
100755) mode_looks_exe "$file" "$dst_obj" || mode_bad_exe ;;
100644) mode_looks_exe "$file" "$dst_obj" && mode_not_exe ;;
160000) ;;
*) mode_non_file ;;
100755) mode_looks_exe "$file" "$dst_obj" || mode_bad_exe ;
100644) mode_looks_exe "$file" "$dst_obj" && mode_not_exe ;
160000) ;
*) mode_non_file ;
esac
}

Expand Down Expand Up @@ -200,25 +200,25 @@ check_size() {
test "$dst_obj" != "$zero" || return
max_KiB=$(git check-attr hooks.MaxObjectKiB -- "$file" | sed 's/^[^:]*: hooks.MaxObjectKiB: //')
case "$max_KiB" in
'unset') ;;
'set') ;;
'unspecified') ;;
*) size_validate_max_KiB || return ;;
'unset') ;
'set') ;
'unspecified') ;
*) size_validate_max_KiB || return ;
esac
max_bytes=$(git check-attr hooks-max-size -- "$file" | sed 's/^[^:]*: hooks-max-size: //')
case "$max_bytes" in
'unset') return ;; # No maximum for this object.
'set') max_bytes="$size_max_bytes" ;; # Use local default.
'unset') return ; # No maximum for this object.
'set') max_bytes="$size_max_bytes" ; # Use local default.
'unspecified')
# Fall back to max KiB setting.
case "$max_KiB" in
'unset') return ;; # No maximum for this object.
'set') max_bytes=$(("${size_max_KiB}" * 1024)) ;; # Use local default.
'unspecified') max_bytes="$size_max_bytes" ;; # Use local default.
*) max_bytes=$(("${max_KiB}" * 1024)) ;;
'unset') return ; # No maximum for this object.
'set') max_bytes=$(("${size_max_KiB}" * 1024)) ; # Use local default.
'unspecified') max_bytes="$size_max_bytes" ; # Use local default.
*) max_bytes=$(("${max_KiB}" * 1024)) ;
esac
;;
*) size_validate_max_bytes || return ;;
;
*) size_validate_max_bytes || return ;
esac
if test "$max_bytes" -gt "0"; then
file_bytes=$(git cat-file -s "$dst_obj")
Expand Down
8 changes: 4 additions & 4 deletions Utilities/Hooks/pre-commit-style.bash
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ run_style_on_file() {
sed 's/^[^:]*: hooks.style: //')
has_style_attr=1
case "$style" in
'unset') has_style_attr=1 ;;
'set') has_style_attr=0 ;;
'unspecified') has_style_attr=1 ;;
*) echo ",$style," | grep -iq ",$2," && has_style_attr=0 ;;
'unset') has_style_attr=1 ;
'set') has_style_attr=0 ;
'unspecified') has_style_attr=1 ;
*) echo ",$style," | grep -iq ",$2," && has_style_attr=0 ;
esac
if ! git diff-files --quiet -- "$1" && test $has_style_attr -eq 0; then
# A way to always allow skipping.
Expand Down
4 changes: 2 additions & 2 deletions Utilities/Maintenance/ApplyScriptToRemotes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ do
"-h"|"--help")
shift;
help=true
break;;
break;
*)
break;;
break;
esac
done

Expand Down
4 changes: 2 additions & 2 deletions Utilities/Maintenance/FindPython3_ModernizeCMake.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ do
"-h"|"--help")
shift;
help=true
break;;
break;
*)
break;;
break;
esac
done

Expand Down
20 changes: 10 additions & 10 deletions Utilities/Maintenance/SourceTarball.bash
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ find_data_objects() {
egrep '\.(cid)$' |
while read mode type obj path; do
case "$path" in
*.cid) echo CID/$(git cat-file blob $obj) ;;
*) die "Unknown ExternalData content link: $path" ;;
*.cid) echo CID/$(git cat-file blob $obj) ;
*) die "Unknown ExternalData content link: $path" ;
esac
done | sort | uniq
return_pipe_status
Expand Down Expand Up @@ -127,14 +127,14 @@ verbose=
# Parse command line options.
while test $# != 0; do
case "$1" in
--tgz) formats="$formats tgz" ;;
--txz) formats="$formats txz" ;;
--zip) formats="$formats zip" ;;
--verbose) verbose=-v ;;
--) shift; break ;;
-v) shift; version="$1" ;;
-*) usage ;;
*) test -z "$commit" && commit="$1" || usage ;;
--tgz) formats="$formats tgz" ;
--txz) formats="$formats txz" ;
--zip) formats="$formats zip" ;
--verbose) verbose=-v ;
--) shift; break ;
-v) shift; version="$1" ;
-*) usage ;
*) test -z "$commit" && commit="$1" || usage ;
esac
shift
done
Expand Down
4 changes: 2 additions & 2 deletions Utilities/Maintenance/UpdateRemoteModules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ do
"-h"|"--help")
shift;
help=true
break;;
break;
*)
break;;
break;
esac
done

Expand Down
Loading
Loading