From 2616efda30b6f9207b36696ee43a8879fa0fb37d Mon Sep 17 00:00:00 2001 From: skarg Date: Wed, 20 Apr 2016 16:34:28 +0000 Subject: [PATCH] Added indent.bat file for single files on Windows and moved former indent.bat to indent-all.bat file. Added unix2dos and svn prop-set to the indent.bat file. --- bacnet-stack/indent-all.bat | 41 +++++++++++++++++++++++++++++++++++++ bacnet-stack/indent.bat | 29 ++++++++------------------ 2 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 bacnet-stack/indent-all.bat diff --git a/bacnet-stack/indent-all.bat b/bacnet-stack/indent-all.bat new file mode 100644 index 00000000..ab6b6033 --- /dev/null +++ b/bacnet-stack/indent-all.bat @@ -0,0 +1,41 @@ +rem Indent the C and H files with specific coding standard +rem requires 'indent.exe' from MSYS (MinGW). +rem See http://www.gnu.org/software/indent/manual/indent.pdf +set OPTIONS=-kr -nut -nlp -ip4 -cli4 -bfda -nbc -nbbo -c0 -cd0 -cp0 -di0 -l79 -nhnl +rem -kr The Kernighan & Ritchie style, corresponds to the following options: +rem -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 +rem -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs +rem -nprs -npsl -saf -sai -saw -nsc -nsob -nss +rem -nut Use spaces instead of tabs. +rem -nlp Do not line up parentheses. +rem -ip4 Indent parameter types in old-style function definitions by n spaces. +rem -cli4 Case label indent of n spaces. +rem -bfda Break the line before all arguments in a declaration. +rem -nbc Do not force newlines after commas in declarations. +rem -nbbo Do not prefer to break long lines before boolean operators. +rem -c0 Put comments to the right of code in column n. +rem -cd0 Put comments to the right of the declarations in column n. +rem -cp0 Put comments to the right of #else and #endif statements in column n. +rem -di0 Put variables in column n. +rem -l79 Set maximum line length for non-comment lines to n. +rem -nhnl Do not prefer to break long lines at the position of newlines in the input. + +call :treeProcess +goto :eof + +:treeProcess +rem perform the indent on all the files of this subdirectory: +for %%f in (*.c) do ( + indent.exe "%%f" -o "%%f" %OPTIONS% +) +for %%f in (*.h) do ( + indent.exe "%%f" -o "%%f" %OPTIONS% +) +rem loop over all directories and sub directories +for /D %%d in (*) do ( + cd %%d + call :treeProcess + cd .. +) +exit /b + diff --git a/bacnet-stack/indent.bat b/bacnet-stack/indent.bat index e8c284bd..5d143530 100644 --- a/bacnet-stack/indent.bat +++ b/bacnet-stack/indent.bat @@ -1,7 +1,7 @@ +@echo off rem Indent the C and H files with specific coding standard rem requires 'indent.exe' from MSYS (MinGW). rem See http://www.gnu.org/software/indent/manual/indent.pdf -set OPTIONS=-kr -nut -nlp -ip4 -cli4 -bfda -nbc -nbbo -c0 -cd0 -cp0 -di0 -l79 -nhnl rem -kr The Kernighan & Ritchie style, corresponds to the following options: rem -nbad -bap -bbo -nbc -br -brs -c33 -cd33 -ncdb -ce -ci4 -cli0 rem -cp33 -cs -d0 -di1 -nfc1 -nfca -hnl -i4 -ip0 -l75 -lp -npcs @@ -20,22 +20,11 @@ rem -di0 Put variables in column n. rem -l79 Set maximum line length for non-comment lines to n. rem -nhnl Do not prefer to break long lines at the position of newlines in the input. -call :treeProcess -goto :eof - -:treeProcess -rem perform the indent on all the files of this subdirectory: -for %%f in (*.c) do ( - indent.exe "%%f" -o "%%f" %OPTIONS% -) -for %%f in (*.h) do ( - indent.exe "%%f" -o "%%f" %OPTIONS% -) -rem loop over all directories and sub directories -for /D %%d in (*) do ( - cd %%d - call :treeProcess - cd .. -) -exit /b - +echo Fixing Unix/DOS line endings for "%1" +unix2dos.exe "%1" +echo Setting Subversion EOL Style for "%1" +svn.exe propset svn:eol-style native "%1" +svn.exe propset svn:mime-type text/plain "%1" +echo Indenting "%1" +set OPTIONS=-kr -nut -nlp -ip4 -cli4 -bfda -nbc -nbbo -c0 -cd0 -cp0 -di0 -l79 -nhnl +indent.exe "%1" -o "%1" %OPTIONS%