From 91b8302dec04ca4ddc1f91545d192350665580cf Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 25 Jul 2018 22:56:45 +0000 Subject: Use incomplete type CFX_BmpContext in place of void* Allows killing off static_cast<> in two places. Change-Id: I467b69d92e8cbda5c2916b6ed2e97c173d8b4f2f Reviewed-on: https://pdfium-review.googlesource.com/38897 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fxcodec/bmp/cfx_bmpdecompressor.cpp | 6 ++---- core/fxcodec/bmp/cfx_bmpdecompressor.h | 8 +++----- 2 files changed, 5 insertions(+), 9 deletions(-) (limited to 'core') diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp index b490004853..c56d17d15d 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp @@ -66,13 +66,11 @@ void CFX_BmpDecompressor::Error() { void CFX_BmpDecompressor::ReadScanline(uint32_t row_num_, const std::vector& row_buf) { - auto* p = static_cast(context_ptr_); - p->m_pDelegate->BmpReadScanline(row_num_, row_buf); + context_ptr_->m_pDelegate->BmpReadScanline(row_num_, row_buf); } bool CFX_BmpDecompressor::GetDataPosition(uint32_t rcd_pos) { - auto* p = reinterpret_cast(context_ptr_); - return p->m_pDelegate->BmpInputImagePositionBuf(rcd_pos); + return context_ptr_->m_pDelegate->BmpInputImagePositionBuf(rcd_pos); } int32_t CFX_BmpDecompressor::ReadHeader() { diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.h b/core/fxcodec/bmp/cfx_bmpdecompressor.h index 152a2bd0ee..2f1585e649 100644 --- a/core/fxcodec/bmp/cfx_bmpdecompressor.h +++ b/core/fxcodec/bmp/cfx_bmpdecompressor.h @@ -16,6 +16,8 @@ #include "core/fxcrt/cfx_memorystream.h" +class CFX_BmpContext; + class CFX_BmpDecompressor { public: CFX_BmpDecompressor(); @@ -28,12 +30,9 @@ class CFX_BmpDecompressor { FX_FILESIZE GetAvailInput(uint8_t** avail_buf); jmp_buf jmpbuf_; - - void* context_ptr_; - + CFX_BmpContext* context_ptr_; std::vector out_row_buffer_; std::vector palette_; - uint32_t header_offset_; uint32_t width_; uint32_t height_; @@ -56,7 +55,6 @@ class CFX_BmpDecompressor { uint32_t mask_red_; uint32_t mask_green_; uint32_t mask_blue_; - int32_t decode_status_; private: -- cgit v1.2.3