Skip to content

Commit c5a225f

Browse files
committed
Cleaned line endings and eof, fixes #45
- Trailing spaces at the end of lines removed - Every file ends with exactly 1 new line character - The code compiles using CMake and the build.sh script, and passes the tests
1 parent bc4166a commit c5a225f

12 files changed

+408
-408
lines changed

CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ endif ( ENABLE_DYLIBS_USE_RPATH )
8787
#---------------------------------------------
8888
# Build a shared and static library by default
8989
#---------------------------------------------
90-
90+
9191
set ( LIB_NAME ${CMAKE_PROJECT_NAME} )
9292
add_library ( ${LIB_NAME} SHARED ${JF_LIB_SRCS} )
9393
add_library ( ${LIB_NAME}-static STATIC ${JF_LIB_SRCS} )
@@ -101,7 +101,7 @@ set_target_properties ( ${LIB_NAME}
101101
PROPERTIES
102102
OUTPUT_NAME ${LIB_NAME}
103103
PREFIX lib
104-
SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
104+
SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
105105
VERSION ${VERSION}
106106
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib )
107107

@@ -133,7 +133,7 @@ if ( NOT ROBODOC_SKIP_DOC_GEN )
133133
--documenttitle "${CMAKE_PROJECT_NAME}" )
134134
# Dynamically generate the ROBODoc outputs list
135135
message ( STATUS "Dynamically computing ROBODoc output information..." )
136-
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR}
136+
execute_process ( COMMAND ${CMAKE_COMMAND} -E remove_directory ${DOC_DIR}
137137
COMMAND ${CMAKE_COMMAND} -E make_directory ${DOC_DIR}
138138
COMMAND "${ROBODOC}" ${REQUIRED_ROBODOC_OPTIONS} ${ROBODOC_OPTIONS} )
139139
file ( GLOB_RECURSE ROBODOC_OUTPUTS
@@ -333,7 +333,7 @@ install ( FILES
333333
export ( TARGETS ${LIB_NAME} ${LIB_NAME}-static FILE ${PACKAGE_NAME}-targets.cmake )
334334

335335
# build tree package config file, NOT installed
336-
configure_file (
336+
configure_file (
337337
"${CMAKE_SOURCE_DIR}/cmake/${CMAKE_PROJECT_NAME}-config.cmake.in"
338338
"${CMAKE_BINARY_DIR}/${PACKAGE_NAME}-config.cmake"
339339
@ONLY )

LICENSE

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3737
! Permission is hereby granted, free of charge, to any person obtaining a copy of this
3838
! software and associated documentation files (the "Software"), to deal in the Software
3939
! without restriction, including without limitation the rights to use, copy, modify, merge,
40-
! publish, distribute, sublicense, and/or sell copies of the Software, and to permit
40+
! publish, distribute, sublicense, and/or sell copies of the Software, and to permit
4141
! persons to whom the Software is furnished to do so, subject to the following conditions:
4242
!
43-
! The above copyright notice and this permission notice shall be included in all copies or
43+
! The above copyright notice and this permission notice shall be included in all copies or
4444
! substantial portions of the Software.
4545
!
46-
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
46+
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
4747
! INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
48-
! PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
48+
! PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
4949
! LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
5050
! OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
5151
! DEALINGS IN THE SOFTWARE.
5252
!
53-
!-----------------------------------------------------------------------------------------
53+
!-----------------------------------------------------------------------------------------

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ various Fortran 2003 and Fortran 2008 features such as: allocatable
2929
strings, newunit, generic, class, and abstract interface.
3030
It has been successfully compiled with the [Intel Fortran compiler
3131
13.1.0](https://software.intel.com/en-us/non-commercial-software-development) (and greater) and the recent [4.9 release of the GNU gfortran
32-
compiler](http://gcc.gnu.org/wiki/GFortran/News#GCC4.9).
32+
compiler](http://gcc.gnu.org/wiki/GFortran/News#GCC4.9).
3333

3434
Currently, several ways are provided to build the jsonfortran library
35-
(libjsonfortran).
35+
(libjsonfortran).
3636

3737
* A build script, `build.sh` is provided in the project root directory. This script uses [FoBiS](https://github.com/szaghi/FoBiS) to build the json-fortran library and the example program. Edit the script to use either the [Intel Fortran Compiler](https://software.intel.com/en-us/fortran-compilers) or [Gfortran](https://gcc.gnu.org/wiki/GFortran). Note that version 1.2.5 of FoBiS (or later) is required.
3838

@@ -72,7 +72,7 @@ Reading JSON from a file
7272

7373
Reading a JSON file and getting data from it is fairly
7474
straightforward using the ```json_file``` class. Here is an example. See the json_example.f90 file
75-
for more examples.
75+
for more examples.
7676

7777
```fortran
7878
program example1
@@ -107,7 +107,7 @@ for more examples.
107107
Reading JSON from a string
108108
---------------
109109
JSON can also be read directly from a character string like so:
110-
```fortran
110+
```fortran
111111
call json%load_from_string('{"name", "Leonidas"}')
112112
```
113113

@@ -141,7 +141,7 @@ of ```json_value``` pointers. See the json_example.f90 file for more examples.
141141

142142
```fortran
143143
program example2
144-
144+
145145
use,intrinsic :: iso_fortran_env, only: wp => real64
146146
147147
use json_module

SConstruct

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ if find_executable('robodoc'):
5656
docfiles = [join('documentation','json_example_f90.html'),
5757
join('documentation','json_module_f90.html'),
5858
join('documentation','masterindex.html'),
59-
join('documentation','robo_classes.html'),
59+
join('documentation','robo_classes.html'),
6060
join('documentation','robo_functions.html'),
6161
join('documentation','robo_modules.html'),
6262
join('documentation','robo_sourcefiles.html'),
6363
join('documentation','robo_unittests.html'),
64-
join('documentation','robodoc.css'),
64+
join('documentation','robodoc.css'),
6565
join('documentation','toc_index.html'), ]
6666

6767
bld = Builder(action='robodoc --rc robodoc.rc --src src/ --doc documentation/ --multidoc --html'+

build.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Build the json-fortran library and example program.
55
#
6-
# Requires:
6+
# Requires:
77
# FoBiS.py : https://github.com/szaghi/FoBiS [version 1.2.5 or later required]
88
# RoboDoc : http://rfsber.home.xs4all.nl/Robo/ [version 4.99.38 is the one tested]
99
#
@@ -26,33 +26,33 @@ LIBOUT='libjsonfortran.a' # name of json library
2626
if [ $use_ifort -eq 1 ]
2727
then
2828
# Intel compiler
29-
29+
3030
FCOMPILER='Intel'
3131
# The following warning might be triggered by ifort unless explicitly silenced:
3232
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure name. (R1214.4).
3333
# In the context of F2008 this is an erroneous warning.
3434
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
3535
FCOMPILERFLAGS= '-c -O2 -warn -stand f08 -diag-disable 7601 -traceback'
36-
#FCOMPILERFLAGS='-c -O2 -warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
36+
#FCOMPILERFLAGS='-c -O2 -warn -traceback -stand f08 -assume protect_parens -assume buffered_io -check all'
3737

3838
else
3939
# GFortran (must be >= 4.9)
40-
40+
4141
FCOMPILER='gnu'
4242
FCOMPILERFLAGS='-c -O2 -fbacktrace -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
4343
#FCOMPILERFLAGS='-c -O2 -fbacktrace -fall-intrinsics -Wall -Wextra -Wno-maybe-uninitialized -pedantic -std=f2008'
44-
44+
4545
fi
4646

4747
#build the stand-alone library:
4848
echo ""
4949
echo "Building library..."
50-
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
50+
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${LIBDIR} -s ${SRCDIR} -dmod ./ -dobj ./ -t ${MODCODE} -o ${LIBOUT} -mklib static -colors
5151

5252
#build the example program (uses the above library):
5353
echo ""
5454
echo "Building example program..."
55-
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${BINDIR} -s ${EXAMPLEDIR} -i ${LIBDIR} -libs ${LIBDIR}/${LIBOUT} -dmod ./ -dobj ./ -t ${EXAMPLECODE} -o json -colors
55+
FoBiS.py build -compiler ${FCOMPILER} -cflags "${FCOMPILERFLAGS}" -dbld ${BINDIR} -s ${EXAMPLEDIR} -i ${LIBDIR} -libs ${LIBDIR}/${LIBOUT} -dmod ./ -dobj ./ -t ${EXAMPLECODE} -o json -colors
5656

5757
#build the documentation with RoboDoc:
5858
echo ""

cmake/checkOutOfSource.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
option ( ENABLE_IN_SOURCE_BUILDS
1+
option ( ENABLE_IN_SOURCE_BUILDS
22
"Allow in source builds? Do so at your own risk, only if you know what you are doing. We STRONGLY advise against in source builds."
33
OFF )
44
mark_as_advanced ( ENABLE_IN_SOURCE_BUILDS )

cmake/fixupInstallNameDir.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ if ( NOT ENABLE_DYLIBS_USE_RPATH )
55
install ( CODE
66
"if ( DEFINED ENV{DESTDIR} )
77
string ( REGEX REPLACE \"/$\" \"\" DESTDIR \"\$ENV{DESTDIR}\" ) # strip trailing /
8-
get_filename_component ( INSTALL_LIB
8+
get_filename_component ( INSTALL_LIB
99
\${DESTDIR}/${ABS_LIB_INSTALL_DIR}/lib${LIB_NAME}.${VERSION_MAJOR}.${VERSION_MINOR}.dylib
1010
ABSOLUTE )
11-
execute_process ( COMMAND \"${CMAKE_INSTALL_NAME_TOOL}\"
11+
execute_process ( COMMAND \"${CMAKE_INSTALL_NAME_TOOL}\"
1212
-id \"\${INSTALL_LIB}\" \"\${INSTALL_LIB}\" )
1313
endif ( DEFINED ENV{DESTDIR} )" )
1414
endif ( CMAKE_INSTALL_NAME_TOOL )

cmake/pickFortranCompilerFlags.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if ( NOT Fortran_FLAGS_INIT )
1414
endif ( ENABLE_BACK_TRACE )
1515
if ( ENABLE_COMPILE_TIME_WARNINGS )
1616
# The following warning might be triggered by ifort unless explicitly silenced:
17-
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure
17+
# warning #7601: F2008 standard does not allow an internal procedure to be an actual argument procedure
1818
# name. (R1214.4). In the context of F2008 this is an erroneous warning.
1919
# See https://prd1idz.cps.intel.com/en-us/forums/topic/486629
2020
add_compile_options ( -warn -stand f08 -diag-disable 7601 )

files/invalid2.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"version": {
44
"major": 2,
55
"minor": 0,
6-
"patch": 0,
6+
"patch": 0,

robodoc.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
# DESCRIPTION
33
# Example robodoc.rc file for Fortran
44
#
@@ -128,4 +128,4 @@ keywords:
128128
wait
129129
where
130130
while
131-
write
131+
write

0 commit comments

Comments
 (0)