diff --git a/3rdparty/ocornut-imgui/imgui.cpp b/3rdparty/ocornut-imgui/imgui.cpp index c2cde18b6..d87edc5fd 100644 --- a/3rdparty/ocornut-imgui/imgui.cpp +++ b/3rdparty/ocornut-imgui/imgui.cpp @@ -318,6 +318,7 @@ #include // new (ptr) #ifdef _MSC_VER +#pragma warning (disable: 4505) // unreferenced local function has been removed #pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen #endif @@ -1936,7 +1937,7 @@ static void LogText(const ImVec2& ref_pos, const char* text, const char* text_en if (g.LogStartDepth > window->DC.TreeDepth) // Re-adjust padding if we have popped out of our starting depth g.LogStartDepth = window->DC.TreeDepth; const int tree_depth = (window->DC.TreeDepth - g.LogStartDepth); - while (true) + for (;;) { // Split the string. Each new line (after a '\n') is followed by spacing corresponding to the current depth of our log entry. const char* line_end = text_remaining; @@ -8382,7 +8383,7 @@ struct ExampleAppConsole { // Multiple matches. Complete as much as we can, so inputing "C" will complete to "CL" and display "CLEAR" and "CLASSIFY" int match_len = (int)(word_end - word_start); - while (true) + for (;;) { int c = 0; bool all_candidates_matches = true; @@ -8582,7 +8583,7 @@ static unsigned int stb_decompress(unsigned char *output, unsigned char *i, unsi i += 16; stb__dout = output; - while (1) { + for (;;) { unsigned char *old_i = i; i = stb_decompress_token(i); if (i == old_i) { diff --git a/src/bgfx.cpp b/src/bgfx.cpp index 9435ead64..a4cb7fbd1 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -710,7 +710,7 @@ namespace bgfx BX_WARN(invalidHandle != m_key.m_program, "Program with invalid handle"); if (invalidHandle != m_key.m_program) { - m_key.m_depth = _depth; + m_key.m_depth = (uint32_t)_depth; m_key.m_view = _id; m_key.m_seq = s_ctx->m_seq[_id] & s_ctx->m_seqMask[_id]; s_ctx->m_seq[_id]++; diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 09ca310bc..99bc3ec9d 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -675,7 +675,7 @@ namespace bgfx void operator=(const CommandBuffer&); }; -#define SORT_KEY_RENDER_DRAW UINT64_C(0x0000000800000000) +#define SORT_KEY_RENDER_DRAW (UINT64_C(1)<<0x2b) BX_STATIC_ASSERT(BGFX_CONFIG_MAX_VIEWS <= 32); BX_STATIC_ASSERT( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // must be power of 2 @@ -686,17 +686,17 @@ namespace bgfx { // | 3 2 1 0| // |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210| - // | vvvvvsssssssssssdttpppppppppdddddddddddddddddddddddd| - // | ^ ^^ ^ ^ ^| - // | | || | | || - // | view-+ seq-+| +-trans +-program depth-+| - // | +-draw | + // | vvvvvsssssssssssdttpppppppppdddddddddddddddddddddddddddddddd| + // | ^ ^^ ^ ^ ^| + // | | || | | || + // | view-+ seq-+| +-trans +-program depth-+| + // | +-draw | const uint64_t depth = m_depth; - const uint64_t program = uint64_t(m_program)<<0x18; - const uint64_t trans = uint64_t(m_trans )<<0x21; - const uint64_t seq = uint64_t(m_seq )<<0x24; - const uint64_t view = uint64_t(m_view )<<0x2f; + const uint64_t program = uint64_t(m_program)<<0x20; + const uint64_t trans = uint64_t(m_trans )<<0x29; + const uint64_t seq = uint64_t(m_seq )<<0x2c; + const uint64_t view = uint64_t(m_view )<<0x37; const uint64_t key = depth|program|trans|SORT_KEY_RENDER_DRAW|seq|view; return key; } @@ -705,15 +705,15 @@ namespace bgfx { // | 3 2 1 0| // |fedcba9876543210fedcba9876543210fedcba9876543210fedcba9876543210| - // | vvvvvsssssssssssdppppppppp | - // | ^ ^^ ^ | - // | | || | | - // | view-+ seq-+| +-program | - // | +-draw | + // | vvvvvsssssssssssdppppppppp | + // | ^ ^^ ^ | + // | | || | | + // | view-+ seq-+| +-program | + // | +-draw | - const uint64_t program = uint64_t(m_program)<<0x1a; - const uint64_t seq = uint64_t(m_seq )<<0x24; - const uint64_t view = uint64_t(m_view )<<0x2f; + const uint64_t program = uint64_t(m_program)<<0x22; + const uint64_t seq = uint64_t(m_seq )<<0x2c; + const uint64_t view = uint64_t(m_view )<<0x37; const uint64_t key = program|seq|view; return key; } @@ -721,17 +721,17 @@ namespace bgfx /// Returns true if item is command. bool decode(uint64_t _key) { - m_seq = (_key>>0x24)& 0x7ff; - m_view = (_key>>0x2f)&(BGFX_CONFIG_MAX_VIEWS-1); + m_seq = (_key>>0x2c)& 0x7ff; + m_view = (_key>>0x37)&(BGFX_CONFIG_MAX_VIEWS-1); if (_key & SORT_KEY_RENDER_DRAW) { m_depth = _key & 0xffffffff; - m_program = (_key>>0x18)&(BGFX_CONFIG_MAX_PROGRAMS-1); - m_trans = (_key>>0x21)& 0x3; + m_program = (_key>>0x20)&(BGFX_CONFIG_MAX_PROGRAMS-1); + m_trans = (_key>>0x29)& 0x3; return false; // draw } - m_program = (_key>>0x1a)&(BGFX_CONFIG_MAX_PROGRAMS-1); + m_program = (_key>>0x22)&(BGFX_CONFIG_MAX_PROGRAMS-1); return true; // compute } @@ -744,7 +744,7 @@ namespace bgfx m_trans = 0; } - int32_t m_depth; + uint32_t m_depth; uint16_t m_program; uint16_t m_seq; uint8_t m_view;