Explorar o código

Fixed VS2013 warnings.

Branimir Karadžić %!s(int64=10) %!d(string=hai) anos
pai
achega
b8f2b24a82
Modificáronse 2 ficheiros con 12 adicións e 10 borrados
  1. 2 2
      3rdparty/ocornut-imgui/imgui.cpp
  2. 10 8
      examples/common/entry/entry.cpp

+ 2 - 2
3rdparty/ocornut-imgui/imgui.cpp

@@ -5618,8 +5618,8 @@ bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputT
             // From the moment we focused we are ignoring the content of 'buf'
             ImFormatString(edit_state.InitialText, IM_ARRAYSIZE(edit_state.InitialText), "%s", buf);
             const char* buf_end = NULL;
-            edit_state.CurLenW = ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
-            edit_state.CurLenA = buf_end - buf; // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
+            edit_state.CurLenW = (int)ImTextStrFromUtf8(edit_state.Text, IM_ARRAYSIZE(edit_state.Text), buf, NULL, &buf_end);
+            edit_state.CurLenA = (int)(buf_end - buf); // We can't get the result from ImFormatString() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
             edit_state.Width = w;
             edit_state.InputCursorScreenPos = ImVec2(-1.f,-1.f);
             edit_state.CursorAnimReset();

+ 10 - 8
examples/common/entry/entry.cpp

@@ -60,15 +60,17 @@ namespace entry
 
 		switch (_key)
 		{
-		case Key::Esc:       { return 0x1b; } break;
-		case Key::Return:    { return 0x0d; } break;
-		case Key::Tab:       { return 0x09; } break;
-		case Key::Space:     { return 0xa0; } break;
-		case Key::Backspace: { return 0x08; } break;
-		case Key::Plus:      { return 0x2b; } break;
-		case Key::Minus:     { return 0x2d; } break;
-		default:        { return '\0'; } break;
+		case Key::Esc:       return 0x1b;
+		case Key::Return:    return 0x0d;
+		case Key::Tab:       return 0x09;
+		case Key::Space:     return (char)0xa0;
+		case Key::Backspace: return 0x08;
+		case Key::Plus:      return 0x2b;
+		case Key::Minus:     return 0x2d;
+		default:             break;
 		}
+
+		return '\0';
 	}
 
 	bool setOrToggle(uint32_t& _flags, const char* _name, uint32_t _bit, int _first, int _argc, char const* const* _argv)