diff --git a/Makefile.am b/Makefile.am index 62681f3..baac474 100644 --- a/Makefile.am +++ b/Makefile.am @@ -128,7 +128,6 @@ $(test_trexio_f): $(trexio_f) trexio.mod: tests/trexio_f.o tests_test_f_SOURCES = $(test_trexio_f) tests/test_f.f90 -tests_test_f_LDFLAGS = -no-install clean-local: -rm -rf -- *.dir/ *.h5 __pycache__/ diff --git a/src/templates_front/templator_front.org b/src/templates_front/templator_front.org index 028651c..874c36a 100644 --- a/src/templates_front/templator_front.org +++ b/src/templates_front/templator_front.org @@ -2450,7 +2450,7 @@ trexio_read_$group_dset$(trexio_t* const file, 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 - uint64_t eof_read_size = 0UL; + int64_t eof_read_size = 0UL; switch (file->back_end) { diff --git a/src/templates_hdf5/templator_hdf5.org b/src/templates_hdf5/templator_hdf5.org index eb14994..c031e3e 100644 --- a/src/templates_hdf5/templator_hdf5.org +++ b/src/templates_hdf5/templator_hdf5.org @@ -379,7 +379,7 @@ trexio_hdf5_has_$group_dset$ (trexio_t* const file) #+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_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_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max); #+end_src @@ -478,7 +478,7 @@ 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, + int64_t* const eof_read_size, int32_t* const index_read, double* const value_read) { diff --git a/src/templates_text/templator_text.org b/src/templates_text/templator_text.org index 697adcb..09fa995 100644 --- a/src/templates_text/templator_text.org +++ b/src/templates_text/templator_text.org @@ -1013,7 +1013,7 @@ trexio_text_has_$group_str$ (trexio_t* const file) #+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_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_read_$group_dset$_size(trexio_t* const file, int64_t* const size_max); #+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; /* 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) { fclose(f_wSize); 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 size, const int64_t size_max, - uint64_t* const eof_read_size, + int64_t* const eof_read_size, int32_t* const index_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; /* 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 */ if (INT64_MAX - size_accum > size_item) { size_accum += size_item;