Use C++20. (#2322)

This commit is contained in:
Tejas Rao
2024-04-26 12:49:15 -07:00
committed by GitHub
parent 9288775351
commit 7fb8c76590
16 changed files with 29 additions and 16 deletions

View File

@@ -9,6 +9,7 @@
#include <iostream>
#include <thread>
#include <unordered_map>
#include <utility>
#include <boost/asio.hpp>
#include <boost/filesystem.hpp>

View File

@@ -7,6 +7,7 @@
#include "process.h"
#include <filesystem>
#include <utility>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>

View File

@@ -7,6 +7,7 @@
#include "logging.h"
#include "utility.h"
#include <algorithm>
#include <sstream>
using namespace std::literals;
@@ -169,7 +170,9 @@ namespace net {
addr_to_url_escaped_string(boost::asio::ip::address address) {
address = normalize_address(address);
if (address.is_v6()) {
return "["s + address.to_string() + ']';
std::stringstream ss;
ss << '[' << address.to_string() << ']';
return ss.str();
}
else {
return address.to_string();

View File

@@ -5,6 +5,7 @@
#pragma once
#include <tuple>
#include <utility>
#include <boost/asio.hpp>

View File

@@ -8,6 +8,7 @@
// standard includes
#include <filesystem>
#include <utility>
// lib includes
#include <Simple-Web-Server/server_http.hpp>

View File

@@ -262,7 +262,7 @@ namespace cuda {
fs::path sysfs_dir { sysfs_path };
for (auto &entry : fs::directory_iterator { sysfs_dir }) {
auto file = entry.path().filename();
auto filestring = file.generic_u8string();
auto filestring = file.generic_string();
if (std::string_view { filestring }.substr(0, 4) != "card"sv) {
continue;
}
@@ -1049,4 +1049,4 @@ namespace platf {
return display_names;
}
} // namespace platf
} // namespace platf

View File

@@ -1510,7 +1510,7 @@ namespace platf {
std::stringstream ss;
ss << std::hex << std::setfill('0');
for (const auto &ch : str) {
ss << ch;
ss << static_cast<uint_least32_t>(ch);
}
std::string hex_unicode(ss.str());

View File

@@ -614,7 +614,7 @@ namespace platf {
for (auto &entry : fs::directory_iterator { card_dir }) {
auto file = entry.path().filename();
auto filestring = file.generic_u8string();
auto filestring = file.generic_string();
if (filestring.size() < 4 || std::string_view { filestring }.substr(0, 4) != "card"sv) {
continue;
}
@@ -1641,7 +1641,7 @@ namespace platf {
for (auto &entry : fs::directory_iterator { card_dir }) {
auto file = entry.path().filename();
auto filestring = file.generic_u8string();
auto filestring = file.generic_string();
if (std::string_view { filestring }.substr(0, 4) != "card"sv) {
continue;
}

View File

@@ -1411,7 +1411,7 @@ namespace platf {
ds4_update_state(gamepad_context_t &gamepad, const gamepad_state_t &gamepad_state) {
auto &report = gamepad.report.ds4.Report;
report.wButtons = ds4_buttons(gamepad_state) | ds4_dpad(gamepad_state);
report.wButtons = static_cast<uint16_t>(ds4_buttons(gamepad_state)) | static_cast<uint16_t>(ds4_dpad(gamepad_state));
report.bSpecial = ds4_special_buttons(gamepad_state);
report.bTriggerL = gamepad_state.lt;

View File

@@ -1691,8 +1691,8 @@ namespace platf {
}
int64_t
qpc_counter() {
LARGE_INTEGER performace_counter;
if (QueryPerformanceCounter(&performace_counter)) return performace_counter.QuadPart;
LARGE_INTEGER performance_counter;
if (QueryPerformanceCounter(&performance_counter)) return performance_counter.QuadPart;
return 0;
}

View File

@@ -11,6 +11,7 @@ extern "C" {
#include <array>
#include <cctype>
#include <utility>
#include <boost/asio.hpp>
#include <boost/bind.hpp>

View File

@@ -3,6 +3,7 @@
* @brief todo
*/
#pragma once
#include <utility>
#include <boost/asio.hpp>