Commit e185bf92 authored by Loic Hausammann's avatar Loic Hausammann

Fixes API

parent f10d5d0e
......@@ -64,8 +64,8 @@ void check_data(struct logger_reader *reader, struct part *parts,
/* Number of particle found during this time step. */
int count = 0;
/* Set it to an impossible value in order to flag it. */
const long long id_flag = 5 * number_parts;
long long previous_id = id_flag;
const uint64_t id_flag = 5 * number_parts;
uint64_t previous_id = id_flag;
/* Loop over each record. */
for (size_t offset =
......@@ -89,7 +89,7 @@ void check_data(struct logger_reader *reader, struct part *parts,
}
/* Get the corresponding particle */
if (lp.id >= number_parts) error("Wrong id %lli", lp.id);
if (lp.id >= number_parts) error("Wrong id %li", lp.id);
struct part *p = &parts[lp.id];
......
......@@ -94,8 +94,7 @@ int main(int argc, char *argv[]) {
array.hydro.parts = particles;
array.hydro.n = n_tot;
logger_reader_read_all_particles(&reader, begin, logger_reader_const, &array,
n_tot);
logger_reader_read_all_particles(&reader, begin, logger_reader_const, &array);
/* Loop over time for a single particle */
size_t id = 0;
......@@ -112,7 +111,7 @@ int main(int argc, char *argv[]) {
message("Particle %zi: %f %f %f %f", id, p.x[0], p.x[1], p.x[2], p.time);
/* Now you can interpolate */
logger_particle_interpolate(&p, &n, t);
p = logger_particle_interpolate(&p, &n, t);
}
/* Cleanup the memory */
......
......@@ -197,9 +197,12 @@ void test_log_timestamps(struct logger_writer *log) {
size_t offset_old = offset;
t = 0;
time = 0;
int mask = logger_read_timestamp(log, &t, &time, &offset, (const char *)d->data);
printf("Recovered timestamp %020llu with time %g at offset %#016zx with mask %#04x.\n", t,
time, offset_old, mask);
int mask =
logger_read_timestamp(log, &t, &time, &offset, (const char *)d->data);
printf(
"Recovered timestamp %020llu with time %g at offset %#016zx with mask "
"%#04x.\n",
t, time, offset_old, mask);
if (t != 30) {
printf("FAIL: could not recover correct timestamp.\n");
abort();
......@@ -213,8 +216,10 @@ void test_log_timestamps(struct logger_writer *log) {
t = 0;
time = 0;
mask = logger_read_timestamp(log, &t, &time, &offset, (const char *)d->data);
printf("Recovered timestamp %020llu with time %g at offset %#016zx with mask %#04x.\n", t,
time, offset_old, mask);
printf(
"Recovered timestamp %020llu with time %g at offset %#016zx with mask "
"%#04x.\n",
t, time, offset_old, mask);
if (t != 20) {
printf("FAIL: could not recover correct timestamp.\n");
abort();
......@@ -228,8 +233,10 @@ void test_log_timestamps(struct logger_writer *log) {
t = 0;
time = 0;
mask = logger_read_timestamp(log, &t, &time, &offset, (const char *)d->data);
printf("Recovered timestamp %020llu with time %g at offset %#016zx with mask %#04x.\n", t,
time, offset_old, mask);
printf(
"Recovered timestamp %020llu with time %g at offset %#016zx with mask "
"%#04x.\n",
t, time, offset_old, mask);
if (t != 10) {
printf("FAIL: could not recover correct timestamp.\n");
abort();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment