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

Unified Diff: core/fxcodec/codec/fx_codec_flate.cpp

Issue 2032613003: Get rid of NULLs in core/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: s/NULL/nullptr/ Created 4 years, 7 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/codec/fx_codec_flate.cpp
diff --git a/core/fxcodec/codec/fx_codec_flate.cpp b/core/fxcodec/codec/fx_codec_flate.cpp
index c23de277fb6b6f3171fa1e8dd26fb712df24e26a..11c5577d1a967e72d206c02bc95ecd4a7df706f6 100644
--- a/core/fxcodec/codec/fx_codec_flate.cpp
+++ b/core/fxcodec/codec/fx_codec_flate.cpp
@@ -39,7 +39,7 @@ void* FPDFAPI_FlateInit(void* (*alloc_func)(void*, unsigned int, unsigned int),
void (*free_func)(void*, void*)) {
z_stream* p = (z_stream*)alloc_func(0, 1, sizeof(z_stream));
if (!p) {
- return NULL;
+ return nullptr;
}
FXSYS_memset(p, 0, sizeof(z_stream));
p->zalloc = alloc_func;
@@ -772,11 +772,11 @@ class CCodec_FlateScanlineDecoder : public CCodec_ScanlineDecoder {
};
CCodec_FlateScanlineDecoder::CCodec_FlateScanlineDecoder() {
- m_pFlate = NULL;
- m_pScanline = NULL;
- m_pLastLine = NULL;
- m_pPredictBuffer = NULL;
- m_pPredictRaw = NULL;
+ m_pFlate = nullptr;
+ m_pScanline = nullptr;
+ m_pLastLine = nullptr;
+ m_pPredictBuffer = nullptr;
+ m_pPredictRaw = nullptr;
m_LeftOver = 0;
}
CCodec_FlateScanlineDecoder::~CCodec_FlateScanlineDecoder() {
@@ -923,7 +923,7 @@ uint32_t CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
uint32_t estimated_size,
uint8_t*& dest_buf,
uint32_t& dest_size) {
- dest_buf = NULL;
+ dest_buf = nullptr;
uint32_t offset = 0;
int predictor_type = 0;
if (predictor) {
@@ -938,7 +938,8 @@ uint32_t CCodec_FlateModule::FlateOrLZWDecode(FX_BOOL bLZW,
std::unique_ptr<CLZWDecoder> decoder(new CLZWDecoder);
dest_size = (uint32_t)-1;
offset = src_size;
- int err = decoder->Decode(NULL, dest_size, src_buf, offset, bEarlyChange);
+ int err =
+ decoder->Decode(nullptr, dest_size, src_buf, offset, bEarlyChange);
if (err || dest_size == 0 || dest_size + 1 < dest_size) {
return FX_INVALID_OFFSET;
}
@@ -976,7 +977,7 @@ FX_BOOL CCodec_FlateModule::Encode(const uint8_t* src_buf,
if (predictor != 2 && predictor < 10) {
return Encode(src_buf, src_size, dest_buf, dest_size);
}
- uint8_t* pSrcBuf = NULL;
+ uint8_t* pSrcBuf = nullptr;
Tom Sepez 2016/06/02 20:09:49 nit: combine with 981
Lei Zhang 2016/06/07 07:33:23 Code is gone.
pSrcBuf = FX_Alloc(uint8_t, src_size);
FXSYS_memcpy(pSrcBuf, src_buf, src_size);
FX_BOOL ret = TRUE;

Powered by Google App Engine
This is Rietveld 408576698