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

Unified Diff: core/fxcodec/codec/fx_codec_png.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_png.cpp
diff --git a/core/fxcodec/codec/fx_codec_png.cpp b/core/fxcodec/codec/fx_codec_png.cpp
index 61d4cebdbba28aa3ab2fc363232b848e75c51fc0..d34a99a95414d54b3ea6bf4f772aeb595b8a48ce 100644
--- a/core/fxcodec/codec/fx_codec_png.cpp
+++ b/core/fxcodec/codec/fx_codec_png.cpp
@@ -51,7 +51,7 @@ static void _png_load_bmp_attribute(png_structp png_ptr,
#endif
int bTime = 0;
#if defined(PNG_tIME_SUPPORTED)
- png_timep t = NULL;
+ png_timep t = nullptr;
png_get_tIME(png_ptr, info_ptr, &t);
if (t) {
FXSYS_memset(pAttribute->m_strTime, 0, sizeof(pAttribute->m_strTime));
@@ -67,7 +67,7 @@ static void _png_load_bmp_attribute(png_structp png_ptr,
FX_STRSIZE len;
const FX_CHAR* buf;
int num_text;
- png_textp text = NULL;
+ png_textp text = nullptr;
png_get_text(png_ptr, info_ptr, &text, &num_text);
for (i = 0; i < num_text; i++) {
len = FXSYS_strlen(text[i].key);
@@ -110,18 +110,18 @@ static void _png_free_func(void* p) {
};
static void _png_get_header_func(png_structp png_ptr, png_infop info_ptr) {
FXPNG_Context* p = (FXPNG_Context*)png_get_progressive_ptr(png_ptr);
- if (p == NULL) {
+ if (!p)
return;
- }
+
CCodec_PngModule* pModule = (CCodec_PngModule*)p->parent_ptr;
- if (pModule == NULL) {
+ if (!pModule)
return;
- }
+
png_uint_32 width = 0, height = 0;
int bpc = 0, color_type = 0, color_type1 = 0, pass = 0;
double gamma = 1.0;
- png_get_IHDR(png_ptr, info_ptr, &width, &height, &bpc, &color_type, NULL,
- NULL, NULL);
+ png_get_IHDR(png_ptr, info_ptr, &width, &height, &bpc, &color_type, nullptr,
+ nullptr, nullptr);
color_type1 = color_type;
if (bpc > 8) {
png_set_strip_16(png_ptr);
@@ -182,11 +182,11 @@ static void _png_get_row_func(png_structp png_ptr,
png_uint_32 row_num,
int pass) {
FXPNG_Context* p = (FXPNG_Context*)png_get_progressive_ptr(png_ptr);
- if (p == NULL) {
+ if (!p)
return;
- }
+
CCodec_PngModule* pModule = (CCodec_PngModule*)p->parent_ptr;
- uint8_t* src_buf = NULL;
+ uint8_t* src_buf = nullptr;
if (!pModule->AskScanlineBufCallback(p->child_ptr, row_num, src_buf)) {
png_error(png_ptr, "Ask Scanline buffer Callback Error");
}

Powered by Google App Engine
This is Rietveld 408576698