From 5ce0189a77f46696eaa1f3cc5dd0aff2bb5cabd4 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sun, 21 Apr 2002 10:20:59 +0000 Subject: Some Win64 compatibility and size_t correctness. --- src/Document.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/Document.cxx') diff --git a/src/Document.cxx b/src/Document.cxx index def80c49c..22cb0c2b0 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -512,15 +512,16 @@ bool Document::InsertString(int position, const char *s) { } // Insert a string with a length -bool Document::InsertString(int position, const char *s, int insertLength) { +bool Document::InsertString(int position, const char *s, size_t insertLength) { bool changed = false; char *sWithStyle = new char[insertLength * 2]; if (sWithStyle) { - for (int i = 0; i < insertLength; i++) { + for (size_t i = 0; i < insertLength; i++) { sWithStyle[i*2] = s[i]; sWithStyle[i*2 + 1] = 0; } - changed = InsertStyledString(position*2, sWithStyle, insertLength*2); + changed = InsertStyledString(position*2, sWithStyle, + static_cast(insertLength*2)); delete []sWithStyle; } return changed; @@ -928,7 +929,7 @@ long Document::FindText(int minPos, int maxPos, const char *s, // Compute actual search ranges needed int lengthFind = *length; if (lengthFind == -1) - lengthFind = strlen(s); + lengthFind = static_cast(strlen(s)); int endSearch = endPos; if (startPos <= endPos) { endSearch = endPos - lengthFind + 1; -- cgit v1.2.3