Merge branch 'master' into time-struct-warning

This commit is contained in:
Thomas Fussell 2021-01-03 10:15:46 -05:00 committed by GitHub
commit 23244120fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -38,7 +38,8 @@ namespace xlnt {
template <typename T> template <typename T>
class optional class optional
{ {
#if defined(_MSC_VER) && _MSC_VER <= 1900 // v14, visual studio 2015 #if ((defined(_MSC_VER) && _MSC_VER <= 1900) || (defined(__GNUC__) && __GNUC__ < 5))
// Disable enhanced type checking on Visual Studio <= 2015 and GCC <5
#define XLNT_NOEXCEPT_VALUE_COMPAT(...) (false) #define XLNT_NOEXCEPT_VALUE_COMPAT(...) (false)
#else #else
#define XLNT_NOEXCEPT_VALUE_COMPAT(...) (__VA_ARGS__) #define XLNT_NOEXCEPT_VALUE_COMPAT(...) (__VA_ARGS__)

View File

@ -174,7 +174,8 @@ void sha1_hash(const uint8_t *message, size_t len, uint32_t hash[5]) {
block[BLOCK_SIZE - 1] = (uint8_t)((len & 0x1FU) << 3); block[BLOCK_SIZE - 1] = (uint8_t)((len & 0x1FU) << 3);
len >>= 5; len >>= 5;
for (int i = 1; i < LENGTH_SIZE; i++, len >>= 8) int i;
for (i = 1; i < LENGTH_SIZE; i++, len >>= 8)
block[BLOCK_SIZE - 1 - i] = (uint8_t)(len & 0xFFU); block[BLOCK_SIZE - 1 - i] = (uint8_t)(len & 0xFFU);
sha1_compress(hash, block); sha1_compress(hash, block);
} }

View File

@ -261,7 +261,8 @@ void sha512_hash(const uint8_t *message, size_t len, uint64_t hash[8]) {
block[BLOCK_SIZE - 1] = (uint8_t)((len & 0x1FU) << 3); block[BLOCK_SIZE - 1] = (uint8_t)((len & 0x1FU) << 3);
len >>= 5; len >>= 5;
for (int i = 1; i < LENGTH_SIZE; i++, len >>= 8) int i;
for (i = 1; i < LENGTH_SIZE; i++, len >>= 8)
block[BLOCK_SIZE - 1 - i] = (uint8_t)(len & 0xFFU); block[BLOCK_SIZE - 1 - i] = (uint8_t)(len & 0xFFU);
sha512_compress(hash, block); sha512_compress(hash, block);
} }

View File

@ -199,8 +199,8 @@ pattern_fill_type from_string(const std::string &string)
#pragma clang diagnostic pop #pragma clang diagnostic pop
auto toLower = [](std::string str) { auto toLower = [](std::string str) {
auto bg{ std::begin (str) }; auto bg = std::begin (str);
auto en{ std::end (str) }; auto en = std::end (str);
std::transform(bg, en, bg, std::transform(bg, en, bg,
[](char c) { [](char c) {
// static cast to avoid int -> char narrowing warning // static cast to avoid int -> char narrowing warning
@ -211,7 +211,7 @@ pattern_fill_type from_string(const std::string &string)
}; };
auto patternLookup = [](const std::string& key) { auto patternLookup = [](const std::string& key) {
auto entry { patternFill.find (key) }; auto entry = patternFill.find (key);
if (entry != std::end (patternFill)) { if (entry != std::end (patternFill)) {
return entry->second; return entry->second;
} }