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 <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
index b490004..c56d17d 100644
--- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
+++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
@@ -66,13 +66,11 @@
void CFX_BmpDecompressor::ReadScanline(uint32_t row_num_,
const std::vector<uint8_t>& row_buf) {
- auto* p = static_cast<CFX_BmpContext*>(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<CFX_BmpContext*>(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 152a2bd..2f1585e 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 @@
FX_FILESIZE GetAvailInput(uint8_t** avail_buf);
jmp_buf jmpbuf_;
-
- void* context_ptr_;
-
+ CFX_BmpContext* context_ptr_;
std::vector<uint8_t> out_row_buffer_;
std::vector<uint32_t> palette_;
-
uint32_t header_offset_;
uint32_t width_;
uint32_t height_;
@@ -56,7 +55,6 @@
uint32_t mask_red_;
uint32_t mask_green_;
uint32_t mask_blue_;
-
int32_t decode_status_;
private: