Skip to content

Commit 8048636

Browse files
fix(core): Fix the minimum input version, so it does not enforce to be the last one
1 parent 7186f95 commit 8048636

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

source/IO.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,6 @@ IO::IO(moordyn::Log* log)
199199
, _min_minor_version(4)
200200
{
201201
_is_big_endian = is_big_endian();
202-
if (_min_major_version <= MOORDYN_MAJOR_VERSION) {
203-
_min_major_version = MOORDYN_MAJOR_VERSION;
204-
if (_min_minor_version <= MOORDYN_MINOR_VERSION)
205-
_min_minor_version = MOORDYN_MINOR_VERSION;
206-
}
207202
}
208203

209204
void
@@ -283,11 +278,17 @@ IO::LoadFile(const std::string filepath) const
283278
uint8_t major, minor;
284279
f.read((char*)&major, sizeof(uint8_t));
285280
f.read((char*)&minor, sizeof(uint8_t));
281+
std::cout << major << std::endl;
282+
std::cout << minor << std::endl;
283+
std::cout << _min_major_version << std::endl;
284+
std::cout << _min_minor_version << std::endl;
285+
std::cout << "number=" << 7 << std::endl;
286286
if ((major < _min_major_version) ||
287287
((major == _min_major_version) && (minor < _min_minor_version))) {
288288
LOGERR << "The file '" << filepath << "' was written by MoorDyn "
289-
<< major << "." << minor << ", but >= " << _min_major_version
290-
<< "." << _min_minor_version << " is required" << endl;
289+
<< (int)major << "." << (int)minor << ", but >= "
290+
<< (int)_min_major_version << "." << (int)_min_minor_version
291+
<< " is required" << endl;
291292
throw moordyn::input_file_error("Invalid file");
292293
}
293294
// Check that the amount of information is correct

0 commit comments

Comments
 (0)