C++17 introduction and minor clean-ups#453
Conversation
| @@ -1,3 +1,34 @@ | |||
| /* | |||
There was a problem hiding this comment.
Not much to see here (and in bmap.h), just some missing license headers.
There was a problem hiding this comment.
It is okay to add BSD license headers, just remove copy write line.
There was a problem hiding this comment.
I dropped the Copyright ... lines.
| static bool g_small_memory = true; | ||
|
|
||
| #define MAGIC_PATH '>' | ||
| static constexpr char MAGIC_PATH = '>'; |
There was a problem hiding this comment.
To my knowledge #defines are generally being frowned upon today. I took the switch to C++17 as an opportunity to replace all of these which defined constants by constexpr "variables".
|
|
||
| virtual int Decompress(const string& /*backfifle*/, shared_ptr<FileBuffer> /*outp*/) { return 0; }; | ||
| virtual bool seekable(const string& /*backfile*/) { return false; } | ||
| virtual std::shared_ptr<FragmentBlock> ScanCompressblock(const string& /*backfile*/, size_t& /*input_offset*/, size_t& /*output_offset*/) { return NULL; }; |
There was a problem hiding this comment.
A few NULL constants were around still. I replaced these by nullptr.
| @@ -1,3 +1,34 @@ | |||
| /* | |||
| * Copyright 2025 NXP. | |||
| * | |||
There was a problem hiding this comment.
Done't claim nxp copyright for this file, which is added by no-nxp contribtor.
|
In this pull request it's the "inline variables" from C++17 which I utilized. I thought some of the new containers would be practical too (e.g. to replace the |
nxpfrankli
left a comment
There was a problem hiding this comment.
Can you descript which C++ features cause have to bump to c++ 17. And
VS2017 build failure, D:\a\mfgtools\mfgtools\libuuu\buffer.h(65,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
D:\a\mfgtools\mfgtools\libuuu\buffer.h(66,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
D:\a\mfgtools\mfgtools\libuuu\buffer.h(67,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
D:\a\mfgtools\mfgtools\libuuu\buffer.h(68,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
D:\a\mfgtools\mfgtools\libuuu\buffer.h(69,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
D:\a\mfgtools\mfgtools\libuuu\buffer.h(71,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
D:\a\mfgtools\mfgtools\libuuu\buffer.h(72,22): error C7525: inline variables require at least '/std:c++17' [D:\a\mfgtools\mfgtools\msvc\libuuu.vcxproj]
e55c395 to
42f13af
Compare
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
This adds some nifty features and should be well supported by now (at least it should work with Ubuntu 20.04). Signed-off-by: markuspg <markuspg@users.noreply.github.com>
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
Signed-off-by: markuspg <markuspg@users.noreply.github.com>
|
vs build failure |
C++17 is default with GCC 11 (released in April 2021) and LLVM 16 (released in March 2023). It's fully covered since GCC 8 (released in May 2018) and LLVM 5 (released in September 2017).
Apart of this change there are a few minor adjustments.