Skip to content

Commit

Permalink
fix: CI warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
sdkrystian committed Jun 23, 2023
1 parent 181ac6b commit 5c7120b
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 12 deletions.
14 changes: 11 additions & 3 deletions include/mrdox/Metadata/Source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,18 @@ struct MRDOX_DECL
}
};

/** Like std::optional<SymbolID>
struct LocationEmptyPredicate
{
constexpr bool operator()(
Location const& loc) const noexcept
{
return loc.Filename.empty();
}
};

/** Like std::optional<Location>
*/
using OptionalLocation = Optional<Location,
decltype([](const Location& loc) { return loc.Filename.empty(); })>;
using OptionalLocation = Optional<Location, LocationEmptyPredicate>;

/** Stores source information for a declaration.
*/
Expand Down
1 change: 0 additions & 1 deletion source/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ ASTVisitor::
getSymbolIDForType(
QualType T)
{
SymbolID id = SymbolID::zero;
QualType inner = T;
while(true)
{
Expand Down
4 changes: 2 additions & 2 deletions source/AST/AnyBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ class BaseBlock
BaseBlock(
BaseInfo& I,
BitcodeReader& br) noexcept
: I_(I)
, br_(br)
: br_(br)
, I_(I)
{
}

Expand Down
2 changes: 2 additions & 0 deletions source/Support/Dom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Value(
case Kind::Integer:
case Kind::Boolean:
number_ = other.number_;
break;
case Kind::Null:
break;
default:
Expand Down Expand Up @@ -134,6 +135,7 @@ Value(
case Kind::Integer:
case Kind::Boolean:
number_ = other.number_;
break;
case Kind::Null:
break;
default:
Expand Down
10 changes: 6 additions & 4 deletions source/Support/JavaScript.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ arr_get_impl(
duk_context* ctx, duk_idx_t idx)
{
duk_require_object(ctx, idx);
auto found = duk_get_prop_string(ctx, idx, "ptr");
[[maybe_unused]] auto found =
duk_get_prop_string(ctx, idx, "ptr");
MRDOX_ASSERT(found == 1);
auto impl = reinterpret_cast<dom::Array*>(
duk_get_pointer(ctx, -1));
Expand All @@ -506,7 +507,7 @@ arr_get_prop(duk_context* ctx)

duk_push_this(ctx);
auto arr = arr_get_impl(ctx, -1);

auto value = arr->get(index);
switch(value.kind())
{
Expand Down Expand Up @@ -638,7 +639,8 @@ obj_get_impl(
duk_context* ctx, duk_idx_t idx)
{
duk_require_object(ctx, idx);
auto found = duk_get_prop_string(ctx, idx, "ptr");
[[maybe_unused]] auto found =
duk_get_prop_string(ctx, idx, "ptr");
MRDOX_ASSERT(found == 1);
auto impl = reinterpret_cast<dom::Object*>(
duk_get_pointer(ctx, -1));
Expand Down Expand Up @@ -666,7 +668,7 @@ obj_get_prop(duk_context* ctx)

duk_push_this(ctx);
auto obj = obj_get_impl(ctx, -1);

auto value = obj->get(key);
switch(value.kind())
{
Expand Down
4 changes: 2 additions & 2 deletions source/Tool/ConfigImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ createConfigFromYAML(
workingDir, addonsDir, configYaml, extraYaml);
return config;
}
catch(Error err)
catch(Error const& err)
{
return err;
}
Expand Down Expand Up @@ -224,7 +224,7 @@ loadConfigFile(
workingDir, addonsDir, *text, extraYaml);
return config;
}
catch(Error err)
catch(Error const& err)
{
return err;
}
Expand Down

0 comments on commit 5c7120b

Please sign in to comment.