diff options
author | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-10-15 14:42:31 (GMT) |
---|---|---|
committer | Magnus Lundborg <lundborg.magnus@gmail.com> | 2013-10-15 14:42:31 (GMT) |
commit | 394e17a4088cc91ea12cf45ad801515de4ccbc68 (patch) | |
tree | 1e32d818b712be85c192f6d973bfa0cdd9bb483f /src/tests/tng_io_read_pos_util.c | |
parent | ba62d1b75275732e8604630d05bce4532ab1675b (diff) |
Specifically typed min and max functions.
Explicitly compare signed and unsigned in many places to avoid
warnings.
Diffstat (limited to 'src/tests/tng_io_read_pos_util.c')
-rw-r--r-- | src/tests/tng_io_read_pos_util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/tests/tng_io_read_pos_util.c b/src/tests/tng_io_read_pos_util.c index 5d2c8ea..797788c 100644 --- a/src/tests/tng_io_read_pos_util.c +++ b/src/tests/tng_io_read_pos_util.c @@ -26,7 +26,7 @@ int main(int argc, char **argv) * arrays */ float *positions = 0, *box_shape = 0; int64_t n_particles, n_frames, tot_n_frames, stride_length, i, j; - // Set a default frame range + /* Set a default frame range */ int first_frame = 0, last_frame = 5000, n_strides; if(argc <= 1) @@ -39,7 +39,7 @@ int main(int argc, char **argv) exit(1); } - // A reference must be passed to allocate memory + /* A reference must be passed to allocate memory */ tng_util_trajectory_open(argv[1], 'r', &traj); if(argc >= 3) @@ -93,13 +93,13 @@ int main(int argc, char **argv) n_strides = (n_frames % stride_length) ? n_frames / stride_length + 1: n_frames / stride_length; - // Get the positions of all particles in the requested frame range. - // The positions are stored in the positions array. - // N.B. No proper error checks. + /* Get the positions of all particles in the requested frame range. + * The positions are stored in the positions array. + * N.B. No proper error checks. */ if(tng_util_pos_read_range(traj, 0, last_frame, &positions, &stride_length) == TNG_SUCCESS) { - // Print the positions of the wanted particle (zero based) + /* Print the positions of the wanted particle (zero based) */ for(i=0; i < n_strides; i++) { printf("\nFrame %"PRId64":\n", first_frame + i*stride_length); @@ -118,7 +118,7 @@ int main(int argc, char **argv) printf("Cannot read positions\n"); } - // Free memory + /* Free memory */ if(positions) { free(positions); |