1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-12-23 04:43:57 +01:00

fix warnings on MacOS

This commit is contained in:
q-posev 2021-12-17 17:07:53 +01:00
parent 2639b76a6e
commit 31ccd27a0a
4 changed files with 7 additions and 8 deletions

View File

@ -128,7 +128,6 @@ $(test_trexio_f): $(trexio_f)
trexio.mod: tests/trexio_f.o trexio.mod: tests/trexio_f.o
tests_test_f_SOURCES = $(test_trexio_f) tests/test_f.f90 tests_test_f_SOURCES = $(test_trexio_f) tests/test_f.f90
tests_test_f_LDFLAGS = -no-install
clean-local: clean-local:
-rm -rf -- *.dir/ *.h5 __pycache__/ -rm -rf -- *.dir/ *.h5 __pycache__/

View File

@ -2450,7 +2450,7 @@ trexio_read_$group_dset$(trexio_t* const file,
if (rc != TREXIO_SUCCESS) return rc; if (rc != TREXIO_SUCCESS) return rc;
// introduce a new variable which will be modified with the number of integrals being read if EOF is encountered // introduce a new variable which will be modified with the number of integrals being read if EOF is encountered
uint64_t eof_read_size = 0UL; int64_t eof_read_size = 0UL;
switch (file->back_end) { switch (file->back_end) {

View File

@ -379,7 +379,7 @@ trexio_hdf5_has_$group_dset$ (trexio_t* const file)
#+begin_src c :tangle hrw_dset_sparse_hdf5.h :exports none #+begin_src c :tangle hrw_dset_sparse_hdf5.h :exports none
trexio_exit_code trexio_hdf5_has_$group_dset$(trexio_t* const file); trexio_exit_code trexio_hdf5_has_$group_dset$(trexio_t* const file);
trexio_exit_code trexio_hdf5_read_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, uint64_t* const eof_read_size, int32_t* const index_sparse, double* const value_sparse); trexio_exit_code trexio_hdf5_read_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, int64_t* const eof_read_size, int32_t* const index_sparse, double* const value_sparse);
trexio_exit_code trexio_hdf5_write_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, const int32_t* index_sparse, const double* value_sparse); trexio_exit_code trexio_hdf5_write_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, const int32_t* index_sparse, const double* value_sparse);
trexio_exit_code trexio_hdf5_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max); trexio_exit_code trexio_hdf5_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max);
#+end_src #+end_src
@ -478,7 +478,7 @@ trexio_hdf5_read_$group_dset$ (trexio_t* const file,
const int64_t offset_file, const int64_t offset_file,
const int64_t size, const int64_t size,
const int64_t size_max, const int64_t size_max,
uint64_t* const eof_read_size, int64_t* const eof_read_size,
int32_t* const index_read, int32_t* const index_read,
double* const value_read) double* const value_read)
{ {

View File

@ -1013,7 +1013,7 @@ trexio_text_has_$group_str$ (trexio_t* const file)
#+begin_src c :tangle hrw_dset_sparse_text.h :exports none #+begin_src c :tangle hrw_dset_sparse_text.h :exports none
trexio_exit_code trexio_text_has_$group_dset$(trexio_t* const file); trexio_exit_code trexio_text_has_$group_dset$(trexio_t* const file);
trexio_exit_code trexio_text_read_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, uint64_t* const eof_read_size, int32_t* const index_sparse, double* const value_sparse); trexio_exit_code trexio_text_read_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, int64_t* const eof_read_size, int32_t* const index_sparse, double* const value_sparse);
trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, const int64_t size_start, const int32_t* index_sparse, const double* value_sparse); trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file, const int64_t offset_file, const int64_t size, const int64_t size_max, const int64_t size_start, const int32_t* index_sparse, const double* value_sparse);
trexio_exit_code trexio_text_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max); trexio_exit_code trexio_text_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max);
#+end_src #+end_src
@ -1098,7 +1098,7 @@ trexio_exit_code trexio_text_write_$group_dset$(trexio_t* const file,
if (f_wSize == NULL) return TREXIO_FILE_ERROR; if (f_wSize == NULL) return TREXIO_FILE_ERROR;
/* Write the buffer_size */ /* Write the buffer_size */
rc = fprintf(f_wSize, "%ld %ld\n", size, io_start_pos); rc = fprintf(f_wSize, "%" PRId64 " %" PRId64 "\n", size, io_start_pos);
if (rc <= 0) { if (rc <= 0) {
fclose(f_wSize); fclose(f_wSize);
return TREXIO_FAILURE; return TREXIO_FAILURE;
@ -1119,7 +1119,7 @@ trexio_exit_code trexio_text_read_$group_dset$(trexio_t* const file,
const int64_t offset_file, const int64_t offset_file,
const int64_t size, const int64_t size,
const int64_t size_max, const int64_t size_max,
uint64_t* const eof_read_size, int64_t* const eof_read_size,
int32_t* const index_sparse, int32_t* const index_sparse,
double* const value_sparse) double* const value_sparse)
{ {
@ -1224,7 +1224,7 @@ trexio_exit_code trexio_text_read_$group_dset$_size(trexio_t* const file, int64_
int64_t size_item, offset_item, size_accum=0L; int64_t size_item, offset_item, size_accum=0L;
/* Read the values from the file. BEWARE OF POSSIBLE MAX_INT64 OVERFLOW ! */ /* Read the values from the file. BEWARE OF POSSIBLE MAX_INT64 OVERFLOW ! */
while(fscanf(f, "%ld %ld", &size_item, &offset_item) != EOF) { while(fscanf(f, "%" SCNd64 " %" SCNd64 "", &size_item, &offset_item) != EOF) {
/* Check that summation will not overflow the int64_t value */ /* Check that summation will not overflow the int64_t value */
if (INT64_MAX - size_accum > size_item) { if (INT64_MAX - size_accum > size_item) {
size_accum += size_item; size_accum += size_item;