aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--cocoa/ScintillaCocoa.h4
-rw-r--r--cocoa/ScintillaCocoa.mm12
2 files changed, 8 insertions, 8 deletions
diff --git a/cocoa/ScintillaCocoa.h b/cocoa/ScintillaCocoa.h
index b9f851875..9673b1b50 100644
--- a/cocoa/ScintillaCocoa.h
+++ b/cocoa/ScintillaCocoa.h
@@ -109,8 +109,8 @@ private:
bool GetPasteboardData(NSPasteboard* board, SelectionText* selectedText);
void SetPasteboardData(NSPasteboard* board, const SelectionText& selectedText);
- int TargetAsUTF8(char *text);
- int EncodedFromUTF8(char *utf8, char *encoded) const;
+ ptrdiff_t TargetAsUTF8(char *text);
+ ptrdiff_t EncodedFromUTF8(char *utf8, char *encoded) const;
int scrollSpeed;
int scrollTicks;
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm
index ed48f82d2..c255c97c9 100644
--- a/cocoa/ScintillaCocoa.mm
+++ b/cocoa/ScintillaCocoa.mm
@@ -1646,7 +1646,7 @@ bool ScintillaCocoa::GetPasteboardData(NSPasteboard* board, SelectionText* selec
// Returns the target converted to UTF8.
// Return the length in bytes.
-int ScintillaCocoa::TargetAsUTF8(char *text)
+ptrdiff_t ScintillaCocoa::TargetAsUTF8(char *text)
{
const Sci::Position targetLength = targetEnd - targetStart;
if (IsUnicodeMode())
@@ -1667,7 +1667,7 @@ int ScintillaCocoa::TargetAsUTF8(char *text)
if (text)
memcpy(text, tmputf.c_str(), tmputf.length());
CFRelease(cfsVal);
- return static_cast<int>(tmputf.length());
+ return static_cast<ptrdiff_t>(tmputf.length());
}
return targetLength;
}
@@ -1754,14 +1754,14 @@ NSRect ScintillaCocoa::GetBounds() const {
// Translates a UTF8 string into the document encoding.
// Return the length of the result in bytes.
-int ScintillaCocoa::EncodedFromUTF8(char *utf8, char *encoded) const
+ptrdiff_t ScintillaCocoa::EncodedFromUTF8(char *utf8, char *encoded) const
{
- const int inputLength = (lengthForEncode >= 0) ? lengthForEncode : static_cast<int>(strlen(utf8));
+ const size_t inputLength = (lengthForEncode >= 0) ? lengthForEncode : strlen(utf8);
if (IsUnicodeMode())
{
if (encoded)
memcpy(encoded, utf8, inputLength);
- return inputLength;
+ return static_cast<ptrdiff_t>(inputLength);
}
else
{
@@ -1774,7 +1774,7 @@ int ScintillaCocoa::EncodedFromUTF8(char *utf8, char *encoded) const
if (encoded)
memcpy(encoded, sEncoded.c_str(), sEncoded.length());
CFRelease(cfsVal);
- return static_cast<int>(sEncoded.length());
+ return static_cast<ptrdiff_t>(sEncoded.length());
}
}