From 994d8b4e363bb86128593a9000a17b0e79f849f5 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Fri, 10 Aug 2018 20:03:34 +0000 Subject: Remove const args and const_casts where not required. Introduce const/non-const versions of method where required. Part of the war on const_cast<>. Tidy one expression to use [] instead of .data(). Change-Id: I41e45669c79eee242ff2244c7dc3afcf6386a433 Reviewed-on: https://pdfium-review.googlesource.com/39852 Reviewed-by: Lei Zhang Commit-Queue: Tom Sepez --- core/fxcodec/codec/ccodec_bmpmodule.cpp | 4 ++-- core/fxcodec/codec/ccodec_bmpmodule.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'core/fxcodec') diff --git a/core/fxcodec/codec/ccodec_bmpmodule.cpp b/core/fxcodec/codec/ccodec_bmpmodule.cpp index eb9bdf84f5..f4bfa010dc 100644 --- a/core/fxcodec/codec/ccodec_bmpmodule.cpp +++ b/core/fxcodec/codec/ccodec_bmpmodule.cpp @@ -70,8 +70,8 @@ FX_FILESIZE CCodec_BmpModule::GetAvailInput(Context* pContext, } void CCodec_BmpModule::Input(Context* pContext, - const uint8_t* src_buf, + uint8_t* src_buf, uint32_t src_size) { auto* ctx = static_cast(pContext); - ctx->m_Bmp.SetInputBuffer(const_cast(src_buf), src_size); + ctx->m_Bmp.SetInputBuffer(src_buf, src_size); } diff --git a/core/fxcodec/codec/ccodec_bmpmodule.h b/core/fxcodec/codec/ccodec_bmpmodule.h index 9eef8867c6..ca2340d978 100644 --- a/core/fxcodec/codec/ccodec_bmpmodule.h +++ b/core/fxcodec/codec/ccodec_bmpmodule.h @@ -34,7 +34,7 @@ class CCodec_BmpModule { std::unique_ptr Start(Delegate* pDelegate); FX_FILESIZE GetAvailInput(Context* pContext, uint8_t** avail_buf_ptr); - void Input(Context* pContext, const uint8_t* src_buf, uint32_t src_size); + void Input(Context* pContext, uint8_t* src_buf, uint32_t src_size); int32_t ReadHeader(Context* pContext, int32_t* width, int32_t* height, -- cgit v1.2.3