summaryrefslogtreecommitdiff
path: root/core/fxcrt/fx_extension.cpp
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2016-06-07 10:46:22 -0700
committerCommit bot <commit-bot@chromium.org>2016-06-07 10:46:23 -0700
commit4997b22f84307521a62838f874928bf56cd3423c (patch)
treead11d99ac0a491ee222e9d0a42ec3b6ad3354e2a /core/fxcrt/fx_extension.cpp
parent0687e76dc259c678b3f29a6608331f07ffd8f1e2 (diff)
downloadpdfium-4997b22f84307521a62838f874928bf56cd3423c.tar.xz
Get rid of NULLs in core/
Review-Url: https://codereview.chromium.org/2032613003
Diffstat (limited to 'core/fxcrt/fx_extension.cpp')
-rw-r--r--core/fxcrt/fx_extension.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/core/fxcrt/fx_extension.cpp b/core/fxcrt/fx_extension.cpp
index 197022362f..1a95e8c318 100644
--- a/core/fxcrt/fx_extension.cpp
+++ b/core/fxcrt/fx_extension.cpp
@@ -68,13 +68,9 @@ FX_BOOL CFX_CRTFileStream::Flush() {
#ifdef PDF_ENABLE_XFA
IFX_FileAccess* FX_CreateDefaultFileAccess(const CFX_WideStringC& wsPath) {
if (wsPath.GetLength() == 0)
- return NULL;
-
- CFX_CRTFileAccess* pFA = NULL;
- pFA = new CFX_CRTFileAccess;
- if (NULL == pFA)
- return NULL;
+ return nullptr;
+ CFX_CRTFileAccess* pFA = new CFX_CRTFileAccess;
pFA->Init(wsPath);
return pFA;
}
@@ -305,9 +301,9 @@ void FX_Random_GenerateBase(uint32_t* pBuffer, int32_t iCount) {
FX_HashCode_GetA(CFX_ByteStringC((uint8_t*)&st2, sizeof(st2)), true);
::srand((dwHash1 << 16) | (uint32_t)dwHash2);
#else
- time_t tmLast = time(NULL);
+ time_t tmLast = time(nullptr);
time_t tmCur;
- while ((tmCur = time(NULL)) == tmLast) {
+ while ((tmCur = time(nullptr)) == tmLast) {
continue;
}
@@ -319,8 +315,9 @@ void FX_Random_GenerateBase(uint32_t* pBuffer, int32_t iCount) {
}
#if _FXM_PLATFORM_ == _FXM_PLATFORM_WINDOWS_
FX_BOOL FX_GenerateCryptoRandom(uint32_t* pBuffer, int32_t iCount) {
- HCRYPTPROV hCP = NULL;
- if (!::CryptAcquireContext(&hCP, NULL, NULL, PROV_RSA_FULL, 0) || !hCP) {
+ HCRYPTPROV hCP = 0;
+ if (!::CryptAcquireContext(&hCP, nullptr, nullptr, PROV_RSA_FULL, 0) ||
+ !hCP) {
return FALSE;
}
::CryptGenRandom(hCP, iCount * sizeof(uint32_t), (uint8_t*)pBuffer);