From 5f1eb9a12821e7462b7b2853e0d95c8c863bf900 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 26 Jul 2018 16:55:17 -0400 Subject: now using const passing of object reference instead of pointers --- lib/measure.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/measure.h') diff --git a/lib/measure.h b/lib/measure.h index 8082dd2..2c5ffb7 100644 --- a/lib/measure.h +++ b/lib/measure.h @@ -29,17 +29,17 @@ FILE **measure_setup_files(unsigned char flags, unsigned long timestamp) { } template -std::function *)> measure_function_write_files(unsigned char flags, FILE **files, std::function *)> other_f) { - return [=] (const state_t *s) { +std::function &)> measure_function_write_files(unsigned char flags, FILE **files, std::function &)> other_f) { + return [=] (const state_t & s) { if (flags & measurement_energy) { - float smaller_E = (float)s->E; + float smaller_E = (float)s.E; fwrite(&smaller_E, sizeof(float), 1, files[0]); } if (flags & measurement_clusterSize) { - fwrite(&(s->last_cluster_size), sizeof(uint32_t), 1, files[1]); + fwrite(&(s.last_cluster_size), sizeof(uint32_t), 1, files[1]); } if (flags & measurement_magnetization) { - write_magnetization(s->M, files[2]); + write_magnetization(s.M, files[2]); } if (flags & measurement_fourierZero) { float smaller_X = (float)correlation_length(s); -- cgit v1.2.3-70-g09d2