Sol2: Work around a compiler warning

Qt and std container like different size types

creator/src/libs/3rdparty/sol2/include/sol/sol.hpp:13844:15: warning: comparison of integers of different signs: 'std::size_t' (aka 'unsigned long') and 'qsizetype' (aka 'long long') [-Wsign-compare]
 13844 |                         return idx >= cont.max_size();
       |                                ~~~ ^  ~~~~~~~~~~~~~~~
creator/src/libs/3rdparty/sol2/include/sol/sol.hpp:13902:9: note: in instantiation of member function 'sol::stack::unqualified_getter<sol::as_table_t<QList<int>>>::max_size_check' requested here
 13902 |                                 if (max_size_check(meta::has_max_size<Tu>(), cont, idx)) {
       |                                     ^
creator/src/libs/3rdparty/sol2/include/sol/sol.hpp:14140:15: note: in instantiation of function template specialization 'sol::stack::unqualified_getter<sol::as_table_t<QList<int>>>::get<sol::nested<int>>' requested here
 14140 |                                         return g.get(types<nested<V>>(), L, index, tracking);
       |                                                  ^
creator/src/libs/3rdparty/sol2/include/sol/sol.hpp:11719:15: note: in instantiation of member function 'sol::stack::unqualified_getter<sol::nested<QList<int>>>::get' requested here
 11719 |                                         return g.get(L, index, tracking);
       |                                                  ^
creator/src/plugins/lua/bindings/settings.cpp:269:55: note: in instantiation of function template specialization 'Lua::Internal::typedAspectCreate<Utils::IntegersAspect>' requested here
  269 |             return createAspectFromTable<T>(options, &typedAspectCreate<T>);
      |                                                       ^
creator/src/plugins/lua/bindings/settings.cpp:314:9: note: in instantiation of function template specialization 'Lua::Internal::addTypedAspect<Utils::IntegersAspect>' requested here
  314 |         addTypedAspect<IntegersAspect>(settings, "IntegersAspect");
      |         ^

Change-Id: If67ca19aa995622ef476386544b02a77b5af5916
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This commit is contained in:
hjk
2024-05-23 12:34:52 +02:00
parent 6fdcc5a3e5
commit a8c80cada6

View File

@@ -13841,7 +13841,7 @@ namespace sol { namespace stack {
} }
static bool max_size_check(std::true_type, T& cont, std::size_t idx) { static bool max_size_check(std::true_type, T& cont, std::size_t idx) {
return idx >= cont.max_size(); return idx >= std::size_t(cont.max_size());
} }
static T get(lua_State* L, int relindex, record& tracking) { static T get(lua_State* L, int relindex, record& tracking) {