Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1865)

Unified Diff: core/fxcodec/jbig2/JBig2_Context.cpp

Issue 1840483003: Reduce signed/unsigned comparison warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fxcodec/codec/fx_codec_flate.cpp ('k') | core/fxcrt/include/fx_ext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/jbig2/JBig2_Context.cpp
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index 1c316a0dd2d9a48d4dea23f6e1aed2dc59b46c3c..1ff78e121fea9c1baf6e918d24eb5f191c1259d9 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -1277,7 +1277,7 @@ JBig2HuffmanCode* CJBig2_Context::decodeSymbolIDHuffmanTable(
const size_t kRunCodesSize = 35;
int32_t runcodes[kRunCodesSize];
int32_t runcodes_len[kRunCodesSize];
- for (int32_t i = 0; i < kRunCodesSize; ++i) {
+ for (size_t i = 0; i < kRunCodesSize; ++i) {
if (pStream->readNBits(4, &runcodes_len[i]) != 0)
return nullptr;
}
@@ -1288,7 +1288,7 @@ JBig2HuffmanCode* CJBig2_Context::decodeSymbolIDHuffmanTable(
int32_t run;
int32_t i = 0;
while (i < (int)SBNUMSYMS) {
- int32_t j;
+ size_t j;
int32_t nVal = 0;
int32_t nBits = 0;
uint32_t nTemp;
@@ -1299,15 +1299,13 @@ JBig2HuffmanCode* CJBig2_Context::decodeSymbolIDHuffmanTable(
nVal = (nVal << 1) | nTemp;
++nBits;
for (j = 0; j < kRunCodesSize; ++j) {
- if (nBits == runcodes_len[j] && nVal == runcodes[j]) {
+ if (nBits == runcodes_len[j] && nVal == runcodes[j])
break;
- }
}
- if (j < kRunCodesSize) {
+ if (j < kRunCodesSize)
break;
- }
}
- int32_t runcode = j;
+ int32_t runcode = static_cast<int32_t>(j);
if (runcode < 32) {
SBSYMCODES.get()[i].codelen = runcode;
run = 0;
@@ -1327,11 +1325,11 @@ JBig2HuffmanCode* CJBig2_Context::decodeSymbolIDHuffmanTable(
if (run > 0) {
if (i + run > (int)SBNUMSYMS)
return nullptr;
- for (j = 0; j < run; ++j) {
+ for (int32_t k = 0; k < run; ++k) {
if (runcode == 32 && i > 0) {
- SBSYMCODES.get()[i + j].codelen = SBSYMCODES.get()[i - 1].codelen;
+ SBSYMCODES.get()[i + k].codelen = SBSYMCODES.get()[i - 1].codelen;
} else {
- SBSYMCODES.get()[i + j].codelen = 0;
+ SBSYMCODES.get()[i + k].codelen = 0;
}
}
i += run;
« no previous file with comments | « core/fxcodec/codec/fx_codec_flate.cpp ('k') | core/fxcrt/include/fx_ext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698