Skip to content

Commit

Permalink
Merge pull request #3040 from randaz81/cpp20_fixes
Browse files Browse the repository at this point in the history
CPP20 fixes cumulative pack
  • Loading branch information
randaz81 authored Nov 8, 2023
2 parents 4a94471 + 2b417a0 commit 8c67fd1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,8 @@ class template_ofstream_with_content_based_conditional_update : public std::ostr
old_file.open(output_file_path.c_str(), std::ios::in);

if (old_file) {
std::string const old_file_contents(static_cast<std::ostringstream const&>(std::ostringstream() << old_file.rdbuf()).str());
std::ostringstream oss;
std::string const old_file_contents(static_cast<std::ostringstream const&>(oss << old_file.rdbuf()).str());
old_file.close();

if (old_file_contents != str()) {
Expand Down
6 changes: 3 additions & 3 deletions src/libYARP_math/src/yarp/math/Vec2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class YARP_math_API Vec2D :
T x;
T y;

Vec2D<T>();
Vec2D<T>(const T& x_value, const T& y_value);
Vec2D<T>(const yarp::sig::Vector& v);
Vec2D();
Vec2D(const T& x_value, const T& y_value);
Vec2D(const yarp::sig::Vector& v);
explicit operator yarp::sig::Vector() const
{
yarp::sig::Vector v(2);
Expand Down
10 changes: 8 additions & 2 deletions src/libYARP_os/src/yarp/os/SystemInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,10 +871,16 @@ SystemInfo::ProcessInfo SystemInfo::getProcessInfo(int pid)
hr = CoCreateInstance(CLSID_WbemLocator, 0, CLSCTX_INPROC_SERVER, IID_IWbemLocator, (LPVOID*)&WbemLocator);
if (WbemLocator != nullptr) {
//connect to the WMI
hr = WbemLocator->ConnectServer(L"ROOT\\CIMV2", nullptr, nullptr, 0, 0, 0, 0, &WbemServices);
BSTR val1 = SysAllocString(L"ROOT\\CimV2");
hr = WbemLocator->ConnectServer(val1, nullptr, nullptr, 0, 0, 0, 0, &WbemServices);
SysFreeString(val1);
if (WbemServices != nullptr) {
//Run the WQL Query
hr = WbemServices->ExecQuery(L"WQL", L"SELECT ProcessId, CommandLine FROM Win32_Process", WBEM_FLAG_FORWARD_ONLY, nullptr, &EnumWbem);
BSTR val2 = SysAllocString(L"WQL");
BSTR val3 = SysAllocString(L"SELECT ProcessId, CommandLine FROM Win32_Process");
hr = WbemServices->ExecQuery(val2, val3, WBEM_FLAG_FORWARD_ONLY, nullptr, &EnumWbem);
SysFreeString(val2);
SysFreeString(val3);
// Iterate over the enumerator
if (EnumWbem != nullptr) {
IWbemClassObject* result = nullptr;
Expand Down

0 comments on commit 8c67fd1

Please sign in to comment.