From 1f4d8492095a3d6c6d3452ef075a91d4764a5dc5 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Tue, 22 May 2018 15:55:58 +0000 Subject: Remove return value from CJBig2_Image::SetPixel(). Nobody reads it. Change-Id: I76c0f5881e5432d2086cb8eaec7fc70fa5b71536 Reviewed-on: https://pdfium-review.googlesource.com/32741 Reviewed-by: Ryan Harrison Commit-Queue: Ryan Harrison --- core/fxcodec/jbig2/JBig2_Image.cpp | 19 +++++++------------ core/fxcodec/jbig2/JBig2_Image.h | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/core/fxcodec/jbig2/JBig2_Image.cpp b/core/fxcodec/jbig2/JBig2_Image.cpp index 089f9e44d6..2719c2733d 100644 --- a/core/fxcodec/jbig2/JBig2_Image.cpp +++ b/core/fxcodec/jbig2/JBig2_Image.cpp @@ -89,24 +89,19 @@ int CJBig2_Image::GetPixel(int32_t x, int32_t y) const { return ((data()[m] >> (7 - n)) & 1); } -int32_t CJBig2_Image::SetPixel(int32_t x, int32_t y, int v) { +void CJBig2_Image::SetPixel(int32_t x, int32_t y, int v) { if (!m_pData) - return 0; - - if (x < 0 || x >= m_nWidth) - return 0; + return; - if (y < 0 || y >= m_nHeight) - return 0; + if (x < 0 || x >= m_nWidth || y < 0 || y >= m_nHeight) + return; int32_t m = y * m_nStride + (x >> 3); - int32_t n = x & 7; + int32_t n = 1 << (7 - (x & 7)); if (v) - data()[m] |= 1 << (7 - n); + data()[m] |= n; else - data()[m] &= ~(1 << (7 - n)); - - return 1; + data()[m] &= ~n; } void CJBig2_Image::CopyLine(int32_t hTo, int32_t hFrom) { diff --git a/core/fxcodec/jbig2/JBig2_Image.h b/core/fxcodec/jbig2/JBig2_Image.h index 7c087c2385..3cf28b0643 100644 --- a/core/fxcodec/jbig2/JBig2_Image.h +++ b/core/fxcodec/jbig2/JBig2_Image.h @@ -37,7 +37,7 @@ class CJBig2_Image { uint8_t* data() const { return m_pData.Get(); } int GetPixel(int32_t x, int32_t y) const; - int32_t SetPixel(int32_t x, int32_t y, int bVal); + void SetPixel(int32_t x, int32_t y, int bVal); void CopyLine(int32_t hTo, int32_t hFrom); void Fill(bool v); -- cgit v1.2.3