Skip to content

Commit 4e29e4d

Browse files
committed
Merge branch 'main' into csv_currency
2 parents 099b4c5 + 9a47073 commit 4e29e4d

File tree

13 files changed

+287
-179
lines changed

13 files changed

+287
-179
lines changed

include/glaze/core/common.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,7 @@ struct glz::meta<glz::error_code>
547547
"method_not_found",
548548
"timeout",
549549
"send_error",
550+
"connection_failure",
550551
"end_reached",
551552
"no_read_input",
552553
"data_must_be_null_terminated",
@@ -608,6 +609,7 @@ struct glz::meta<glz::error_code>
608609
method_not_found, //
609610
timeout, //
610611
send_error, //
612+
connection_failure, //
611613
end_reached, // A non-error code for non-null terminated input buffers
612614
no_read_input, //
613615
data_must_be_null_terminated, //

include/glaze/core/context.hpp

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ namespace glz
2323
method_not_found,
2424
timeout,
2525
send_error,
26+
connection_failure,
2627
// Other errors
2728
end_reached, // A non-error code for non-null terminated input buffers
2829
no_read_input, //

include/glaze/core/reflect.hpp

+13-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
#include "glaze/core/common.hpp"
88
#include "glaze/util/primes_64.hpp"
99

10+
#ifdef _MSC_VER
11+
// Turn off MSVC warning for unreferenced formal parameter, which is referenced in a constexpr branch
12+
#pragma warning(push)
13+
#pragma warning(disable : 4100 4189)
14+
#endif
15+
1016
namespace glz::detail
1117
{
1218
// We create const and not-const versions for when our reflected struct is const or non-const qualified
@@ -1371,7 +1377,7 @@ namespace glz::detail
13711377
if (const auto uindex = find_unique_index(keys)) {
13721378
info.unique_index = uindex.value();
13731379

1374-
if (N == 3) {
1380+
if constexpr (N == 3) {
13751381
// An xor of the first unique character with itself will result in 0 (our desired index)
13761382
// We use a hash algorithm that will produce zero if zero is given, so we can avoid a branch
13771383
// We need a seed produces hashes of [1, 2] for the 2nd and 3rd keys
@@ -1634,7 +1640,7 @@ namespace glz::detail
16341640
hash_info_t<T, bucket_size(unique_index, N)> info{.type = unique_index, .seed = k_info.seed};
16351641
info.min_length = k_info.min_length;
16361642
info.max_length = k_info.max_length;
1637-
info.table.fill(N);
1643+
info.table.fill(bucket_value_t<N>(N));
16381644
info.unique_index = k_info.unique_index;
16391645

16401646
if constexpr (k_info.sized_hash) {
@@ -2204,3 +2210,8 @@ namespace glz
22042210
}
22052211
}
22062212
}
2213+
2214+
#ifdef _MSC_VER
2215+
// restore disabled warnings
2216+
#pragma warning(pop)
2217+
#endif

0 commit comments

Comments
 (0)