summaryrefslogtreecommitdiff
path: root/core/src/fxge/win32
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
committerLei Zhang <thestig@chromium.org>2015-12-14 18:27:25 -0800
commit96660d6f382204339d6b1aadc3913303d436e252 (patch)
treeb5f84756e1a89251831cebc05b9d4e1f6cb2027b /core/src/fxge/win32
parentd983b09c3ae29a97cba8e9ec9c6351545f6087ee (diff)
downloadpdfium-96660d6f382204339d6b1aadc3913303d436e252.tar.xz
Merge to XFA: Get rid of most instance of 'foo != NULL'
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1512763013 . (cherry picked from commit e3c7c2b54348da4a6939f6672f6c6bff126815a7) Review URL: https://codereview.chromium.org/1529553003 .
Diffstat (limited to 'core/src/fxge/win32')
-rw-r--r--core/src/fxge/win32/fx_win32_device.cpp2
-rw-r--r--core/src/fxge/win32/fx_win32_dwrite.cpp4
-rw-r--r--core/src/fxge/win32/fx_win32_gdipext.cpp10
-rw-r--r--core/src/fxge/win32/fx_win32_print.cpp2
4 files changed, 9 insertions, 9 deletions
diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp
index 4ca4316c2e..6d520468a3 100644
--- a/core/src/fxge/win32/fx_win32_device.cpp
+++ b/core/src/fxge/win32/fx_win32_device.cpp
@@ -1186,7 +1186,7 @@ FX_BOOL CGdiDisplayDriver::StretchDIBits(const CFX_DIBSource* pSource,
int alpha_flag,
void* pIccTransform,
int blend_type) {
- ASSERT(pSource != NULL && pClipRect != NULL);
+ ASSERT(pSource && pClipRect);
if (flags || dest_width > 10000 || dest_width < -10000 ||
dest_height > 10000 || dest_height < -10000) {
return UseFoxitStretchEngine(pSource, color, dest_left, dest_top,
diff --git a/core/src/fxge/win32/fx_win32_dwrite.cpp b/core/src/fxge/win32/fx_win32_dwrite.cpp
index ab50f3cf38..83924f23e7 100644
--- a/core/src/fxge/win32/fx_win32_dwrite.cpp
+++ b/core/src/fxge/win32/fx_win32_dwrite.cpp
@@ -18,14 +18,14 @@ typedef HRESULT(__stdcall* FuncType_DWriteCreateFactory)(
__out IUnknown**);
template <typename InterfaceType>
inline void SafeRelease(InterfaceType** currentObject) {
- if (*currentObject != NULL) {
+ if (*currentObject) {
(*currentObject)->Release();
*currentObject = NULL;
}
}
template <typename InterfaceType>
inline InterfaceType* SafeAcquire(InterfaceType* newObject) {
- if (newObject != NULL) {
+ if (newObject) {
newObject->AddRef();
}
return newObject;
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp
index 2886ee81d0..e79a88cb81 100644
--- a/core/src/fxge/win32/fx_win32_gdipext.cpp
+++ b/core/src/fxge/win32/fx_win32_gdipext.cpp
@@ -1295,7 +1295,7 @@ class GpStream final : public IStream {
ULONG* pcbRead) {
size_t bytes_left;
size_t bytes_out;
- if (pcbRead != NULL) {
+ if (pcbRead) {
*pcbRead = 0;
}
if (m_ReadPos == m_InterStream.GetLength()) {
@@ -1305,7 +1305,7 @@ class GpStream final : public IStream {
bytes_out = FX_MIN(cb, bytes_left);
FXSYS_memcpy(Output, m_InterStream.GetBuffer() + m_ReadPos, bytes_out);
m_ReadPos += (int32_t)bytes_out;
- if (pcbRead != NULL) {
+ if (pcbRead) {
*pcbRead = (ULONG)bytes_out;
}
return S_OK;
@@ -1314,13 +1314,13 @@ class GpStream final : public IStream {
ULONG cb,
ULONG* pcbWritten) {
if (cb <= 0) {
- if (pcbWritten != NULL) {
+ if (pcbWritten) {
*pcbWritten = 0;
}
return S_OK;
}
m_InterStream.InsertBlock(m_InterStream.GetLength(), Input, cb);
- if (pcbWritten != NULL) {
+ if (pcbWritten) {
*pcbWritten = cb;
}
return S_OK;
@@ -1374,7 +1374,7 @@ class GpStream final : public IStream {
return STG_E_SEEKERROR;
}
m_ReadPos = new_read_position;
- if (lpNewFilePointer != NULL) {
+ if (lpNewFilePointer) {
lpNewFilePointer->QuadPart = m_ReadPos;
}
return S_OK;
diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp
index c829a438b9..39828b14d8 100644
--- a/core/src/fxge/win32/fx_win32_print.cpp
+++ b/core/src/fxge/win32/fx_win32_print.cpp
@@ -49,7 +49,7 @@ FX_BOOL CGdiPrinterDriver::SetDIBits(const CFX_DIBSource* pSource,
pSource->GetHeight(), &clip_rect, 0, alpha_flag,
pIccTransform, FXDIB_BLEND_NORMAL);
}
- ASSERT(pSource != NULL && !pSource->IsAlphaMask() && pSrcRect != NULL);
+ ASSERT(pSource && !pSource->IsAlphaMask() && pSrcRect);
ASSERT(blend_type == FXDIB_BLEND_NORMAL);
if (pSource->HasAlpha()) {
return FALSE;