summaryrefslogtreecommitdiff
path: root/src/helpers/MiscFunctions.cpp
diff options
context:
space:
mode:
authorPhilip Damianik <39028343+pdamianik@users.noreply.github.com>2023-09-06 21:45:37 +0200
committerGitHub <noreply@github.com>2023-09-06 21:45:37 +0200
commit8c83852704ad8d78b839bd532d73b3b9e44724b9 (patch)
tree6e750b39b0b6af35c9a0b3b1385a7925936bcecd /src/helpers/MiscFunctions.cpp
parent60c01dab01e3b58abf12c49f4a2fb224900ae401 (diff)
internal: Remove all `.c_str()` calls when using `std::vformat` (#3198)
Signed-off-by: pdamianik <39028343+pdamianik@users.noreply.github.com>
Diffstat (limited to 'src/helpers/MiscFunctions.cpp')
-rw-r--r--src/helpers/MiscFunctions.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/helpers/MiscFunctions.cpp b/src/helpers/MiscFunctions.cpp
index d07ad833..5ded4f4f 100644
--- a/src/helpers/MiscFunctions.cpp
+++ b/src/helpers/MiscFunctions.cpp
@@ -210,7 +210,7 @@ float getPlusMinusKeywordResult(std::string source, float relative) {
try {
return relative + stof(source);
} catch (...) {
- Debug::log(ERR, "Invalid arg \"{}\" in getPlusMinusKeywordResult!", source.c_str());
+ Debug::log(ERR, "Invalid arg \"{}\" in getPlusMinusKeywordResult!", source);
return INT_MAX;
}
}
@@ -537,7 +537,7 @@ void logSystemInfo() {
#else
const std::string GPUINFO = execAndGet("lspci -vnn | grep VGA");
#endif
- Debug::log(LOG, "GPU information:\n{}\n", GPUINFO.c_str());
+ Debug::log(LOG, "GPU information:\n{}\n", GPUINFO);
if (GPUINFO.contains("NVIDIA")) {
Debug::log(WARN, "Warning: you're using an NVIDIA GPU. Make sure you follow the instructions on the wiki if anything is amiss.\n");
@@ -546,7 +546,7 @@ void logSystemInfo() {
// log etc
Debug::log(LOG, "os-release:");
- Debug::log(NONE, "{}", execAndGet("cat /etc/os-release").c_str());
+ Debug::log(NONE, "{}", execAndGet("cat /etc/os-release"));
}
void matrixProjection(float mat[9], int w, int h, wl_output_transform tr) {
@@ -590,8 +590,8 @@ int64_t getPPIDof(int64_t pid) {
return 0;
#else
- std::string dir = "/proc/" + std::to_string(pid) + "/status";
- FILE* infile;
+ std::string dir = "/proc/" + std::to_string(pid) + "/status";
+ FILE* infile;
infile = fopen(dir.c_str(), "r");
if (!infile)
@@ -702,7 +702,7 @@ std::vector<SCallstackFrameInfo> getBacktrace() {
}
void throwError(const std::string& err) {
- Debug::log(CRIT, "Critical error thrown: {}", err.c_str());
+ Debug::log(CRIT, "Critical error thrown: {}", err);
throw std::runtime_error(err);
}