mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
Merge branch 'master' into time-struct-warning
This commit is contained in:
commit
23244120fb
|
@ -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__)
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user