diff options
author | Chris Johns <chrisj@rtems.org> | 2023-11-22 14:31:03 +1100 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2023-11-22 14:34:16 +1100 |
commit | f408c0f8d935d53c232c67bed39e4018fd8d7a2a (patch) | |
tree | f3e6ca2734e5995e5850f436181ebe7263a7b8a0 /rtemstoolkit | |
parent | rtemstoolkit: Update SimpleIni to latest (diff) | |
download | rtems-tools-f408c0f8d935d53c232c67bed39e4018fd8d7a2a.tar.bz2 |
rtemstoolkit, linkers: Fix C++17 warnings
Closes #4970
Diffstat (limited to 'rtemstoolkit')
-rw-r--r-- | rtemstoolkit/rld-elf.cpp | 12 | ||||
-rw-r--r-- | rtemstoolkit/rld-elf.h | 5 | ||||
-rw-r--r-- | rtemstoolkit/rld-rap.cpp | 9 | ||||
-rw-r--r-- | rtemstoolkit/rld.cpp | 14 |
4 files changed, 10 insertions, 30 deletions
diff --git a/rtemstoolkit/rld-elf.cpp b/rtemstoolkit/rld-elf.cpp index 68efdbe..8b55818 100644 --- a/rtemstoolkit/rld-elf.cpp +++ b/rtemstoolkit/rld-elf.cpp @@ -200,18 +200,6 @@ namespace rld << std::endl; } - section::section (const section& orig) - : file_ (orig.file_), - index_ (orig.index_), - name_ (orig.name_), - scn (orig.scn), - shdr (orig.shdr), - data_ (orig.data_), - rela (orig.rela), - relocs (orig.relocs) - { - } - section::section () : file_ (0), index_ (-1), diff --git a/rtemstoolkit/rld-elf.h b/rtemstoolkit/rld-elf.h index 4919135..d66eee5 100644 --- a/rtemstoolkit/rld-elf.h +++ b/rtemstoolkit/rld-elf.h @@ -175,11 +175,6 @@ namespace rld section (file& file_, int index); /** - * Copy constructor. - */ - section (const section& orig); - - /** * Default constructor. */ section (); diff --git a/rtemstoolkit/rld-rap.cpp b/rtemstoolkit/rld-rap.cpp index 93ffbdc..045536a 100644 --- a/rtemstoolkit/rld-rap.cpp +++ b/rtemstoolkit/rld-rap.cpp @@ -696,8 +696,7 @@ namespace rld * Helper for for_each to merge the related object sections into the RAP * section. */ - class section_merge: - public std::unary_function < const files::section, void > + class section_merge { public: @@ -1191,8 +1190,7 @@ namespace rld /** * Helper for for_each to write out the various sections. */ - class section_writer: - public std::unary_function < object, void > + class section_writer { public: @@ -1364,8 +1362,6 @@ namespace rld void image::write_relocations (compress::compressor& comp) { - uint32_t rr = 0; - for (int s = 0; s < rap_secs; ++s) { uint32_t count = get_relocations (s); @@ -1515,7 +1511,6 @@ namespace rld ++rc; ++sr; - ++rr; } } } diff --git a/rtemstoolkit/rld.cpp b/rtemstoolkit/rld.cpp index 90fb39d..d0848ad 100644 --- a/rtemstoolkit/rld.cpp +++ b/rtemstoolkit/rld.cpp @@ -106,9 +106,10 @@ namespace rld ltrim (const std::string& s) { std::string t = s; - t.erase (t.begin (), - std::find_if (t.begin (), t.end (), - std::not1 (std::ptr_fun < int, int > (std::isspace)))); + auto non_space = + std::find_if (t.begin (), t.end (), + [](unsigned char c) { return !std::isspace (c); }); + t.erase (t.begin (), non_space); return t; } @@ -116,9 +117,10 @@ namespace rld rtrim (const std::string& s) { std::string t = s; - t.erase (std::find_if (t.rbegin (), t.rend (), - std::not1 (std::ptr_fun < int, int > (std::isspace))).base(), - t.end()); + auto last_space = + std::find_if (t.rbegin (), t.rend (), + [](unsigned char c) { return !std::isspace (c); }).base(); + t.erase (last_space, t.end()); return t; } |