diff options
author | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-12-14 18:34:00 -0800 |
commit | 412e908082a361d0fd9591eab939e96a882212f1 (patch) | |
tree | 11726052ae08f13dc5a05a82cbce870758580aeb /core/src/fxge/win32/fx_win32_gdipext.cpp | |
parent | 96660d6f382204339d6b1aadc3913303d436e252 (diff) | |
download | pdfium-412e908082a361d0fd9591eab939e96a882212f1.tar.xz |
Merge to XFA: Get rid of most instance of 'foo == NULL'
TBR=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1520063002 .
(cherry picked from commit e385244f8cd6ae376f6b3cf1265a0795d5d30eff)
Review URL: https://codereview.chromium.org/1528763003 .
Diffstat (limited to 'core/src/fxge/win32/fx_win32_gdipext.cpp')
-rw-r--r-- | core/src/fxge/win32/fx_win32_gdipext.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/core/src/fxge/win32/fx_win32_gdipext.cpp b/core/src/fxge/win32/fx_win32_gdipext.cpp index e79a88cb81..1e4f89540b 100644 --- a/core/src/fxge/win32/fx_win32_gdipext.cpp +++ b/core/src/fxge/win32/fx_win32_gdipext.cpp @@ -686,12 +686,12 @@ void CGdiplusExt::Load() { strPlusPath += "\\"; strPlusPath += "GDIPLUS.DLL"; m_hModule = LoadLibraryA(strPlusPath); - if (m_hModule == NULL) { + if (!m_hModule) { return; } for (int i = 0; i < sizeof g_GdipFuncNames / sizeof(LPCSTR); i++) { m_Functions[i] = GetProcAddress(m_hModule, g_GdipFuncNames[i]); - if (m_Functions[i] == NULL) { + if (!m_Functions[i]) { m_hModule = NULL; return; } @@ -701,7 +701,7 @@ void CGdiplusExt::Load() { ((FuncType_GdiplusStartup)m_Functions[FuncId_GdiplusStartup])( &gdiplusToken, &gdiplusStartupInput, NULL); m_GdiModule = LoadLibraryA("GDI32.DLL"); - if (m_GdiModule == NULL) { + if (!m_GdiModule) { return; } m_pGdiAddFontMemResourceEx = @@ -973,9 +973,9 @@ static GpPen* _GdipCreatePen(const CFX_GraphStateData* pGraphState, FX_FLOAT width = pGraphState ? pGraphState->m_LineWidth : 1.0f; if (!bTextMode) { FX_FLOAT unit = - pMatrix == NULL - ? 1.0f - : FXSYS_Div(1.0f, (pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2); + pMatrix + ? FXSYS_Div(1.0f, (pMatrix->GetXUnit() + pMatrix->GetYUnit()) / 2) + : 1.0f; if (width < unit) { width = unit; } @@ -1198,7 +1198,7 @@ FX_BOOL CGdiplusExt::DrawPath(HDC hDC, } } int new_fill_mode = fill_mode & 3; - if (nPoints == 4 && pGraphState == NULL) { + if (nPoints == 4 && !pGraphState) { int v1, v2; if (IsSmallTriangle(points, pObject2Device, v1, v2)) { GpPen* pPen = NULL; @@ -1380,7 +1380,7 @@ class GpStream final : public IStream { return S_OK; } virtual HRESULT STDMETHODCALLTYPE Stat(STATSTG* pStatstg, DWORD grfStatFlag) { - if (pStatstg == NULL) { + if (!pStatstg) { return STG_E_INVALIDFUNCTION; } ZeroMemory(pStatstg, sizeof(STATSTG)); @@ -1492,7 +1492,7 @@ CFX_DIBitmap* _FX_WindowsDIB_LoadFromBuf(BITMAPINFO* pbmi, FX_BOOL bAlpha); CFX_DIBitmap* CGdiplusExt::LoadDIBitmap(WINDIB_Open_Args_ args) { PREVIEW3_DIBITMAP* pInfo = ::LoadDIBitmap(args); - if (pInfo == NULL) { + if (!pInfo) { return NULL; } int height = abs(pInfo->pbmi->bmiHeader.biHeight); |