fix warnings

This commit is contained in:
Bechir
2024-04-05 16:04:01 +02:00
parent 3c58039502
commit 2f23e4610d
9 changed files with 25 additions and 17 deletions

View File

@ -12,7 +12,12 @@ class RawFile : public FileInterface {
public:
std::filesystem::path m_fname; // TO be made private!
void write(Frame &frame) override{};
// pragma to ignore warnings
void write(Frame &frame) override{
throw std::runtime_error("Not implemented");
};
Frame read() override { return get_frame(this->current_frame++); };
std::vector<Frame> read(size_t n_frames) override;
void read_into(std::byte *image_buf) override { return get_frame_into(this->current_frame++, image_buf); };

View File

@ -89,7 +89,7 @@ template <typename DataType> size_t SubFile::read_impl_flip(std::byte *buffer) {
size_t SubFile::frame_number(int frame_index) {
sls_detector_header h{};
FILE *fp = fopen(this->m_fname.c_str(), "r");
fp = fopen(this->m_fname.c_str(), "r");
if (!fp)
throw std::runtime_error(fmt::format("Could not open: {} for reading", m_fname.c_str()));
fseek(fp, (sizeof(sls_detector_header) + bytes_per_part()) * frame_index, SEEK_SET);

View File

@ -19,7 +19,7 @@ TEST_CASE("Read a 1D numpy file with int32 data type") {
// use the load function to read the full file into a NDArray
auto data = f.load<int32_t, 1>();
for (size_t i = 0; i < 10; i++) {
for (int32_t i = 0; i < 10; i++) {
REQUIRE(data(i) == i);
}
}