Przeglądaj źródła

Warning fixes for 64-bit architectures

ocornut 10 lat temu
rodzic
commit
b0eac255ca
2 zmienionych plików z 3 dodań i 3 usunięć
  1. 1 1
      examples/directx9_example/main.cpp
  2. 2 2
      imgui.cpp

+ 1 - 1
examples/directx9_example/main.cpp

@@ -35,7 +35,7 @@ static void ImImpl_RenderDrawLists(ImDrawList** const cmd_lists, int cmd_lists_c
 
     // Copy and convert all vertices into a single contiguous buffer
     CUSTOMVERTEX* vtx_dst;
-    if (g_pVB->Lock(0, total_vtx_count, (void**)&vtx_dst, D3DLOCK_DISCARD) < 0)
+    if (g_pVB->Lock(0, (UINT)total_vtx_count, (void**)&vtx_dst, D3DLOCK_DISCARD) < 0)
         return;
     for (int n = 0; n < cmd_lists_count; n++)
     {

+ 2 - 2
imgui.cpp

@@ -6532,7 +6532,7 @@ bool    ImFontAtlas::Build()
 
         // Setup ranges
         int glyph_count = 0;
-        size_t glyph_ranges_count = 0;
+        int glyph_ranges_count = 0;
         for (const ImWchar* in_range = data.GlyphRanges; in_range[0] && in_range[1]; in_range += 2)
         {
             glyph_count += (in_range[1] - in_range[0]) + 1;
@@ -6541,7 +6541,7 @@ bool    ImFontAtlas::Build()
         data.Ranges = buf_ranges + buf_ranges_n;
         data.RangesCount = glyph_ranges_count;
         buf_ranges_n += glyph_ranges_count;
-        for (size_t i = 0; i < glyph_ranges_count; i++)
+        for (int i = 0; i < glyph_ranges_count; i++)
         {
             const ImWchar* in_range = &data.GlyphRanges[i * 2];
             stbtt_pack_range& range = data.Ranges[i];