Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Oct 11, 2023
1 parent 34f9b3d commit 6c6172a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions include/ylt/struct_pack/endian_wrapper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "ylt/struct_pack/util.h"
namespace struct_pack::detail {

template <std::size_t block_size, writer_t writer_t>
template <std::size_t block_size, typename writer_t>
void write_wrapper(writer_t& writer, const char* data) {
if constexpr (is_system_little_endian || block_size == 1) {
writer.write(data, block_size);
Expand Down Expand Up @@ -99,7 +99,7 @@ void write_wrapper(writer_t& writer, const char* data) {
static_assert(sizeof(writer), "illegal block size(should be 1,2,4,8,16)");
}
}
template <std::size_t block_size, writer_t writer_t>
template <std::size_t block_size, typename writer_t>
void write_wrapper(writer_t& writer, const char* data,
std::size_t block_count) {
if constexpr (is_system_little_endian || block_size == 1) {
Expand All @@ -116,7 +116,7 @@ void write_wrapper(writer_t& writer, const char* data,
}
}
}
template <std::size_t block_size, reader_t reader_t>
template <std::size_t block_size, typename reader_t>
bool read_wrapper(reader_t& reader, char* SP_RESTRICT data) {
if constexpr (is_system_little_endian || block_size == 1) {
return static_cast<bool>(reader.read(data, block_size));
Expand Down Expand Up @@ -196,7 +196,7 @@ bool read_wrapper(reader_t& reader, char* SP_RESTRICT data) {
}
}
}
template <std::size_t block_size, reader_t reader_t>
template <std::size_t block_size, typename reader_t>
bool read_wrapper(reader_t& reader, char* SP_RESTRICT data,
std::size_t block_count) {
if constexpr (is_system_little_endian || block_size == 1) {
Expand Down
2 changes: 1 addition & 1 deletion include/ylt/struct_pack/packer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <cstdint>

#include "calculate_size.hpp"
#include "reflection.hpp"
#include "endian_wrapper.hpp"
#include "reflection.hpp"
#include "ylt/struct_pack/util.h"
namespace struct_pack::detail {
template <
Expand Down
2 changes: 1 addition & 1 deletion include/ylt/struct_pack/unpacker.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ class unpacker {
if SP_UNLIKELY (view == nullptr) {
return struct_pack::errc::no_buffer_space;
}
item = {(value_type *)(view), size64};
item = {(value_type *)(view), (std::size_t)size64};
}
else {
if SP_UNLIKELY (mem_sz >= PTRDIFF_MAX)
Expand Down

0 comments on commit 6c6172a

Please sign in to comment.