From ca16eb2857d2b322f023fd2e65e892671a6f76bb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 30 Aug 2014 02:05:21 -0700 Subject: [PATCH] Fix some type conversion warnings. --- thin3d/thin3d_d3d9.cpp | 2 +- ui/view.cpp | 2 +- ui/view.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/thin3d/thin3d_d3d9.cpp b/thin3d/thin3d_d3d9.cpp index 5336b4818c..a86009c569 100644 --- a/thin3d/thin3d_d3d9.cpp +++ b/thin3d/thin3d_d3d9.cpp @@ -515,7 +515,7 @@ static int VertexDataTypeToD3DType(T3DVertexDataType type) { Thin3DDX9VertexFormat::Thin3DDX9VertexFormat(LPDIRECT3DDEVICE9 device, const std::vector &components, int stride) : decl_(NULL) { D3DVERTEXELEMENT9 *elements = new D3DVERTEXELEMENT9[components.size() + 1]; - int i; + size_t i; for (i = 0; i < components.size(); i++) { elements[i].Stream = 0; elements[i].Offset = components[i].offset; diff --git a/ui/view.cpp b/ui/view.cpp index 422d8ac857..58132637ae 100644 --- a/ui/view.cpp +++ b/ui/view.cpp @@ -728,7 +728,7 @@ void TextEdit::Key(const KeyInput &input) { size_t maxPaste = maxLen_ - text_.size(); if (clipText.size() > maxPaste) { int end = 0; - while (end < maxPaste) { + while ((size_t)end < maxPaste) { u8_inc(clipText.c_str(), &end); } if (end > 0) { diff --git a/ui/view.h b/ui/view.h index 5db4c00b48..2289e08d07 100644 --- a/ui/view.h +++ b/ui/view.h @@ -673,7 +673,7 @@ public: TextEdit(const std::string &text, const std::string &placeholderText, LayoutParams *layoutParams = 0); void SetText(const std::string &text) { text_ = text; caret_ = (int)text_.size(); } const std::string &GetText() const { return text_; } - void SetMaxLen(int maxLen) { maxLen_ = maxLen; } + void SetMaxLen(size_t maxLen) { maxLen_ = maxLen; } virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const override; virtual void Draw(UIContext &dc) override; @@ -687,7 +687,7 @@ private: std::string undo_; std::string placeholderText_; int caret_; - int maxLen_; + size_t maxLen_; bool ctrlDown_; // TODO: Make some global mechanism for this. // TODO: Selections };