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

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

Issue 1801383002: Re-enable several MSVC warnings (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: 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
Index: core/fxcodec/jbig2/JBig2_Image.cpp
diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp
index 311c38270ee940b0103752e6fe838c49ba2755a5..e4520d8b1ee12e35a4ca84a075a727e31da86b72 100644
--- a/core/fxcodec/jbig2/JBig2_Image.cpp
+++ b/core/fxcodec/jbig2/JBig2_Image.cpp
@@ -665,20 +665,21 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image* pDst,
int32_t y,
JBig2ComposeOp op,
const FX_RECT* pSrcRect) {
- int32_t xs0, ys0, xs1, ys1, xd0, yd0, xd1, yd1, xx, yy, w, h, middleDwords,
- lineLeft;
- FX_DWORD s1, d1, d2, shift, shift1, shift2, tmp, tmp1, tmp2, maskL, maskR,
- maskM;
- uint8_t *lineSrc, *lineDst, *sp, *dp;
- int32_t sw, sh;
+ int32_t xs0 = 0, ys0 = 0, xs1 = 0, ys1 = 0;
dsinclair 2016/03/16 13:23:31 nit: one per line.
Wei Li 2016/03/16 17:51:31 Done.
Tom Sepez 2016/03/16 18:34:59 I didn't see how these could be used uninitialized
Wei Li 2016/03/17 02:24:05 Done.
+ int32_t xd0 = 0, yd0 = 0, xx = 0, yy = 0;
+ FX_DWORD shift = 0, shift1 = 0, shift2 = 0;
+ FX_DWORD tmp1 = 0, tmp2 = 0;
+ uint8_t* sp = nullptr;
+ uint8_t* dp = nullptr;
+ FX_DWORD tmp = 0;
if (!m_pData) {
return FALSE;
}
if (x < -1048576 || x > 1048576 || y < -1048576 || y > 1048576) {
Tom Sepez 2016/03/16 18:34:59 nit: they probably mean >= 1048576, since x wont f
Wei Li 2016/03/17 02:24:05 Ack. I am not certain about the code here, will de
return FALSE;
}
- sw = pSrcRect->Width();
- sh = pSrcRect->Height();
+ int32_t sw = pSrcRect->Width();
+ int32_t sh = pSrcRect->Height();
if (y < 0) {
ys0 = -y;
} else {
@@ -702,8 +703,8 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image* pDst,
if ((ys0 >= ys1) || (xs0 >= xs1)) {
return 0;
}
- w = xs1 - xs0;
- h = ys1 - ys0;
+ int32_t w = xs1 - xs0;
+ int32_t h = ys1 - ys0;
if (y < 0) {
yd0 = 0;
} else {
@@ -714,18 +715,18 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image* pDst,
} else {
xd0 = x;
}
- xd1 = xd0 + w;
- yd1 = yd0 + h;
- d1 = xd0 & 31;
- d2 = xd1 & 31;
- s1 = xs0 & 31;
- maskL = 0xffffffff >> d1;
- maskR = 0xffffffff << ((32 - (xd1 & 31)) % 32);
- maskM = maskL & maskR;
- lineSrc = m_pData + (pSrcRect->top + ys0) * m_nStride +
- (((xs0 + pSrcRect->left) >> 5) << 2);
- lineLeft = m_nStride - ((xs0 >> 5) << 2);
- lineDst = pDst->m_pData + yd0 * pDst->m_nStride + ((xd0 >> 5) << 2);
+ int32_t xd1 = xd0 + w;
+ int32_t yd1 = yd0 + h;
+ int32_t d1 = xd0 & 31;
+ int32_t d2 = xd1 & 31;
+ int32_t s1 = xs0 & 31;
+ int32_t maskL = 0xffffffff >> d1;
+ int32_t maskR = 0xffffffff << ((32 - (xd1 & 31)) % 32);
+ int32_t maskM = maskL & maskR;
+ uint8_t* lineSrc = m_pData + (pSrcRect->top + ys0) * m_nStride +
+ (((xs0 + pSrcRect->left) >> 5) << 2);
+ int32_t lineLeft = m_nStride - ((xs0 >> 5) << 2);
+ uint8_t* lineDst = pDst->m_pData + yd0 * pDst->m_nStride + ((xd0 >> 5) << 2);
if ((xd0 & ~31) == ((xd1 - 1) & ~31)) {
if ((xs0 & ~31) == ((xs1 - 1) & ~31)) {
if (s1 > d1) {
@@ -820,6 +821,7 @@ FX_BOOL CJBig2_Image::composeTo_opt2(CJBig2_Image* pDst,
}
}
} else {
+ int32_t middleDwords = 0;
Tom Sepez 2016/03/16 18:34:59 I don't think this needs to persist between blocks
Wei Li 2016/03/17 02:24:05 Done.
if (s1 > d1) {
shift1 = s1 - d1;
shift2 = 32 - shift1;

Powered by Google App Engine
This is Rietveld 408576698