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
4 changes: 3 additions & 1 deletion rts/Lua/LuaTextures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ std::string LuaTextures::Create(const Texture& tex)
} break;
}

if (glGetError() != GL_NO_ERROR) {
if (const GLenum texErr = glGetError(); texErr != GL_NO_ERROR) {
LOG_L(L_ERROR, "[LuaTextures::%s] glTexImage failed: target=0x%x size=%dx%d fmt=0x%x dataFmt=0x%x dataType=0x%x border=%d glError=0x%x",
__func__, tex.target, tex.xsize, tex.ysize, tex.format, dataFormat, dataType, tex.border, texErr);
glDeleteTextures(1, &texID);
glBindTexture(tex.target, currentBinding);
return "";
Expand Down
6 changes: 3 additions & 3 deletions rts/Rml/SolLua/bind/Context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct lua_iterator_state
sol::state_view l{s};
int index = 0;
int count = keytable.size();
while (keytable.get<sol::object>(++index).get_type() != sol::type::nil && index <= count) {
while (keytable.get<sol::object>(++index).get_type() != sol::type::lua_nil && index <= count) {
this->keys.emplace_back(sol::object(l, sol::in_place, index));
}
} else {
Expand Down Expand Up @@ -199,7 +199,7 @@ createNewIndexFunction(std::shared_ptr<Rml::SolLua::SolLuaDataModel> data, const
}
if (value.is<sol::table>()) {
auto value_raw = value.as<sol::table>().raw_get<sol::object>("__raw");
if (value_raw != sol::nil && value_raw.is<sol::function>()) {
if (value_raw != sol::lua_nil && value_raw.is<sol::function>()) {
// new value is a datamodel proxy, so get the underlying table to assign
prop.as<sol::table>().raw_set(solkey, value_raw.as<sol::function>().call<sol::object>(value));
} else {
Expand Down Expand Up @@ -290,7 +290,7 @@ sol::table openDataModel(Rml::Context& self, const Rml::String& name, sol::objec
}
if (value.is<sol::table>()) {
auto value_raw = value.as<sol::table>().raw_get<sol::object>("__raw");
if (value_raw != sol::nil && value_raw.is<sol::function>()) {
if (value_raw != sol::lua_nil && value_raw.is<sol::function>()) {
// new value is a datamodel proxy, so get the underlying table to assign
data->Table.raw_set(key, value_raw.as<sol::function>().call<sol::object>(value));
} else {
Expand Down
2 changes: 1 addition & 1 deletion rts/Rml/SolLua/bind/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace Rml::SolLua

void Set(const sol::this_state L, const std::string& name, const sol::object& value)
{
if (value.get_type() == sol::type::nil) {
if (value.get_type() == sol::type::lua_nil) {
m_element->RemoveProperty(name);
return;
}
Expand Down
6 changes: 3 additions & 3 deletions rts/Rml/SolLua/bind/bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace Rml::SolLua

sol::object makeObjectFromVariant(const Rml::Variant* variant, sol::state_view s)
{
if (!variant) return sol::make_object(s, sol::nil);
if (!variant) return sol::make_object(s, sol::lua_nil);

switch (variant->GetType())
{
Expand Down Expand Up @@ -69,10 +69,10 @@ namespace Rml::SolLua
case Rml::Variant::VOIDPTR:
return sol::make_object(s, variant->Get<void*>());
default:
return sol::make_object(s, sol::nil);
return sol::make_object(s, sol::lua_nil);
}

return sol::make_object(s, sol::nil);
return sol::make_object(s, sol::lua_nil);
}

} // end namespace Rml::SolLua
6 changes: 4 additions & 2 deletions rts/System/SafeUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#include <limits>
#include <cstring>
#include <type_traits>
#include <memory>

namespace spring {
template<class T> inline void SafeDestruct(T*& p)
Expand Down Expand Up @@ -112,8 +114,8 @@ namespace spring {
static_assert(sizeof(TIn) == sizeof(TOut), "Types must match sizes");
static_assert(std::is_trivially_copyable<TIn>::value , "Requires TriviallyCopyable input");
static_assert(std::is_trivially_copyable<TOut>::value, "Requires TriviallyCopyable output");
static_assert(std::is_trivially_constructible_v<TOut>,
"This implementation additionally requires destination type to be trivially constructible");
static_assert(std::is_trivially_default_constructible<TOut>::value,
"This implementation additionally requires destination type to be trivially default-constructible");

TOut t2;
std::memcpy(std::addressof(t2), std::addressof(t1), sizeof(TIn));
Expand Down
1 change: 0 additions & 1 deletion rts/System/float3.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <format>

#include "System/BranchPrediction.h"
#include "lib/streflop/streflop_cond.h"
#include "System/creg/creg_cond.h"
#include "System/FastMath.h"
#include "System/type2.h"
Expand Down
Loading