Skip to content
Open
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
4 changes: 2 additions & 2 deletions include/rfl/Generic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,10 @@ class RFL_API Generic {
Result<std::string> to_string() const noexcept;

/// Returns the underlying variant.
VariantType& variant() noexcept { return value_; };
VariantType& variant() noexcept { return value_; }

/// Returns the underlying variant.
const VariantType& variant() const noexcept { return value_; };
const VariantType& variant() const noexcept { return value_; }

/// Equality comparison. Two Generics are equal if they hold the same
/// alternative and the underlying values compare equal.
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/Literal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class Literal {
return Literal<fields_...>(_v);
};
return find_value(_str).transform(to_literal);
};
}

/// The name defined by the Literal (returns the string representation).
/// @return The string value of the current literal
Expand Down
4 changes: 2 additions & 2 deletions include/rfl/MetaField.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ class MetaField {

/// Returns the name of the field.
/// @return The field name as it appears in the struct
const std::string& name() const { return name_; };
const std::string& name() const { return name_; }

/// Returns the type information of the field.
/// @return A string describing the field's type
const std::string& type() const { return type_; };
const std::string& type() const { return type_; }

private:
/// The name of the field.
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/NamedTuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ class NamedTuple<> {
using Values = rfl::Tuple<>;

/// @brief Default constructor for empty NamedTuple.
NamedTuple(){};
NamedTuple() {}

/// @brief Destructor.
~NamedTuple() = default;
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/Variant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ namespace std {
template <class... Types>
void swap(rfl::Variant<Types...>& _lhs, rfl::Variant<Types...>& _rhs) noexcept {
_lhs.swap(_rhs);
};
}
} // namespace std

#endif
4 changes: 2 additions & 2 deletions include/rfl/atomic/is_atomic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ template <class T>
struct is_atomic {
static constexpr bool value = false;
using RemoveAtomicT = T;
static void set(RemoveAtomicT&& val, T* _t) { *_t = std::forward<T>(val); };
static void set(RemoveAtomicT&& val, T* _t) { *_t = std::forward<T>(val); }
};

template <class T>
Expand All @@ -28,7 +28,7 @@ struct is_atomic<std::atomic<T>> {
using RemoveAtomicT = T;
static void set(RemoveAtomicT&& val, std::atomic<T>* _t) {
_t->store(std::forward<RemoveAtomicT>(val), std::memory_order_relaxed);
};
}
};

template <>
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/env/Writer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class RFL_API Writer {
}

template <class T>
OutputVarType value_as_root(const T& _var) const noexcept {
OutputVarType value_as_root(const T&) const noexcept {
static_assert(
always_false_v<T>,
"Writing basic types to ENV as root variables is not supported.");
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/internal/find_index.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ constexpr auto operator|(const FieldWrapper<F1, _field_name, _i1>& _f1,
template <class Head, class... Tail>
constexpr auto find_matching_field(const Head& _head, const Tail&... _tail) {
return (_head | ... | _tail);
};
}

template <StringLiteral _field_name, class Fields, int... _is>
constexpr auto wrap_fields(std::integer_sequence<int, _is...>) {
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/internal/move_from_tuple.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct IndptrHelper {
static constexpr auto indptr_ = ArrayType{_head, _tail...};

template <size_t... _is>
consteval auto operator+(const IndptrHelper<_is...>& _other) const {
consteval auto operator+(const IndptrHelper<_is...>&) const {
constexpr auto last = std::get<sizeof...(_tail)>(indptr_);
return IndptrHelper<_head, _tail..., (last + _is)...>{};
}
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/internal/nth_element.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ constexpr auto operator|(const ElementWrapper<T1, N, _i1>& _e1,
template <class Head, class... Tail>
constexpr auto find_matching_element(const Head& _head, const Tail&... _tail) {
return (_head | ... | _tail);
};
}

template <int N, class... Ts, int... _is>
constexpr auto wrap_elements(Ts... _ts, std::integer_sequence<int, _is...>) {
Expand Down
3 changes: 2 additions & 1 deletion include/rfl/internal/strings/utf8_conversions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ inline std::optional<std::u32string> decode_utf8(const std::string& _str) {
return std::nullopt; // truncated multi-byte sequence
}
for (int k = 1; k <= extra; ++k) {
const auto cc = static_cast<unsigned char>(_str[i + k]);
const auto cc =
static_cast<unsigned char>(_str[i + static_cast<std::size_t>(k)]);
if ((cc >> 6) != 0x2) {
return std::nullopt; // bad continuation byte
}
Expand Down
2 changes: 1 addition & 1 deletion include/rfl/parsing/NamedTupleParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ struct NamedTupleParser {
_schema->types_[std::string(F::name())] = std::move(s);
}
}
};
}

template <int... _is>
static void build_object(const W& _w, const NamedTuple<FieldTypes...>& _tup,
Expand Down
6 changes: 4 additions & 2 deletions include/rfl/parsing/ParserDefaultVal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,10 @@ struct ParserDefaultVal {
static schema::Type to_schema(
std::map<std::string, schema::Type>* _definitions) {
using U = std::remove_cvref_t<T>;
return schema::Type{schema::Type::DefaultVal{Ref<schema::Type>::make(
Parser<R, W, U, ProcessorsType>::to_schema(_definitions))}};
return schema::Type{schema::Type::DefaultVal{
.type_ = Ref<schema::Type>::make(
Parser<R, W, U, ProcessorsType>::to_schema(_definitions)),
.default_value_ = std::nullopt}};
}
};

Expand Down
3 changes: 2 additions & 1 deletion include/rfl/parsing/VectorParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ struct VectorParser {
MapParser<R, W, VecType, ProcessorsType>::write(_w, _vec, _parent);
} else {
auto arr = ParentType::add_array(
_w, std::distance(_vec.begin(), _vec.end()), _parent);
_w, static_cast<size_t>(std::distance(_vec.begin(), _vec.end())),
_parent);
const auto new_parent = typename ParentType::Array{&arr};
for (const auto& v : _vec) {
Parser<R, W, std::remove_cvref_t<T>, ProcessorsType>::write(_w, v,
Expand Down