summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfformfill.cpp12
-rw-r--r--fpdfsdk/fpdfview.cpp4
2 files changed, 8 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 9230910a1f..ed6279a2c6 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -480,13 +480,13 @@ DLLEXPORT void STDCALL FPDF_Widget_Copy(FPDF_DOCUMENT document,
pXFAMenuHander->Copy((IXFA_Widget*)hWidget, wsCpText);
CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
- int len = bsCpText.GetLength() / sizeof(unsigned short);
+ uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
if (wsText == NULL) {
*size = len;
return;
}
- int real_size = len < *size ? len : *size;
+ uint32_t real_size = len < *size ? len : *size;
if (real_size > 0) {
FXSYS_memcpy((void*)wsText,
bsCpText.GetBuffer(real_size * sizeof(unsigned short)),
@@ -516,13 +516,13 @@ DLLEXPORT void STDCALL FPDF_Widget_Cut(FPDF_DOCUMENT document,
pXFAMenuHander->Cut((IXFA_Widget*)hWidget, wsCpText);
CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
- int len = bsCpText.GetLength() / sizeof(unsigned short);
+ uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
if (wsText == NULL) {
*size = len;
return;
}
- int real_size = len < *size ? len : *size;
+ uint32_t real_size = len < *size ? len : *size;
if (real_size > 0) {
FXSYS_memcpy((void*)wsText,
bsCpText.GetBuffer(real_size * sizeof(unsigned short)),
@@ -625,13 +625,13 @@ FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE sHandle,
return FALSE;
std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle);
- int len = (*sSuggestWords)[index].GetLength();
+ uint32_t len = (*sSuggestWords)[index].GetLength();
if (!bsText) {
*size = len;
return TRUE;
}
- int real_size = len < *size ? len : *size;
+ uint32_t real_size = len < *size ? len : *size;
if (real_size > 0)
FXSYS_memcpy((void*)bsText, (const FX_CHAR*)(*sSuggestWords)[index],
real_size);
diff --git a/fpdfsdk/fpdfview.cpp b/fpdfsdk/fpdfview.cpp
index 9183b4073b..3a3449745c 100644
--- a/fpdfsdk/fpdfview.cpp
+++ b/fpdfsdk/fpdfview.cpp
@@ -391,7 +391,7 @@ class CMemFile final : public IFX_FileRead {
FX_SAFE_FILESIZE newPos =
pdfium::base::checked_cast<FX_FILESIZE, size_t>(size);
newPos += offset;
- if (!newPos.IsValid() || newPos.ValueOrDie() > (uint32_t)m_size) {
+ if (!newPos.IsValid() || newPos.ValueOrDie() > m_size) {
return FALSE;
}
FXSYS_memcpy(buffer, m_pBuf + offset, size);
@@ -1155,7 +1155,7 @@ DLLEXPORT FPDF_DEST STDCALL FPDF_GetNamedDest(FPDF_DOCUMENT document,
CFX_WideString wsName = PDF_DecodeText(bsName);
CFX_ByteString utf16Name = wsName.UTF16LE_Encode();
- unsigned int len = utf16Name.GetLength();
+ int len = utf16Name.GetLength();
if (!buffer) {
*buflen = len;
} else if (*buflen >= len) {