Commit 95743c6e authored by Kitware Robot's avatar Kitware Robot Committed by Utkarsh Ayachit
Browse files

diy 2018-03-10 (08f19c67)

Code extracted from:

    https://gitlab.kitware.com/third-party/diy2.git

at commit 08f19c677d84e08d9e7ee301c98db04c2bc2c7bd (for/vtk-m).
parent 5dedd3c6
......@@ -24,8 +24,8 @@ namespace diy
// TODO: add error checking
virtual inline void save_binary(const char* x, size_t count) override { fwrite(x, 1, count, file); head += count; }
virtual inline void load_binary(char* x, size_t count) override { fread(x, 1, count, file); }
virtual inline void load_binary_back(char* x, size_t count) override { fseek(file, static_cast<long>(tail), SEEK_END); fread(x, 1, count, file); tail += count; fseek(file, static_cast<long>(head), SEEK_SET); }
virtual inline void load_binary(char* x, size_t count) override { auto n = fread(x, 1, count, file); (void) n;}
virtual inline void load_binary_back(char* x, size_t count) override { fseek(file, static_cast<long>(tail), SEEK_END); auto n = fread(x, 1, count, file); tail += count; fseek(file, static_cast<long>(head), SEEK_SET); (void) n;}
size_t size() const { return head; }
......@@ -127,7 +127,7 @@ namespace diy
_read(fh, &bb.buffer[0], static_cast<unsigned int>(fr.size));
#else
int fh = open(fr.name.c_str(), O_RDONLY | O_SYNC, 0600);
read(fh, &bb.buffer[0], fr.size);
auto n = read(fh, &bb.buffer[0], fr.size); (void) n;
#endif
io::utils::close(fh);
remove_file(fr);
......
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