fix Clang warnings

those two tryLexicalCasts were literally just broken
This commit is contained in:
Kae 2024-12-31 15:27:32 +11:00
parent 4903d39eed
commit 7b2ce5155a
4 changed files with 11 additions and 8 deletions

View File

@ -90,6 +90,9 @@ jobs:
build_linux:
name: Build OpenStarbound Linux x86_64
runs-on: ubuntu-20.04
env:
CC: clang
CXX: clang++
steps:
- name: Install Packages

View File

@ -24,12 +24,12 @@ bool tryLexicalCast(bool& result, const char* first, const char* last);
template <typename Type>
bool tryLexicalCast(Type& result, String const& s) {
return tryLexicalCast<Type>(s.utf8Ptr(), s.utf8Ptr() + s.utf8Size());
return tryLexicalCast<Type>(result, s.utf8Ptr(), s.utf8Ptr() + s.utf8Size());
}
template <typename Type>
bool tryLexicalCast(Type& result, StringView s) {
return tryLexicalCast<Type>(s.utf8Ptr(), s.utf8Ptr() + s.utf8Size());
return tryLexicalCast<Type>(result, s.utf8Ptr(), s.utf8Ptr() + s.utf8Size());
}
template <typename Type>

View File

@ -165,7 +165,7 @@ bool NetElementFloating<T>::writeNetDelta(DataStream& ds, uint64_t fromVersion,
}
template <typename T>
void NetElementFloating<T>::readNetDelta(DataStream& ds, float interpolationTime, NetCompatibilityRules rules) {
void NetElementFloating<T>::readNetDelta(DataStream& ds, float interpolationTime, NetCompatibilityRules _rules) {
T t = readValue(ds);
m_latestUpdateVersion = m_netVersion ? m_netVersion->current() : 0;

View File

@ -85,11 +85,11 @@ EnumMap<NetCompressionMode> const NetCompressionModeNames {
Packet::~Packet() {}
void Packet::read(DataStream& ds, NetCompatibilityRules netRules) { read(ds); }
void Packet::read(DataStream& ds) {}
void Packet::write(DataStream& ds, NetCompatibilityRules netRules) const { write(ds); }
void Packet::write(DataStream& ds) const {}
void Packet::readJson(Json const& json) {}
void Packet::read(DataStream& ds, NetCompatibilityRules _netRules) { read(ds); }
void Packet::read(DataStream& _ds) {}
void Packet::write(DataStream& ds, NetCompatibilityRules _netRules) const { write(ds); }
void Packet::write(DataStream& _ds) const {}
void Packet::readJson(Json const& _json) {}
Json Packet::writeJson() const { return JsonObject{}; }
PacketCompressionMode Packet::compressionMode() const { return m_compressionMode; }