Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ function(fory_configure_target target)
target_compile_options(${target} PRIVATE /arch:AVX2)
endif()
else()
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic)
target_compile_options(${target} PRIVATE -Wall -Wextra -Wpedantic -Wno-unused-parameter)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
target_compile_options(${target} PRIVATE -Wno-variadic-macro-arguments-omitted)
endif()
if(FORY_WARNINGS_AS_ERRORS)
target_compile_options(${target} PRIVATE -Werror)
else()
Expand Down
2 changes: 1 addition & 1 deletion cpp/fory/meta/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@ if(FORY_BUILD_TESTS)

add_executable(fory_meta_field_test field_test.cc)
fory_configure_target(fory_meta_field_test)
target_link_libraries(fory_meta_field_test fory_meta GTest::gtest)
target_link_libraries(fory_meta_field_test fory_meta GTest::gtest GTest::gtest_main)
gtest_discover_tests(fory_meta_field_test)
endif()
5 changes: 0 additions & 5 deletions cpp/fory/serialization/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ if(FORY_BUILD_TESTS)
target_link_libraries(fory_serialization_variant_test fory_serialization GTest::gtest GTest::gtest_main)
gtest_discover_tests(fory_serialization_variant_test)

add_executable(fory_serialization_field_test field_serializer_test.cc)
fory_configure_target(fory_serialization_field_test)
target_link_libraries(fory_serialization_field_test fory_serialization GTest::gtest)
gtest_discover_tests(fory_serialization_field_test)

add_executable(fory_serialization_namespace_macro_test namespace_macro_test.cc)
fory_configure_target(fory_serialization_namespace_macro_test)
target_link_libraries(fory_serialization_namespace_macro_test fory_serialization GTest::gtest GTest::gtest_main)
Expand Down
24 changes: 10 additions & 14 deletions cpp/fory/serialization/array_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ struct Serializer<
}

static inline void write_data_generic(const std::array<T, N> &arr,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(arr, ctx);
}

Expand Down Expand Up @@ -176,8 +176,7 @@ struct Serializer<
}

static inline std::array<T, N>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}
};
Expand Down Expand Up @@ -232,7 +231,7 @@ template <size_t N> struct Serializer<std::array<bool, N>> {
}

static inline void write_data_generic(const std::array<bool, N> &arr,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(arr, ctx);
}

Expand Down Expand Up @@ -280,8 +279,7 @@ template <size_t N> struct Serializer<std::array<bool, N>> {
}

static inline std::array<bool, N>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}
};
Expand Down Expand Up @@ -310,7 +308,7 @@ template <size_t N> struct Serializer<std::array<float16_t, N>> {

static inline void write(const std::array<float16_t, N> &arr,
WriteContext &ctx, RefMode ref_mode, bool write_type,
bool has_generics = false) {
bool = false) {
write_not_null_ref_flag(ctx, ref_mode);
if (write_type) {
ctx.write_uint8(static_cast<uint8_t>(type_id));
Expand Down Expand Up @@ -341,7 +339,7 @@ template <size_t N> struct Serializer<std::array<float16_t, N>> {
}

static inline void write_data_generic(const std::array<float16_t, N> &arr,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(arr, ctx);
}

Expand Down Expand Up @@ -396,8 +394,7 @@ template <size_t N> struct Serializer<std::array<float16_t, N>> {
}

static inline std::array<float16_t, N>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}
};
Expand All @@ -423,7 +420,7 @@ template <size_t N> struct Serializer<std::array<bfloat16_t, N>> {

static inline void write(const std::array<bfloat16_t, N> &arr,
WriteContext &ctx, RefMode ref_mode, bool write_type,
bool has_generics = false) {
bool = false) {
write_not_null_ref_flag(ctx, ref_mode);
if (write_type) {
ctx.write_uint8(static_cast<uint8_t>(type_id));
Expand Down Expand Up @@ -454,7 +451,7 @@ template <size_t N> struct Serializer<std::array<bfloat16_t, N>> {
}

static inline void write_data_generic(const std::array<bfloat16_t, N> &arr,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(arr, ctx);
}

Expand Down Expand Up @@ -509,8 +506,7 @@ template <size_t N> struct Serializer<std::array<bfloat16_t, N>> {
}

static inline std::array<bfloat16_t, N>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}
};
Expand Down
22 changes: 9 additions & 13 deletions cpp/fory/serialization/collection_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,8 +555,7 @@ struct Serializer<
}

static inline void write(const std::vector<T, Alloc> &vec, WriteContext &ctx,
RefMode ref_mode, bool write_type,
bool has_generics = false) {
RefMode ref_mode, bool write_type, bool = false) {
write_not_null_ref_flag(ctx, ref_mode);
if (write_type) {
ctx.write_uint8(static_cast<uint8_t>(type_id));
Expand Down Expand Up @@ -586,7 +585,7 @@ struct Serializer<
}

static inline void write_data_generic(const std::vector<T, Alloc> &vec,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(vec, ctx);
}

Expand All @@ -612,8 +611,7 @@ struct Serializer<
}

static inline std::vector<T, Alloc>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}

Expand Down Expand Up @@ -671,7 +669,7 @@ template <typename Alloc> struct Serializer<std::vector<float16_t, Alloc>> {

static inline void write(const std::vector<float16_t, Alloc> &vec,
WriteContext &ctx, RefMode ref_mode, bool write_type,
bool has_generics = false) {
bool = false) {
write_not_null_ref_flag(ctx, ref_mode);
if (write_type) {
ctx.write_uint8(static_cast<uint8_t>(type_id));
Expand Down Expand Up @@ -702,7 +700,7 @@ template <typename Alloc> struct Serializer<std::vector<float16_t, Alloc>> {

static inline void
write_data_generic(const std::vector<float16_t, Alloc> &vec,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(vec, ctx);
}

Expand All @@ -727,8 +725,7 @@ template <typename Alloc> struct Serializer<std::vector<float16_t, Alloc>> {
}

static inline std::vector<float16_t, Alloc>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}

Expand Down Expand Up @@ -777,7 +774,7 @@ template <typename Alloc> struct Serializer<std::vector<bfloat16_t, Alloc>> {

static inline void write(const std::vector<bfloat16_t, Alloc> &vec,
WriteContext &ctx, RefMode ref_mode, bool write_type,
bool has_generics = false) {
bool = false) {
write_not_null_ref_flag(ctx, ref_mode);
if (write_type) {
ctx.write_uint8(static_cast<uint8_t>(type_id));
Expand Down Expand Up @@ -808,7 +805,7 @@ template <typename Alloc> struct Serializer<std::vector<bfloat16_t, Alloc>> {

static inline void
write_data_generic(const std::vector<bfloat16_t, Alloc> &vec,
WriteContext &ctx, bool has_generics) {
WriteContext &ctx, bool) {
write_data(vec, ctx);
}

Expand All @@ -833,8 +830,7 @@ template <typename Alloc> struct Serializer<std::vector<bfloat16_t, Alloc>> {
}

static inline std::vector<bfloat16_t, Alloc>
read_with_type_info(ReadContext &ctx, RefMode ref_mode,
const TypeInfo &type_info) {
read_with_type_info(ReadContext &ctx, RefMode ref_mode, const TypeInfo &) {
return read(ctx, ref_mode, false);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/hello_row/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -e
pip install cmake

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="${SCRIPT_DIR}/build"
BUILD_DIR="${SCRIPT_DIR}/cmake-build"

echo "=== Fory C++ Hello Row Example Build Script ==="
echo ""
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/hello_world/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -e
pip install cmake

SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
BUILD_DIR="${SCRIPT_DIR}/build"
BUILD_DIR="${SCRIPT_DIR}/cmake-build"

echo "=== Fory C++ Hello World Example Build Script ==="
echo ""
Expand Down
Loading