mirror of
https://github.com/otakuto/crazydiskinfo.git
synced 2025-07-23 06:35:49 +00:00
support c++11
This commit is contained in:
parent
d39417c165
commit
9e69b80b10
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
cmake_minimum_required(VERSION 3.0.0)
|
cmake_minimum_required(VERSION 2.8.0)
|
||||||
project(CrazyDiskInfo CXX)
|
project(CrazyDiskInfo CXX)
|
||||||
add_executable(CrazyDiskInfo main.cpp)
|
add_executable(CrazyDiskInfo main.cpp)
|
||||||
set(CMAKE_CXX_FLAGS "-Wall -std=c++14")
|
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
|
||||||
SET_TARGET_PROPERTIES(CrazyDiskInfo PROPERTIES OUTPUT_NAME crazy)
|
SET_TARGET_PROPERTIES(CrazyDiskInfo PROPERTIES OUTPUT_NAME crazy)
|
||||||
target_link_libraries(CrazyDiskInfo atasmart)
|
target_link_libraries(CrazyDiskInfo atasmart)
|
||||||
target_link_libraries(CrazyDiskInfo ncursesw)
|
target_link_libraries(CrazyDiskInfo ncursesw)
|
||||||
|
|
4
main.cpp
4
main.cpp
|
@ -161,7 +161,7 @@ Health attributeToHealth(Attribute const & attribute)
|
||||||
|
|
||||||
Health smartToHealth(SMART const & smart)
|
Health smartToHealth(SMART const & smart)
|
||||||
{
|
{
|
||||||
return attributeToHealth(*std::max_element(smart.attribute.cbegin(), smart.attribute.cend(), [](auto lhs, auto rhs)
|
return attributeToHealth(*std::max_element(smart.attribute.cbegin(), smart.attribute.cend(), [](Attribute const & lhs, Attribute const & rhs)
|
||||||
{
|
{
|
||||||
return static_cast<int>(attributeToHealth(lhs)) < static_cast<int>(attributeToHealth(rhs));
|
return static_cast<int>(attributeToHealth(lhs)) < static_cast<int>(attributeToHealth(rhs));
|
||||||
}));
|
}));
|
||||||
|
@ -426,7 +426,7 @@ int main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::sort(smartList.begin(), smartList.end(), [](auto lhs, auto rhs){return lhs.deviceName < rhs.deviceName;});
|
std::sort(smartList.begin(), smartList.end(), [](SMART const & lhs, SMART const & rhs){return lhs.deviceName < rhs.deviceName;});
|
||||||
|
|
||||||
if (smartList.size() == 0)
|
if (smartList.size() == 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue