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

Commit de2ae4f

Browse files
committedMar 28, 2018
Fix C4244 MSVC warnings.
1 parent fe98290 commit de2ae4f

File tree

4 files changed

+8
-10
lines changed

4 files changed

+8
-10
lines changed
 

‎cmake/EthCompilerSettings.cmake

+4-6
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,10 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
3333
# enable parallel compilation
3434
# specify Exception Handling Model
3535
# enable LTCG for faster builds
36-
# disable qualifier applied to function type has no meaning; ignored (4180)
37-
# disable conversion from 'type1' to 'type2', possible loss of data (4244)
38-
# disable conversion from 'size_t' to 'type', possible loss of data (4267)
39-
# disable C++ exception specification ignored except to indicate a function is not __declspec(nothrow) (4290)
40-
# disable decorated name length exceeded, name was truncated (4503)
41-
add_compile_options(/MP /EHsc /GL /wd4180 /wd4244 /wd4267 /wd4290 /wd4503)
36+
# disable conversion from 'size_t' to 'type', possible loss of data (C4267)
37+
# disable C++ exception specification ignored except to indicate a function is not __declspec(nothrow) (C4290)
38+
# disable decorated name length exceeded, name was truncated (C4503)
39+
add_compile_options(/MP /EHsc /GL /wd4267 /wd4290 /wd4503)
4240

4341
# enable LTCG for faster builds
4442
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /LTCG")

‎libethcore/Farm.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ class Farm: public FarmFace
208208
m_lastProgresses.push_back(p);
209209

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

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

441441
std::chrono::steady_clock::time_point m_lastStart;
442-
int m_hashrateSmoothInterval = 10000;
442+
uint64_t m_hashrateSmoothInterval = 10000;
443443
std::thread m_serviceThread; ///< The IO service thread.
444444
boost::asio::io_service m_io_service;
445445
boost::asio::deadline_timer m_hashrateTimer;

‎libhwmon/wrapadl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ int wrap_adl_get_power_usage(wrap_adl_handle *adlh, int gpuindex, unsigned int*
287287

288288
int power = 0;
289289
rc = adlh->adl2Overdrive6CurrentPowerGet(adlh->context, adlh->phys_logi_device_id[gpuindex], 0, &power);
290-
*miliwatts = power * 3.90625;
290+
*miliwatts = (unsigned int)(power * 3.90625);
291291
return rc;
292292
}
293293

‎libhwmon/wrapamdsysfs.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ int wrap_amdsysfs_get_fanpcnt(wrap_amdsysfs_handle *sysfsh, int index, unsigned
312312
gpuindex, hwmonindex);
313313
getFileContentValue(dbuf, pwmMin);
314314

315-
*fanpcnt = double(pwm - pwmMin) / double(pwmMax - pwmMin) * 100.0;
315+
*fanpcnt = (unsigned int)(double(pwm - pwmMin) / double(pwmMax - pwmMin) * 100.0);
316316
return 0;
317317
}
318318

0 commit comments

Comments
 (0)
This repository has been archived.