Address some issues
parent
e7612dc805
commit
a786ca8782
|
@ -463,7 +463,7 @@
|
|||
@@ LUA_UNSIGNED is the integral type used by lua_pushunsigned/lua_tounsigned.
|
||||
** It must have at least 32 bits.
|
||||
*/
|
||||
#define LUA_UNSIGNED size_t
|
||||
#define LUA_UNSIGNED unsigned LUA_INT32
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -21,11 +21,7 @@ struct FrameId {
|
|||
constexpr bool operator!=(FrameId rhs) const { return m_id != rhs.m_id; }
|
||||
|
||||
constexpr bool valid() const { return m_id != Invalid; }
|
||||
constexpr size_t id() const {
|
||||
// Cannot use an `if` in constexpr context in C++11, sorry
|
||||
return valid() ? static_cast<size_t>(m_id) : (std::terminate(), 0);
|
||||
}
|
||||
constexpr int unchecked_id() const { return m_id; }
|
||||
constexpr size_t id() const { return m_id; }
|
||||
|
||||
private:
|
||||
uint32_t m_id;
|
||||
|
|
|
@ -50,7 +50,7 @@ namespace Graphics {
|
|||
void *negZ;
|
||||
};
|
||||
|
||||
// WARNING: internal values shall not be changed
|
||||
// WARNING: TextureDescriptor is intended to be immutable. Internal values should not be changed!
|
||||
class TextureDescriptor {
|
||||
public:
|
||||
TextureDescriptor() :
|
||||
|
|
|
@ -527,8 +527,8 @@ static int l_pigui_plot_histogram(lua_State *l)
|
|||
std::unique_ptr<float[]> values(new float[vals.Size()]);
|
||||
float max = FLT_MIN;
|
||||
float min = FLT_MAX;
|
||||
for (size_t i = 1; i <= vals.Size(); i++) {
|
||||
values[i - 1] = vals.Get<size_t>(i);
|
||||
for (uint32_t i = 1; i <= vals.Size(); i++) {
|
||||
values[i - 1] = vals.Get<uint32_t>(i);
|
||||
if (values[i - 1] > max)
|
||||
max = values[i - 1];
|
||||
if (values[i - 1] < min)
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
inline void pi_lua_generic_push(lua_State *l, bool value) { lua_pushboolean(l, value); }
|
||||
inline void pi_lua_generic_push(lua_State *l, int value) { lua_pushinteger(l, value); }
|
||||
inline void pi_lua_generic_push(lua_State *l, unsigned int value) { lua_pushinteger(l, value); }
|
||||
inline void pi_lua_generic_push(lua_State *l, size_t value) { lua_pushunsigned(l, value); }
|
||||
inline void pi_lua_generic_push(lua_State *l, double value) { lua_pushnumber(l, value); }
|
||||
inline void pi_lua_generic_push(lua_State *l, const char *value) { lua_pushstring(l, value); }
|
||||
inline void pi_lua_generic_push(lua_State *l, const std::string &value)
|
||||
|
@ -24,7 +23,6 @@ inline void pi_lua_generic_push(lua_State *l, const std::string &value)
|
|||
inline void pi_lua_generic_pull(lua_State *l, int index, bool &out) { out = lua_toboolean(l, index); }
|
||||
inline void pi_lua_generic_pull(lua_State *l, int index, int &out) { out = luaL_checkinteger(l, index); }
|
||||
inline void pi_lua_generic_pull(lua_State *l, int index, unsigned int &out) { out = luaL_checkunsigned(l, index); }
|
||||
inline void pi_lua_generic_pull(lua_State *l, int index, size_t &out) { out = luaL_checkunsigned(l, index); }
|
||||
inline void pi_lua_generic_pull(lua_State *l, int index, float &out) { out = luaL_checknumber(l, index); }
|
||||
inline void pi_lua_generic_pull(lua_State *l, int index, double &out) { out = luaL_checknumber(l, index); }
|
||||
inline void pi_lua_generic_pull(lua_State *l, int index, const char *&out) { out = luaL_checkstring(l, index); }
|
||||
|
|
|
@ -61,12 +61,12 @@ static int CleanupStyleStack(SavedImguiStackInfo *stackInfo)
|
|||
// to an bigger signed type. In this case, `uint32_t` -> `int64_t`.
|
||||
auto &colorStack = ImGui::GetCurrentContext()->ColorModifiers;
|
||||
int numResetStyles = colorStack.size() - stackInfo->styleColorStack;
|
||||
if (colorStack.size() > (int64_t)stackInfo->styleColorStack)
|
||||
if (colorStack.size() > int64_t(stackInfo->styleColorStack))
|
||||
ImGui::PopStyleColor(colorStack.size() - stackInfo->styleColorStack);
|
||||
|
||||
auto &varStack = ImGui::GetCurrentContext()->StyleModifiers;
|
||||
numResetStyles += varStack.size() - stackInfo->styleVarStack;
|
||||
if (varStack.size() > (int64_t)stackInfo->styleVarStack)
|
||||
if (varStack.size() > int64_t(stackInfo->styleVarStack))
|
||||
ImGui::PopStyleVar(varStack.size() - stackInfo->styleVarStack);
|
||||
|
||||
return numResetStyles;
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
namespace Text {
|
||||
|
||||
// WARNING: internal values shall not be changed
|
||||
// WARNING: FontConfig is intended to be immutable; internal values shall not be changed
|
||||
class FontConfig {
|
||||
public:
|
||||
// XXX scale is to support to the old UI, and will be removed
|
||||
|
|
Loading…
Reference in New Issue