diff options
author | B Stack <bgstack15@gmail.com> | 2020-11-02 12:45:42 +0000 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-11-02 12:45:42 +0000 |
commit | 3162cbdd63eaf7e930c8b2ebe604e10ecb369d08 (patch) | |
tree | 9939cdd1735bf15e97ad6700419c0604cac7c59e /zen | |
parent | Merge branch '11.2' into 'master' (diff) | |
parent | add upstream 11.3 (diff) | |
download | FreeFileSync-3162cbdd63eaf7e930c8b2ebe604e10ecb369d08.tar.gz FreeFileSync-3162cbdd63eaf7e930c8b2ebe604e10ecb369d08.tar.bz2 FreeFileSync-3162cbdd63eaf7e930c8b2ebe604e10ecb369d08.zip |
Merge branch '11.3' into 'master'11.3
add upstream 11.3
See merge request opensource-tracking/FreeFileSync!27
Diffstat (limited to 'zen')
-rw-r--r-- | zen/basic_math.h | 2 | ||||
-rw-r--r-- | zen/legacy_compiler.h | 2 | ||||
-rw-r--r-- | zen/string_tools.h | 4 | ||||
-rw-r--r-- | zen/sys_info.cpp | 7 |
4 files changed, 9 insertions, 6 deletions
diff --git a/zen/basic_math.h b/zen/basic_math.h index 26fb9e58..0f5191e3 100644 --- a/zen/basic_math.h +++ b/zen/basic_math.h @@ -10,7 +10,7 @@ #include <cassert> #include <algorithm> #include <cmath> - #include <numbers> +#include <numbers> #include "type_traits.h" diff --git a/zen/legacy_compiler.h b/zen/legacy_compiler.h index ad5442fe..0cbb830e 100644 --- a/zen/legacy_compiler.h +++ b/zen/legacy_compiler.h @@ -7,7 +7,7 @@ #ifndef LEGACY_COMPILER_H_839567308565656789 #define LEGACY_COMPILER_H_839567308565656789 -#include <version> +#include <version> //contains all __cpp_lib_<feature> macros /* C++ standard conformance: https://en.cppreference.com/w/cpp/feature_test diff --git a/zen/string_tools.h b/zen/string_tools.h index fc715961..83d87244 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -83,7 +83,7 @@ template <class Num, class S> Num stringTo(const S& str); std::pair<char, char> hexify (unsigned char c, bool upperCase = true); char unhexify(char high, char low); -std::string formatAsHexString(const std::string& blob); //bytes -> (human-readable) hex string +std::string formatAsHexString(const std::string_view& blob); //bytes -> (human-readable) hex string template <class S, class T, class Num> S printNumber(const T& format, const Num& number); //format a single number using std::snprintf() @@ -859,7 +859,7 @@ char unhexify(char high, char low) inline -std::string formatAsHexString(const std::string& blob) +std::string formatAsHexString(const std::string_view& blob) { std::string output; for (const char c : blob) diff --git a/zen/sys_info.cpp b/zen/sys_info.cpp index da5cc61f..475e1c6c 100644 --- a/zen/sys_info.cpp +++ b/zen/sys_info.cpp @@ -63,9 +63,12 @@ ComputerModel zen::getComputerModel() //throw FileError cm.vendor = tryGetInfo("/sys/devices/virtual/dmi/id/sys_vendor"); // //clean up: + cm.model = beforeFirst(cm.model , L'\u00ff', IfNotFoundReturn::all); //fix broken BIOS entries: + cm.vendor = beforeFirst(cm.vendor, L'\u00ff', IfNotFoundReturn::all); //0xff can be considered 0 + for (const char* dummyModel : { - "To Be Filled By O.E.M.", "Default string", "empty", "O.E.M", "OEM", "NA", + "To Be Filled By O.E.M.", "Default string", "$(DEFAULT_STRING)", "Undefined", "empty", "O.E.M", "OEM", "NA", "System Product Name", "Please change product name", "INVALID", }) if (equalAsciiNoCase(cm.model, dummyModel)) @@ -76,7 +79,7 @@ ComputerModel zen::getComputerModel() //throw FileError for (const char* dummyVendor : { - "To Be Filled By O.E.M.", "Default string", "empty", "O.E.M", "OEM", "NA", + "To Be Filled By O.E.M.", "Default string", "$(DEFAULT_STRING)", "Undefined", "empty", "O.E.M", "OEM", "NA", "System manufacturer", "OEM Manufacturer", }) if (equalAsciiNoCase(cm.vendor, dummyVendor)) |