diff --git a/src/solver/utils/ortools_utils.cpp b/src/solver/utils/ortools_utils.cpp index 2ba68547d1..3da6c8cf6c 100644 --- a/src/solver/utils/ortools_utils.cpp +++ b/src/solver/utils/ortools_utils.cpp @@ -63,10 +63,10 @@ void OrtoolsLogHandler::init() { #ifdef __linux__ if (log_file_per_thread_.empty() - || (file_pointer = fopen(log_file_per_thread_.string().c_str(), "a+")) == nullptr) + || (file_pointer_ = fopen(log_file_per_thread_.string().c_str(), "a+")) == nullptr) #elif _WIN32 if (log_file_per_thread_.empty() - || (file_pointer = _fsopen(log_file_per_thread_.string().c_str(), "a+", _SH_DENYNO)) + || (file_pointer_ = _fsopen(log_file_per_thread_.string().c_str(), "a+", _SH_DENYNO)) == nullptr) #endif { @@ -76,7 +76,7 @@ void OrtoolsLogHandler::init() } else { - setvbuf(file_pointer, nullptr, _IONBF, 0); + setvbuf(file_pointer_, nullptr, _IONBF, 0); } } else @@ -87,10 +87,10 @@ void OrtoolsLogHandler::init() OrtoolsLogHandler::~OrtoolsLogHandler() { - if (file_pointer) + if (file_pointer_) { - fclose(file_pointer); - file_pointer = nullptr; + fclose(file_pointer_); + file_pointer_ = nullptr; } } diff --git a/src/solver/utils/ortools_utils.h b/src/solver/utils/ortools_utils.h index 1b0c9fe680..a7a0da65f8 100644 --- a/src/solver/utils/ortools_utils.h +++ b/src/solver/utils/ortools_utils.h @@ -81,7 +81,7 @@ class OrtoolsLogHandler : public LogHandlerInterface FILE* where_to_write() { - return file_pointer; + return file_pointer_; } void copy_log(Solver::IResultWriter& writer) const; @@ -90,11 +90,12 @@ class OrtoolsLogHandler : public LogHandlerInterface void init(); std::ofstream log_writer_; - FILE* file_pointer = nullptr; + FILE* file_pointer_ = nullptr; std::string solver_name_; std::filesystem::path log_directory_ = "."; std::filesystem::path log_file_per_thread_ = ""; }; + class Nomenclature { public: