summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorWei Li <weili@chromium.org>2016-03-28 10:33:33 -0700
committerWei Li <weili@chromium.org>2016-03-28 10:33:33 -0700
commit8940993efffaaf432320509555dc61122b8b72b2 (patch)
tree2e9c42a78d96061ae06ee052e8a274ccfb8fcec7 /fpdfsdk
parentb5e8f14e3eefc5da995b332788d3203cee204883 (diff)
downloadpdfium-8940993efffaaf432320509555dc61122b8b72b2.tar.xz
Reduce signed/unsigned comparison warnings
The warnings generated by Clang. This is part 1 for some simple cases. BUG=pdfium:29 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1840483003 .
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fsdk_baseform.cpp8
-rw-r--r--fpdfsdk/fxedit/fxet_edit.cpp2
-rw-r--r--fpdfsdk/javascript/Document.cpp4
-rw-r--r--fpdfsdk/javascript/JS_Value.cpp2
-rw-r--r--fpdfsdk/pdfwindow/PWL_FontMap.cpp2
5 files changed, 9 insertions, 9 deletions
diff --git a/fpdfsdk/fsdk_baseform.cpp b/fpdfsdk/fsdk_baseform.cpp
index 5dd27f845f..1e124623f7 100644
--- a/fpdfsdk/fsdk_baseform.cpp
+++ b/fpdfsdk/fsdk_baseform.cpp
@@ -2800,13 +2800,13 @@ void CBA_AnnotIterator::GenerateResults() {
sa.erase(sa.begin() + nLeftTopIndex);
std::vector<int> aSelect;
- for (int i = 0; i < sa.size(); ++i) {
+ for (size_t i = 0; i < sa.size(); ++i) {
CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
FX_FLOAT fCenterY = (rcAnnot.top + rcAnnot.bottom) / 2.0f;
if (fCenterY > rcLeftTop.bottom && fCenterY < rcLeftTop.top)
aSelect.push_back(i);
}
- for (int i = 0; i < aSelect.size(); ++i)
+ for (size_t i = 0; i < aSelect.size(); ++i)
m_Annots.push_back(sa[aSelect[i]]);
for (int i = aSelect.size() - 1; i >= 0; --i)
@@ -2844,13 +2844,13 @@ void CBA_AnnotIterator::GenerateResults() {
sa.erase(sa.begin() + nLeftTopIndex);
std::vector<int> aSelect;
- for (int i = 0; i < sa.size(); ++i) {
+ for (size_t i = 0; i < sa.size(); ++i) {
CFX_FloatRect rcAnnot = GetAnnotRect(sa[i]);
FX_FLOAT fCenterX = (rcAnnot.left + rcAnnot.right) / 2.0f;
if (fCenterX > rcLeftTop.left && fCenterX < rcLeftTop.right)
aSelect.push_back(i);
}
- for (int i = 0; i < aSelect.size(); ++i)
+ for (size_t i = 0; i < aSelect.size(); ++i)
m_Annots.push_back(sa[aSelect[i]]);
for (int i = aSelect.size() - 1; i >= 0; --i)
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp
index 3d7e485f35..f45f9ea5f2 100644
--- a/fpdfsdk/fxedit/fxet_edit.cpp
+++ b/fpdfsdk/fxedit/fxet_edit.cpp
@@ -110,7 +110,7 @@ int32_t CFX_Edit_Provider::GetCharWidth(int32_t nFontIndex,
else
charcode = m_pFontMap->CharCodeFromUnicode(nFontIndex, word);
- if (charcode != -1)
+ if (charcode != CPDF_Font::kInvalidCharCode)
return pPDFFont->GetCharWidthF(charcode);
}
diff --git a/fpdfsdk/javascript/Document.cpp b/fpdfsdk/javascript/Document.cpp
index 0b793db049..70b4ef7e03 100644
--- a/fpdfsdk/javascript/Document.cpp
+++ b/fpdfsdk/javascript/Document.cpp
@@ -1460,7 +1460,7 @@ int Document::CountWords(CPDF_TextObject* pTextObj) {
FX_BOOL bIsLatin = FALSE;
for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
- uint32_t charcode = static_cast<uint32_t>(-1);
+ uint32_t charcode = CPDF_Font::kInvalidCharCode;
FX_FLOAT kerning;
pTextObj->GetCharInfo(i, charcode, kerning);
@@ -1493,7 +1493,7 @@ CFX_WideString Document::GetObjWordStr(CPDF_TextObject* pTextObj,
FX_BOOL bIsLatin = FALSE;
for (int i = 0, sz = pTextObj->CountChars(); i < sz; i++) {
- uint32_t charcode = static_cast<uint32_t>(-1);
+ uint32_t charcode = CPDF_Font::kInvalidCharCode;
FX_FLOAT kerning;
pTextObj->GetCharInfo(i, charcode, kerning);
diff --git a/fpdfsdk/javascript/JS_Value.cpp b/fpdfsdk/javascript/JS_Value.cpp
index 1d57833247..4d2a1d44a8 100644
--- a/fpdfsdk/javascript/JS_Value.cpp
+++ b/fpdfsdk/javascript/JS_Value.cpp
@@ -893,7 +893,7 @@ std::vector<CJS_Value> JS_ExpandKeywordParams(
va_list ap;
va_start(ap, nKeywords);
- for (int i = 0; i < nKeywords; ++i) {
+ for (size_t i = 0; i < nKeywords; ++i) {
const wchar_t* property = va_arg(ap, const wchar_t*);
v8::Local<v8::Value> v8Value =
FXJS_GetObjectElement(pRuntime->GetIsolate(), pObj, property);
diff --git a/fpdfsdk/pdfwindow/PWL_FontMap.cpp b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
index 0a5eef6b19..3f149e7193 100644
--- a/fpdfsdk/pdfwindow/PWL_FontMap.cpp
+++ b/fpdfsdk/pdfwindow/PWL_FontMap.cpp
@@ -177,7 +177,7 @@ void CPWL_FontMap::Initialize() {
}
FX_BOOL CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName) {
- for (int32_t i = 0; i < FX_ArraySize(g_sDEStandardFontName); ++i) {
+ for (size_t i = 0; i < FX_ArraySize(g_sDEStandardFontName); ++i) {
if (sFontName == g_sDEStandardFontName[i])
return TRUE;
}