Skip to content
This repository was archived by the owner on Apr 24, 2022. It is now read-only.

Fix C4244 MSVC warnings. #948

Merged
merged 1 commit into from
Mar 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions cmake/EthCompilerSettings.cmake
Original file line number Diff line number Diff line change
@@ -33,12 +33,10 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
# enable parallel compilation
# specify Exception Handling Model
# enable LTCG for faster builds
# disable qualifier applied to function type has no meaning; ignored (4180)
# disable conversion from 'type1' to 'type2', possible loss of data (4244)
# disable conversion from 'size_t' to 'type', possible loss of data (4267)
# disable C++ exception specification ignored except to indicate a function is not __declspec(nothrow) (4290)
# disable decorated name length exceeded, name was truncated (4503)
add_compile_options(/MP /EHsc /GL /wd4180 /wd4244 /wd4267 /wd4290 /wd4503)
# disable conversion from 'size_t' to 'type', possible loss of data (C4267)
# disable C++ exception specification ignored except to indicate a function is not __declspec(nothrow) (C4290)
# disable decorated name length exceeded, name was truncated (C4503)
add_compile_options(/MP /EHsc /GL /wd4267 /wd4290 /wd4503)

# enable LTCG for faster builds
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG")
4 changes: 2 additions & 2 deletions libethcore/Farm.h
Original file line number Diff line number Diff line change
@@ -208,7 +208,7 @@ class Farm: public FarmFace
m_lastProgresses.push_back(p);

// We smooth the hashrate over the last x seconds
int allMs = 0;
uint64_t allMs = 0;
for (auto const& cp : m_lastProgresses)
allMs += cp.ms;

@@ -439,7 +439,7 @@ class Farm: public FarmFace
bool b_lastMixed = false;

std::chrono::steady_clock::time_point m_lastStart;
int m_hashrateSmoothInterval = 10000;
uint64_t m_hashrateSmoothInterval = 10000;
std::thread m_serviceThread; ///< The IO service thread.
boost::asio::io_service m_io_service;
boost::asio::deadline_timer m_hashrateTimer;
2 changes: 1 addition & 1 deletion libhwmon/wrapadl.cpp
Original file line number Diff line number Diff line change
@@ -287,7 +287,7 @@ int wrap_adl_get_power_usage(wrap_adl_handle *adlh, int gpuindex, unsigned int*

int power = 0;
rc = adlh->adl2Overdrive6CurrentPowerGet(adlh->context, adlh->phys_logi_device_id[gpuindex], 0, &power);
*miliwatts = power * 3.90625;
*miliwatts = (unsigned int)(power * 3.90625);
return rc;
}

2 changes: 1 addition & 1 deletion libhwmon/wrapamdsysfs.cpp
Original file line number Diff line number Diff line change
@@ -312,7 +312,7 @@ int wrap_amdsysfs_get_fanpcnt(wrap_amdsysfs_handle *sysfsh, int index, unsigned
gpuindex, hwmonindex);
getFileContentValue(dbuf, pwmMin);

*fanpcnt = double(pwm - pwmMin) / double(pwmMax - pwmMin) * 100.0;
*fanpcnt = (unsigned int)(double(pwm - pwmMin) / double(pwmMax - pwmMin) * 100.0);
return 0;
}