1
0
mirror of https://github.com/TREX-CoE/trexio.git synced 2024-11-03 20:54:07 +01:00

change int64 to uint64

This commit is contained in:
q-posev 2021-02-22 11:40:13 +01:00
parent 0c60cf78d9
commit ac9e1aa410

View File

@ -287,12 +287,12 @@ trio_exit_code trio_close(trio_t* file) {
** Reading/writing data ** Reading/writing data
#+begin_src c :tangle trio.h #+begin_src c :tangle trio.h
trio_exit_code trio_read_nucleus_num(trio_t* file, int64_t* num); trio_exit_code trio_read_nucleus_num(trio_t* file, uint64_t* num);
trio_exit_code trio_write_nucleus_num(trio_t* file, int64_t num); trio_exit_code trio_write_nucleus_num(trio_t* file, uint64_t num);
#+end_src #+end_src
#+begin_src c :tangle trio.c #+begin_src c :tangle trio.c
trio_exit_code trio_read_nucleus_num(trio_t* file, int64_t* num) { trio_exit_code trio_read_nucleus_num(trio_t* file, uint64_t* num) {
if (file == NULL) return TRIO_FAILURE; if (file == NULL) return TRIO_FAILURE;
switch (file->back_end) { switch (file->back_end) {
@ -314,7 +314,7 @@ trio_exit_code trio_read_nucleus_num(trio_t* file, int64_t* num) {
} }
} }
trio_exit_code trio_write_nucleus_num(trio_t* file, int64_t num) { trio_exit_code trio_write_nucleus_num(trio_t* file, uint64_t num) {
if (file == NULL) return TRIO_FAILURE; if (file == NULL) return TRIO_FAILURE;
switch (file->back_end) { switch (file->back_end) {
@ -455,12 +455,12 @@ trio_exit_code trio_write_nucleus_charge(trio_t* file, double* charge) {
typedef struct nucleus_s { typedef struct nucleus_s {
double* coord; double* coord;
double* charge; double* charge;
int64_t num; uint64_t num;
} nucleus_t; } nucleus_t;
typedef struct electron_s { typedef struct electron_s {
int64_t alpha_num; uint64_t alpha_num;
int64_t beta_num; uint64_t beta_num;
} electron_t; } electron_t;
typedef struct trio_text_s { typedef struct trio_text_s {
@ -650,12 +650,12 @@ trio_exit_code trio_text_free_nucleus(nucleus_t* nucleus) {
*** Read/Write the num attribute *** Read/Write the num attribute
#+begin_src c :tangle trio_text.h #+begin_src c :tangle trio_text.h
trio_exit_code trio_text_read_nucleus_num(const trio_t* file, int64_t* num); trio_exit_code trio_text_read_nucleus_num(const trio_t* file, uint64_t* num);
trio_exit_code trio_text_write_nucleus_num(const trio_t* file, const int64_t num); trio_exit_code trio_text_write_nucleus_num(const trio_t* file, const uint64_t num);
#+end_src #+end_src
#+begin_src c :tangle trio_text.c #+begin_src c :tangle trio_text.c
trio_exit_code trio_text_read_nucleus_num(const trio_t* file, int64_t* num) { trio_exit_code trio_text_read_nucleus_num(const trio_t* file, uint64_t* num) {
assert (file != NULL); assert (file != NULL);
assert (num != NULL); assert (num != NULL);
@ -673,7 +673,7 @@ trio_exit_code trio_text_read_nucleus_num(const trio_t* file, int64_t* num) {
} }
trio_exit_code trio_text_write_nucleus_num(const trio_t* file, const int64_t num) { trio_exit_code trio_text_write_nucleus_num(const trio_t* file, const uint64_t num) {
assert (num > 0L); assert (num > 0L);
assert (file != NULL); assert (file != NULL);
@ -830,3 +830,5 @@ trio_exit_code trio_text_write_nucleus_charge(const trio_t* file, const double*
* TODO Things to be done :noexport: * TODO Things to be done :noexport:
- [ ] Thread safety - [ ] Thread safety
- [ ] Error handling with errno - [ ] Error handling with errno
- [ ] HDF5 back-end
- [ ] JSON back-end