diff options
author | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2014-03-22 20:01:58 (GMT) |
---|---|---|
committer | Scot Breitenfeld <brtnfld@hdfgroup.org> | 2014-03-22 20:01:58 (GMT) |
commit | 958a762dd16bac9a1c5a7a2c594adce6758f81f4 (patch) | |
tree | b230627a0be40407f9541a578cf7125c0473b966 | |
parent | 60df159d33d8793dd5764e2ae032e0e89fc44c9b (diff) | |
download | hdf5-958a762dd16bac9a1c5a7a2c594adce6758f81f4.zip hdf5-958a762dd16bac9a1c5a7a2c594adce6758f81f4.tar.gz hdf5-958a762dd16bac9a1c5a7a2c594adce6758f81f4.tar.bz2 |
[svn-r24866] Fixed compiler warnings using gnu 4.8.1
Tested: jam( intel, gnu, pgi)
-rw-r--r-- | fortran/src/H5Aff_F03.f90 | 5 | ||||
-rw-r--r-- | fortran/src/H5Df.c | 4 | ||||
-rw-r--r-- | fortran/src/H5Dff_F03.f90 | 37 | ||||
-rw-r--r-- | fortran/src/H5Off_F03.f90 | 3 | ||||
-rw-r--r-- | fortran/src/H5Pff.f90 | 2 | ||||
-rw-r--r-- | fortran/src/H5Rff_F03.f90 | 4 | ||||
-rw-r--r-- | fortran/src/H5Sf.c | 2 | ||||
-rw-r--r-- | fortran/src/H5test_kind_SIZEOF.f90 | 66 |
8 files changed, 65 insertions, 58 deletions
diff --git a/fortran/src/H5Aff_F03.f90 b/fortran/src/H5Aff_F03.f90 index 26c911a..807f6fa 100644 --- a/fortran/src/H5Aff_F03.f90 +++ b/fortran/src/H5Aff_F03.f90 @@ -1065,17 +1065,16 @@ CONTAINS CHARACTER(LEN=*), INTENT(INOUT) :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code - CALL h5aread_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), dims, hdferr) + CALL h5aread_char_scalar_fix(attr_id, memtype_id, buf, LEN(buf), hdferr) END SUBROUTINE h5aread_char_scalar - SUBROUTINE h5aread_char_scalar_fix(attr_id, memtype_id, buf, buf_len, dims, hdferr) + SUBROUTINE h5aread_char_scalar_fix(attr_id, memtype_id, buf, buf_len, hdferr) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype ! identifier (in memory) - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes INTEGER, INTENT(IN) :: buf_len CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Attribute data INTEGER, INTENT(OUT) :: hdferr ! Error code diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index deab4f3..799f40a 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -1712,7 +1712,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s size_t max_len; hvl_t *c_buf; - size_t i; + hssize_t i; hssize_t num_elem; c_dset_id = (hid_t)*dset_id; @@ -2027,7 +2027,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac size_t max_len; hvl_t *c_buf; - size_t i; + hssize_t i; hssize_t num_elem; c_dset_id = (hid_t)*dset_id; diff --git a/fortran/src/H5Dff_F03.f90 b/fortran/src/H5Dff_F03.f90 index be4bd69..d39c200 100644 --- a/fortran/src/H5Dff_F03.f90 +++ b/fortran/src/H5Dff_F03.f90 @@ -273,7 +273,8 @@ CONTAINS INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i,j + INTEGER :: i + INTEGER(HSIZE_T) :: j TYPE(C_PTR) :: f_ptr INTERFACE INTEGER FUNCTION h5dwrite_ref_reg_c(dset_id, mem_type_id,& @@ -1214,10 +1215,10 @@ CONTAINS INTEGER(HID_T) :: xfer_prp_default INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default - TYPE(C_PTR) :: f_ptr INTEGER, ALLOCATABLE, DIMENSION(:) :: ref_buf - INTEGER :: i,j + INTEGER :: i + INTEGER(HSIZE_T) :: j INTERFACE INTEGER FUNCTION h5dread_ref_reg_c(dset_id, mem_type_id,& mem_space_id_default, & @@ -1538,18 +1539,25 @@ CONTAINS INTEGER(HID_T) :: mem_space_id_default INTEGER(HID_T) :: file_space_id_default - CALL h5dread_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), dims, hdferr, & - mem_space_id, file_space_id, xfer_prp) + xfer_prp_default = H5P_DEFAULT_F + mem_space_id_default = H5S_ALL_F + file_space_id_default = H5S_ALL_F + + IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp + IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id + IF(PRESENT(file_space_id)) file_space_id_default = file_space_id + + CALL h5dread_char_scalar_fix(dset_id, mem_type_id, buf, LEN(buf), hdferr, & + mem_space_id_default, file_space_id_default, xfer_prp_default) END SUBROUTINE h5dread_char_scalar - SUBROUTINE h5dread_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, dims, hdferr, & + SUBROUTINE h5dread_char_scalar_fix(dset_id, mem_type_id, buf, buf_len, hdferr, & mem_space_id, file_space_id, xfer_prp) USE, INTRINSIC :: ISO_C_BINDING IMPLICIT NONE INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier - INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims INTEGER, INTENT(IN) :: buf_len CHARACTER(LEN=buf_len), INTENT(INOUT), TARGET :: buf ! Data buffer INTEGER, INTENT(OUT) :: hdferr ! Error code @@ -1557,23 +1565,12 @@ CONTAINS INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id ! File dataspace identfier INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp ! Transfer property list identifier - INTEGER(HID_T) :: xfer_prp_default - INTEGER(HID_T) :: mem_space_id_default - INTEGER(HID_T) :: file_space_id_default TYPE(C_PTR) :: f_ptr - xfer_prp_default = H5P_DEFAULT_F - mem_space_id_default = H5S_ALL_F - file_space_id_default = H5S_ALL_F - - IF(PRESENT(xfer_prp)) xfer_prp_default = xfer_prp - IF(PRESENT(mem_space_id)) mem_space_id_default = mem_space_id - IF(PRESENT(file_space_id)) file_space_id_default = file_space_id - f_ptr = C_LOC(buf(1:1)) - hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id_default, & - file_space_id_default, xfer_prp_default, f_ptr) + hdferr = h5dread_f_c(dset_id, mem_type_id, mem_space_id, & + file_space_id, xfer_prp, f_ptr) END SUBROUTINE h5dread_char_scalar_fix diff --git a/fortran/src/H5Off_F03.f90 b/fortran/src/H5Off_F03.f90 index 0cf4d46..cfb7d56 100644 --- a/fortran/src/H5Off_F03.f90 +++ b/fortran/src/H5Off_F03.f90 @@ -205,7 +205,6 @@ CONTAINS INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id !***** - INTEGER :: corder_valid INTEGER(SIZE_T) :: namelen INTEGER(HID_T) :: lapl_id_default TYPE(C_PTR) :: ptr @@ -329,7 +328,6 @@ CONTAINS INTEGER , INTENT(OUT) :: hdferr INTEGER(HID_T) , INTENT(IN) , OPTIONAL :: lapl_id !***** - INTEGER :: corder_valid INTEGER(SIZE_T) :: namelen INTEGER(HID_T) :: lapl_id_default TYPE(C_PTR) :: ptr @@ -418,7 +416,6 @@ CONTAINS INTEGER(SIZE_T) :: namelen INTEGER(HID_T) :: lapl_id_default - TYPE(C_PTR) :: ptr INTERFACE INTEGER FUNCTION h5ovisit_by_name_c(loc_id, object_name, namelen, index_type, order, & diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90 index a3c9a60..18ad784 100644 --- a/fortran/src/H5Pff.f90 +++ b/fortran/src/H5Pff.f90 @@ -5977,7 +5977,7 @@ SUBROUTINE h5pset_fapl_direct_f(fapl_id, alignment, block_size, cbuf_size, hdfer INTEGER(HID_T), INTENT(IN) :: fapl_id ! File access property list identifier INTEGER(SIZE_T), INTENT(OUT) :: alignment ! Required memory alignment boundary! INTEGER(SIZE_T), INTENT(OUT) :: block_size ! File system block size - INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size + INTEGER(SIZE_T), INTENT(OUT) :: cbuf_size ! Copy buffer size INTEGER, INTENT(OUT) :: hdferr ! Error code ! 0 on success and -1 on failure !***** diff --git a/fortran/src/H5Rff_F03.f90 b/fortran/src/H5Rff_F03.f90 index 7a9b080..e0ffa0a 100644 --- a/fortran/src/H5Rff_F03.f90 +++ b/fortran/src/H5Rff_F03.f90 @@ -238,7 +238,6 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: space_id ! Space identifier INTEGER, INTENT(OUT) :: hdferr ! Error code !***** - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference hdferr = h5rget_region_ptr_c(dset_id, ref, space_id ) @@ -441,7 +440,6 @@ CONTAINS INTEGER(HID_T), INTENT(OUT) :: ref_obj_id ! Object identifier INTEGER, INTENT(OUT) :: hdferr ! Error code !***** - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference TYPE(C_PTR) :: f_ptr f_ptr = C_LOC(ref) @@ -567,7 +565,6 @@ CONTAINS CHARACTER(LEN=*), INTENT(OUT) :: name INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER(HADDR_T) :: ref_f ! Local buffer to pass reference INTEGER(SIZE_T) :: size_default INTEGER(SIZE_T) :: name_len @@ -615,7 +612,6 @@ CONTAINS CHARACTER(LEN=*), INTENT(OUT) :: name INTEGER, INTENT(OUT) :: hdferr !***** - INTEGER :: ref_f(REF_REG_BUF_LEN) ! Local buffer to pass reference INTEGER(SIZE_T) :: size_default INTEGER(SIZE_T) :: name_len TYPE(C_PTR) :: f_ptr diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index a944e20..8e17026 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -575,7 +575,7 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) { int ret_value = 0; hid_t c_space_id; - hsize_t c_npoints; + hssize_t c_npoints; c_space_id = *space_id; c_npoints = H5Sget_simple_extent_npoints(c_space_id); diff --git a/fortran/src/H5test_kind_SIZEOF.f90 b/fortran/src/H5test_kind_SIZEOF.f90 index 867ec1e..7a58b0e 100644 --- a/fortran/src/H5test_kind_SIZEOF.f90 +++ b/fortran/src/H5test_kind_SIZEOF.f90 @@ -49,6 +49,10 @@ PROGRAM test_kind INTEGER :: ji, jr, jd last = -1 ii = 0 + + ikind_numbers = 0 + rkind_numbers = 0 + DO i = 1,100 j = SELECTED_INT_KIND(i) IF(j .NE. last) THEN @@ -114,30 +118,20 @@ WRITE(*,'(40(A,/))') & '!',& '!*****' -! Generate a program - WRITE(*,*) "PROGRAM int_kind" - WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ - ji = 0 - WRITE(*, "("" CALL i"", i2.2,""()"")") ji - jr = 0 - WRITE(*, "("" CALL r"", i2.2,""()"")") jr - jd = 0 - WRITE(*, "("" CALL d"", i2.2,""()"")") jd - DO i = 1, ii - j = ikind_numbers(i) - WRITE(*, "("" CALL i"", i2.2,""()"")") j - ENDDO - DO i = 1, ir - j = rkind_numbers(i) - WRITE(*, "("" CALL r"", i2.2,""()"")") j - ENDDO - WRITE(*,*) "END PROGRAM int_kind" +! GENERATE A PROGRAM +! +! (a) Generate the module + + WRITE(*,*) "MODULE H5test_kind_SIZEOF_mod" + WRITE(*,*) "USE ISO_C_BINDING" + WRITE(*,*) "IMPLICIT NONE" + WRITE(*,*) "CONTAINS" j = 0 ji = KIND(1) WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" INTEGER :: a" - WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" @@ -151,7 +145,7 @@ WRITE(*,'(40(A,/))') & WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") jr WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" REAL :: a" - WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" @@ -165,7 +159,7 @@ WRITE(*,'(40(A,/))') & WRITE(*, "("" SUBROUTINE d"", i2.2,""()"")") jd WRITE(*,*)" IMPLICIT NONE" WRITE(*,*)" DOUBLE PRECISION :: a" - WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" @@ -179,7 +173,7 @@ WRITE(*,'(40(A,/))') & WRITE(*, "("" SUBROUTINE i"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" WRITE(*,'(A,I0,A)')" INTEGER(KIND=",j,") :: a" - WRITE(*,*)" INTEGER :: a_size" + WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" @@ -193,8 +187,8 @@ WRITE(*,'(40(A,/))') & j = rkind_numbers(i) WRITE(*, "("" SUBROUTINE r"", i2.2,""()"")") j WRITE(*,*)" IMPLICIT NONE" - WRITE(*,'(A,I0,A)')" REAL(KIND= ",j,") :: a" - WRITE(*,*)" INTEGER :: a_size" + WRITE(*,'(A,I0,A)')" REAL(KIND= ",j,") :: a" + WRITE(*,*)" INTEGER(C_SIZE_T) :: a_size" WRITE(*,*)" CHARACTER(LEN=2) :: ichr2, jchr2" WRITE(*,*)" a_size = SIZEOF(a)" WRITE(*,*)" WRITE(ichr2,'(I2)') a_size" @@ -204,6 +198,30 @@ WRITE(*,'(40(A,/))') & WRITE(*,*)" RETURN" WRITE(*,*)"END SUBROUTINE" ENDDO + WRITE(*,*) "END MODULE H5test_kind_SIZEOF_mod" + WRITE(*,*) "" + + ! (b) generate the main program + + WRITE(*,*) "PROGRAM H5test_kind_SIZEOF" + WRITE(*,*) "USE H5test_kind_SIZEOF_mod" + WRITE(*,*) "WRITE(*,*) "" /*generating header file*/ """ + ji = 0 + WRITE(*, "("" CALL i"", i2.2,""()"")") ji + jr = 0 + WRITE(*, "("" CALL r"", i2.2,""()"")") jr + jd = 0 + WRITE(*, "("" CALL d"", i2.2,""()"")") jd + DO i = 1, ii + j = ikind_numbers(i) + WRITE(*, "("" CALL i"", i2.2,""()"")") j + ENDDO + DO i = 1, ir + j = rkind_numbers(i) + WRITE(*, "("" CALL r"", i2.2,""()"")") j + ENDDO + WRITE(*,*) "END PROGRAM H5test_kind_SIZEOF" + END PROGRAM test_kind |