aboutsummaryrefslogtreecommitdiffstats
path: root/core/ambdec.cpp
diff options
context:
space:
mode:
authorRosen Penev <[email protected]>2023-01-15 13:43:27 -0800
committerGitHub <[email protected]>2023-01-15 13:43:27 -0800
commit0526ecd2f95877b167293e50ab8ce0ce614d03f4 (patch)
treead80a5811292e87601020f6aadcb2f6ff138761d /core/ambdec.cpp
parentd9d445772c50e53c12ab77d97cc5f3a76839d83a (diff)
clang-tidy cleanups (#800)
* clang-tidy: use bool literals Found with modernize-use-bool-literals Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: replace std::bind with lambdas Found with modernize-avoid-bind Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: use data() instead of pointer stuff Found with readability-container-data-pointe Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: use empty() Found with readability-container-size-empty Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: remove static in anon namespace Found with readability-static-definition-in-anonymous-namespace Signed-off-by: Rosen Penev <[email protected]> * clang-tidy: remove const return Found with readability-const-return-type Signed-off-by: Rosen Penev <[email protected]> Signed-off-by: Rosen Penev <[email protected]>
Diffstat (limited to 'core/ambdec.cpp')
-rw-r--r--core/ambdec.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/ambdec.cpp b/core/ambdec.cpp
index 52a1df05..5e2de6af 100644
--- a/core/ambdec.cpp
+++ b/core/ambdec.cpp
@@ -53,7 +53,7 @@ al::optional<std::string> make_error(size_t linenum, const char *fmt, ...)
auto &str = ret.emplace();
str.resize(256);
- int printed{std::snprintf(&str[0], str.length(), "Line %zu: ", linenum)};
+ int printed{std::snprintf(const_cast<char*>(str.data()), str.length(), "Line %zu: ", linenum)};
if(printed < 0) printed = 0;
auto plen = std::min(static_cast<size_t>(printed), str.length());