forked from pool/systemtap
d090c61581
- Add gcc12 support (bsc#1196583) New patch: PR28778-gcc-warning-tweak-for-sprintf-precision-parameter.patch New patch: gcc12-c-compatibility-tweak-use-lambdas-instead-of-ptr_fun.patch New patch: gcc12-c-compatibility-re-tweak-for-rhel6-use-function-pointer-instead-of-lambdas-instead-of-ptr_fun.patch New patch: buildrun-for-LKM-backend-add-Wno-infinite-recursion.patch New patch: gcc12-warning-suppression.patch - Add gcc12 support (bsc#1196583) New patch: PR28778-gcc-warning-tweak-for-sprintf-precision-parameter.patch New patch: gcc12-c-compatibility-tweak-use-lambdas-instead-of-ptr_fun.patch New patch: gcc12-c-compatibility-re-tweak-for-rhel6-use-function-pointer-instead-of-lambdas-instead-of-ptr_fun.patch New patch: buildrun-for-LKM-backend-add-Wno-infinite-recursion.patch New patch: gcc12-warning-suppression.patch - Add gcc12 support (bsc#1196583) New patch: PR28778-gcc-warning-tweak-for-sprintf-precision-parameter.patch New patch: gcc12-c-compatibility-tweak-use-lambdas-instead-of-ptr_fun.patch New patch: gcc12-c-compatibility-re-tweak-for-rhel6-use-function-pointer-instead-of-lambdas-instead-of-ptr_fun.patch New patch: buildrun-for-LKM-backend-add-Wno-infinite-recursion.patch New patch: gcc12-warning-suppression.patch OBS-URL: https://build.opensuse.org/request/show/958520 OBS-URL: https://build.opensuse.org/package/show/devel:tools/systemtap?expand=0&rev=134
39 lines
1.1 KiB
Diff
39 lines
1.1 KiB
Diff
From: Jonathan Wakely <jwakely.gcc@gmail.com>
|
|
Date: Tue, 18 Jan 2022 15:52:18 -0500
|
|
Subject: gcc12 c++ compatibility tweak: use lambdas instead of ptr_fun<>
|
|
Git-repo: git://sourceware.org/git/systemtap.git
|
|
Git-commit: 56c498d95c4749f15980da73b4933e7443b3f26c
|
|
References: bsc#1196583
|
|
|
|
Even while stap is a c++11 code base, such cleanups make code
|
|
nicer to look at.
|
|
|
|
Signed-off-by: Tony Jones <tonyj@suse.de>
|
|
---
|
|
util.cxx | 4 ++--
|
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/util.cxx b/util.cxx
|
|
index c20f76003..e9286eca3 100644
|
|
--- a/util.cxx
|
|
+++ b/util.cxx
|
|
@@ -1763,7 +1763,7 @@ ltrim(std::string &s)
|
|
{
|
|
s.erase(s.begin(),
|
|
std::find_if(s.begin(), s.end(),
|
|
- std::not1(std::ptr_fun<int, int>(std::isspace))));
|
|
+ [](unsigned char c) { return !std::isspace(c); }));
|
|
}
|
|
|
|
// trim from end (in place)
|
|
@@ -1771,7 +1771,7 @@ void
|
|
rtrim(std::string &s)
|
|
{
|
|
s.erase(std::find_if(s.rbegin(), s.rend(),
|
|
- std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
|
|
+ [](unsigned char c) { return !std::isspace(c); }).base(), s.end());
|
|
}
|
|
|
|
// trim from both ends (in place)
|
|
|