From 9b148414b67e748dab49d667c53f2e359e4f0f0f Mon Sep 17 00:00:00 2001 From: Guilhem Lavaux Date: Wed, 11 Nov 2020 10:46:27 +0100 Subject: [PATCH] Fixup --- python/_cosmo_power.pyx | 2 +- src/fortran.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/python/_cosmo_power.pyx b/python/_cosmo_power.pyx index 2d01e72..bf4bd4b 100644 --- a/python/_cosmo_power.pyx +++ b/python/_cosmo_power.pyx @@ -81,7 +81,7 @@ cdef class CosmologyPower: if 'ns' in cosmo: self.power.n = cosmo['ns'] if 'T27' in cosmo: - self.power.THETA_27 = cosmo['T27'] + self.power.Theta_27 = cosmo['T27'] assert self.power.OMEGA_C > 0 diff --git a/src/fortran.cpp b/src/fortran.cpp index 83e9730..376d62d 100644 --- a/src/fortran.cpp +++ b/src/fortran.cpp @@ -143,10 +143,16 @@ void UnformattedRead::endCheckpoint(bool autodrop) delete[] recordBuffer; recordBuffer = 0; } + if (cSize == Check_32bits) { + if (checkPointAccum >= 1<<32UL) { + always_fail = true; + checkPointAccum %= (1<<32UL); + } + } if (checkPointRef != checkPointAccum) { - if (!autodrop || checkPointAccum > checkPointRef) { + if (always_fail || !autodrop || checkPointAccum > checkPointRef) { throw InvalidUnformattedAccess(); } f->seekg(checkPointRef-checkPointAccum, ios::cur);