Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
nekiro committed Oct 7, 2024
1 parent b99b9fd commit 39a5ade
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/guild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Guild_ptr IOGuild::loadGuild(uint32_t guildId)
}

const auto& guild = std::make_shared<Guild>(guildId, result->getString("name"));
if (auto result = db.storeQuery(
if (result = db.storeQuery(

Check failure on line 67 in src/guild.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=on

using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]

Check failure on line 67 in src/guild.cpp

View workflow job for this annotation

GitHub Actions / macos-Debug-luajit=off

using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]

Check failure on line 67 in src/guild.cpp

View workflow job for this annotation

GitHub Actions / macos-Release-luajit=off

using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]
fmt::format("SELECT `id`, `name`, `level` FROM `guild_ranks` WHERE `guild_id` = {:d}", guildId))) {
do {
guild->addRank(result->getNumber<uint32_t>("id"), result->getString("name"),
Expand Down
6 changes: 3 additions & 3 deletions src/http/listener.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ void Listener::on_accept(beast::error_code ec, asio::ip::tcp::socket socket)
accept();
}

std::shared_ptr<Listener> make_listener(asio::io_context& ioc, asio::ip::tcp::endpoint endpoint)
std::shared_ptr<Listener> make_listener(asio::io_context& iocontext, asio::ip::tcp::endpoint endpoint)
{
asio::ip::tcp::acceptor acceptor{asio::make_strand(ioc)};
asio::ip::tcp::acceptor acceptor{asio::make_strand(iocontext)};

beast::error_code ec;
if (acceptor.open(endpoint.protocol(), ec); ec) {
Expand All @@ -55,7 +55,7 @@ std::shared_ptr<Listener> make_listener(asio::io_context& ioc, asio::ip::tcp::en
throw std::runtime_error(ec.message());
}

return std::make_shared<Listener>(ioc, std::move(acceptor));
return std::make_shared<Listener>(iocontext, std::move(acceptor));
}

} // namespace tfs::http
8 changes: 4 additions & 4 deletions src/player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3868,8 +3868,8 @@ bool Player::canWear(uint32_t lookType, uint8_t addons) const
return true;
}

for (auto& [outfit, addon] : outfits) {
if (outfit == lookType) {
for (auto& [outfitType, addon] : outfits) {
if (outfitType == lookType) {
if (addon == addons || addon == 3 || addons == 0) {
return true;
}
Expand All @@ -3890,8 +3890,8 @@ bool Player::hasOutfit(uint32_t lookType, uint8_t addons)
return true;
}

for (auto& [outfit, addon] : outfits) {
if (outfit == lookType) {
for (auto& [outfitType, addon] : outfits) {
if (outfitType == lookType) {
if (addon == addons || addon == 3 || addons == 0) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tile.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class TileItemVector : private ItemVector
}
return *getBeginDownItem();
}
void addDownItemCount(uint16_t increment) { downItemCount += increment; }
void addDownItemCount(int16_t count) { downItemCount += count; }

private:
uint16_t downItemCount = 0;
Expand Down

0 comments on commit 39a5ade

Please sign in to comment.