summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfformfill.cpp
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-03-31 15:08:27 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-31 15:08:27 -0700
commit47ca692c8150cb39abef5737e866b91e6a105b80 (patch)
treecba8531fe7a569cfa7f05dc84f158bf1cf15be23 /fpdfsdk/fpdfformfill.cpp
parentde0d852ed91973deda41f949e132b12a2efff1ef (diff)
downloadpdfium-47ca692c8150cb39abef5737e866b91e6a105b80.tar.xz
Re-enable all the windows warnings except 4267
The code is changed or had been changed to no longer generate these warnings. It is safe to re-enabled these warnings. In this code change, we fixed some code which generates warnings 4018 (signed/unsigned mismatch) and 4146 (unary minus operator applied to unsigned type, result still unsigned). Warning 4333 (right shift by too large amount, data loss) and 4345 (an object of POD type constructed with an initializer of the form () will be default-initialized) are no longer generated. The same setting is applied and verified for GN build as well. BUG=pdfium:29 Review URL: https://codereview.chromium.org/1849443003
Diffstat (limited to 'fpdfsdk/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/fpdfformfill.cpp12
1 files changed, 6 insertions, 6 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);