mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-15 21:50:05 +00:00
Merge pull request #1622 from JayFoxRox/fix-warnings
Avoid warnings by casting to size_t for ARRAY_SIZE() comparisons
This commit is contained in:
commit
fc6f898e0b
@ -22,7 +22,7 @@ inline GLenum TextureFilterMode(Pica::Regs::TextureConfig::TextureFilter mode) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (mode >= ARRAY_SIZE(filter_mode_table)) {
|
if (static_cast<size_t>(mode) >= ARRAY_SIZE(filter_mode_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode %d", mode);
|
LOG_CRITICAL(Render_OpenGL, "Unknown texture filtering mode %d", mode);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ inline GLenum WrapMode(Pica::Regs::TextureConfig::WrapMode mode) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if (mode >= ARRAY_SIZE(wrap_mode_table)) {
|
if (static_cast<size_t>(mode) >= ARRAY_SIZE(wrap_mode_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode %d", mode);
|
LOG_CRITICAL(Render_OpenGL, "Unknown texture wrap mode %d", mode);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ inline GLenum BlendFunc(Pica::Regs::BlendFactor factor) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if ((unsigned)factor >= ARRAY_SIZE(blend_func_table)) {
|
if (static_cast<size_t>(factor) >= ARRAY_SIZE(blend_func_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor %d", factor);
|
LOG_CRITICAL(Render_OpenGL, "Unknown blend factor %d", factor);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ inline GLenum LogicOp(Pica::Regs::LogicOp op) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if ((unsigned)op >= ARRAY_SIZE(logic_op_table)) {
|
if (static_cast<size_t>(op) >= ARRAY_SIZE(logic_op_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", op);
|
LOG_CRITICAL(Render_OpenGL, "Unknown logic op %d", op);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ inline GLenum CompareFunc(Pica::Regs::CompareFunc func) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if ((unsigned)func >= ARRAY_SIZE(compare_func_table)) {
|
if (static_cast<size_t>(func) >= ARRAY_SIZE(compare_func_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown compare function %d", func);
|
LOG_CRITICAL(Render_OpenGL, "Unknown compare function %d", func);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ inline GLenum StencilOp(Pica::Regs::StencilAction action) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Range check table for input
|
// Range check table for input
|
||||||
if ((unsigned)action >= ARRAY_SIZE(stencil_op_table)) {
|
if (static_cast<size_t>(action) >= ARRAY_SIZE(stencil_op_table)) {
|
||||||
LOG_CRITICAL(Render_OpenGL, "Unknown stencil op %d", action);
|
LOG_CRITICAL(Render_OpenGL, "Unknown stencil op %d", action);
|
||||||
UNREACHABLE();
|
UNREACHABLE();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user