diff options
-rw-r--r-- | include/tng_io.h | 8 | ||||
-rw-r--r-- | src/lib/tng_io.c | 34 | ||||
-rw-r--r-- | src/tests/tng_io_read_pos.c | 10 | ||||
-rw-r--r-- | src/tests/tng_io_read_pos_util.c | 8 |
4 files changed, 31 insertions, 29 deletions
diff --git a/include/tng_io.h b/include/tng_io.h index 4295b7f..9118b06 100644 --- a/include/tng_io.h +++ b/include/tng_io.h @@ -2553,7 +2553,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *positions); /** @@ -2578,7 +2578,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_write tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *velocities); /** @@ -2603,7 +2603,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_write tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *forces); /** @@ -2627,7 +2627,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_write tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *box_shape); /** @} */ // end of group2 diff --git a/src/lib/tng_io.c b/src/lib/tng_io.c index 95b0aa4..1e52a51 100644 --- a/src/lib/tng_io.c +++ b/src/lib/tng_io.c @@ -4687,7 +4687,7 @@ static tng_function_status tng_particle_data_read static tng_function_status tng_particle_data_block_write (tng_trajectory_t tng_data, tng_gen_block_t block, - const int block_index, + const int64_t block_index, const tng_particle_mapping_t mapping, const char hash_mode) { @@ -5554,7 +5554,7 @@ static tng_function_status tng_data_read(tng_trajectory_t tng_data, */ static tng_function_status tng_data_block_write(tng_trajectory_t tng_data, tng_gen_block_t block, - const int block_index, + const int64_t block_index, const char hash_mode) { int64_t n_frames, stride_length, frame_step; @@ -12186,8 +12186,8 @@ tng_function_status DECLSPECDLLEXPORT tng_data_get int64_t *n_values_per_frame, char *type) { - int64_t file_pos; - int i, j, block_index, len, size; + int64_t file_pos, block_index; + int i, j, len, size; tng_non_particle_data_t data; tng_trajectory_frame_set_t frame_set = &tng_data->current_trajectory_frame_set; @@ -12316,8 +12316,8 @@ tng_function_status tng_data_vector_get(tng_trajectory_t tng_data, int64_t *n_values_per_frame, char *type) { - int64_t file_pos, data_size, n_frames_div; - int i, block_index, size; + int64_t file_pos, data_size, n_frames_div, block_index; + int i, size; tng_non_particle_data_t data; tng_trajectory_frame_set_t frame_set = &tng_data->current_trajectory_frame_set; @@ -12427,7 +12427,8 @@ tng_function_status DECLSPECDLLEXPORT tng_data_interval_get char *type) { int64_t i, j, n_frames, file_pos, current_frame_pos, first_frame; - int block_index, len, size; + int64_t block_index; + int len, size; tng_non_particle_data_t data; tng_trajectory_frame_set_t frame_set; tng_gen_block_t block; @@ -12811,8 +12812,8 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_get int64_t *n_values_per_frame, char *type) { - int64_t i, j, k, mapping, file_pos, i_step; - int block_index, len, size; + int64_t i, j, k, mapping, file_pos, i_step, block_index; + int len, size; tng_particle_data_t data; tng_trajectory_frame_set_t frame_set = &tng_data->current_trajectory_frame_set; @@ -13006,7 +13007,8 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_vector_get char *type) { int64_t i, j, mapping, file_pos, i_step, data_size, n_frames_div; - int block_index, size; + int64_t block_index; + int size; tng_particle_data_t data; tng_trajectory_frame_set_t frame_set = &tng_data->current_trajectory_frame_set; @@ -13158,8 +13160,8 @@ tng_function_status DECLSPECDLLEXPORT tng_particle_data_interval_get char *type) { int64_t i, j, k, mapping, n_frames, file_pos, current_frame_pos, i_step; - int64_t first_frame; - int block_index, len, size; + int64_t first_frame, block_index; + int len, size; tng_particle_data_t data; tng_trajectory_frame_set_t frame_set; tng_gen_block_t block; @@ -14326,7 +14328,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_write tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *positions) { tng_function_status stat; @@ -14349,7 +14351,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_pos_with_time_write tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *velocities) { tng_function_status stat; @@ -14372,7 +14374,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_vel_with_time_write tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *forces) { tng_function_status stat; @@ -14395,7 +14397,7 @@ tng_function_status DECLSPECDLLEXPORT tng_util_force_with_time_write tng_function_status DECLSPECDLLEXPORT tng_util_box_shape_with_time_write (tng_trajectory_t tng_data, const int64_t frame_nr, - const int64_t time, + const double time, const float *box_shape) { tng_function_status stat; diff --git a/src/tests/tng_io_read_pos.c b/src/tests/tng_io_read_pos.c index 81a522a..6741bec 100644 --- a/src/tests/tng_io_read_pos.c +++ b/src/tests/tng_io_read_pos.c @@ -24,7 +24,7 @@ int main(int argc, char **argv) int64_t n_particles, n_values_per_frame, n_frames, tot_n_frames; char data_type; int i, j; - int64_t particle = 0; + int particle = 0; // Set a default frame range int first_frame = 0, last_frame = 50; char atom_name[64], res_name[64], chain_name[64]; @@ -33,7 +33,7 @@ int main(int argc, char **argv) { printf("No file specified\n"); printf("Usage:\n"); - printf("tng_io_read_pos <tng_file> [particle number = %"PRId64"] " + printf("tng_io_read_pos <tng_file> [particle number = %d] " "[first_frame = %d] [last_frame = %d]\n", particle, first_frame, last_frame); exit(1); @@ -52,13 +52,13 @@ int main(int argc, char **argv) if(argc >= 3) { - particle = strtoll(argv[2], 0, 10); + particle = strtol(argv[2], 0, 10); if(argc >= 4) { - first_frame = strtoll(argv[3], 0, 10); + first_frame = strtol(argv[3], 0, 10); if(argc >= 5) { - last_frame = strtoll(argv[4], 0, 10); + last_frame = strtol(argv[4], 0, 10); } } } diff --git a/src/tests/tng_io_read_pos_util.c b/src/tests/tng_io_read_pos_util.c index 467afbf..5d2c8ea 100644 --- a/src/tests/tng_io_read_pos_util.c +++ b/src/tests/tng_io_read_pos_util.c @@ -27,14 +27,14 @@ int main(int argc, char **argv) float *positions = 0, *box_shape = 0; int64_t n_particles, n_frames, tot_n_frames, stride_length, i, j; // Set a default frame range - int64_t first_frame = 0, last_frame = 5000, n_strides; + int first_frame = 0, last_frame = 5000, n_strides; if(argc <= 1) { printf("No file specified\n"); printf("Usage:\n"); printf("tng_io_read_pos <tng_file> " - "[first_frame = %"PRId64"] [last_frame = %"PRId64"]\n", + "[first_frame = %d] [last_frame = %d]\n", first_frame, last_frame); exit(1); } @@ -44,10 +44,10 @@ int main(int argc, char **argv) if(argc >= 3) { - first_frame = strtoll(argv[2], 0, 10); + first_frame = strtol(argv[2], 0, 10); if(argc >= 4) { - last_frame = strtoll(argv[3], 0, 10); + last_frame = strtol(argv[3], 0, 10); } } |