diff options
author | halcanary <halcanary@google.com> | 2015-08-27 07:41:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-08-27 07:41:16 -0700 |
commit | 96fcdcc219d2a0d3579719b84b28bede76efba64 (patch) | |
tree | 0ec5ea0193d8292df8bf5ed9dd8498a5eb5763dd /src/ports/SkFontConfigInterface_direct.cpp | |
parent | 435af2f736c85c3274a0c6760a3523810750d237 (diff) |
Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002
Review URL: https://codereview.chromium.org/1316233002
Diffstat (limited to 'src/ports/SkFontConfigInterface_direct.cpp')
-rw-r--r-- | src/ports/SkFontConfigInterface_direct.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/ports/SkFontConfigInterface_direct.cpp b/src/ports/SkFontConfigInterface_direct.cpp index 3400aa99a8..8a8e4a1b53 100644 --- a/src/ports/SkFontConfigInterface_direct.cpp +++ b/src/ports/SkFontConfigInterface_direct.cpp @@ -77,7 +77,7 @@ static void test_writeToMemory(const SkFontConfigInterface::FontIdentity& iden0, int initValue) { SkFontConfigInterface::FontIdentity iden1; - size_t size0 = iden0.writeToMemory(NULL); + size_t size0 = iden0.writeToMemory(nullptr); SkAutoMalloc storage(size0); memset(storage.get(), initValue, size0); @@ -131,8 +131,8 @@ private: SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBaseMutex* mutex) { SkAutoMutexAcquire ac(mutex); - static SkFontConfigInterfaceDirect* singleton = NULL; - if (singleton == NULL) { + static SkFontConfigInterfaceDirect* singleton = nullptr; + if (singleton == nullptr) { singleton = new SkFontConfigInterfaceDirect; } return singleton; @@ -140,13 +140,13 @@ SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBase /////////////////////////////////////////////////////////////////////////////// -// Returns the string from the pattern, or NULL +// Returns the string from the pattern, or nullptr static const char* get_name(FcPattern* pattern, const char field[], int index = 0) { const char* name; if (FcPatternGetString(pattern, field, index, (FcChar8**)&name) != FcResultMatch) { - name = NULL; + name = nullptr; } return name; } @@ -360,7 +360,7 @@ FcPattern* MatchFont(FcFontSet* font_set, const SkString& family) { // Older versions of fontconfig have a bug where they cannot select // only scalable fonts so we have to manually filter the results. - FcPattern* match = NULL; + FcPattern* match = nullptr; for (int i = 0; i < font_set->nfont; ++i) { FcPattern* current = font_set->fonts[i]; if (valid_pattern(current)) { @@ -388,7 +388,7 @@ FcPattern* MatchFont(FcFontSet* font_set, break; } if (!acceptable_substitute) - return NULL; + return nullptr; } return match; @@ -469,7 +469,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[], : FC_SLANT_ROMAN); FcPatternAddBool(pattern, FC_SCALABLE, FcTrue); - FcConfigSubstitute(NULL, pattern, FcMatchPattern); + FcConfigSubstitute(nullptr, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); // Font matching: @@ -477,7 +477,7 @@ bool SkFontConfigInterfaceDirect::matchFamilyName(const char familyName[], // font-family: a, b, c, serif; // However, fontconfig will always do its best to find *a* font when asked // for something so we need a way to tell if the match which it has found is - // "good enough" for us. Otherwise, we can return NULL which gets piped up + // "good enough" for us. Otherwise, we can return nullptr which gets piped up // and lets WebKit know to try the next CSS family name. However, fontconfig // configs allow substitutions (mapping "Arial -> Helvetica" etc) and we // wish to support that. @@ -579,20 +579,20 @@ SkDataTable* SkFontConfigInterfaceDirect::getFamilyNames() { FcPattern* pat = FcPatternCreate(); SkAutoTCallVProc<FcPattern, FcPatternDestroy> autoDestroyPat(pat); - if (NULL == pat) { - return NULL; + if (nullptr == pat) { + return nullptr; } FcObjectSet* os = FcObjectSetBuild(FC_FAMILY, (char *)0); SkAutoTCallVProc<FcObjectSet, FcObjectSetDestroy> autoDestroyOs(os); - if (NULL == os) { - return NULL; + if (nullptr == os) { + return nullptr; } - FcFontSet* fs = FcFontList(NULL, pat, os); + FcFontSet* fs = FcFontList(nullptr, pat, os); SkAutoTCallVProc<FcFontSet, FcFontSetDestroy> autoDestroyFs(fs); - if (NULL == fs) { - return NULL; + if (nullptr == fs) { + return nullptr; } SkTDArray<const char*> names; @@ -630,7 +630,7 @@ bool SkFontConfigInterfaceDirect::matchFamilySet(const char inFamilyName[], } FcPatternAddBool(pattern, FC_SCALABLE, FcTrue); - FcConfigSubstitute(NULL, pattern, FcMatchPattern); + FcConfigSubstitute(nullptr, pattern, FcMatchPattern); FcDefaultSubstitute(pattern); // Font matching: @@ -638,7 +638,7 @@ bool SkFontConfigInterfaceDirect::matchFamilySet(const char inFamilyName[], // font-family: a, b, c, serif; // However, fontconfig will always do its best to find *a* font when asked // for something so we need a way to tell if the match which it has found is - // "good enough" for us. Otherwise, we can return NULL which gets piped up + // "good enough" for us. Otherwise, we can return nullptr which gets piped up // and lets WebKit know to try the next CSS family name. However, fontconfig // configs allow substitutions (mapping "Arial -> Helvetica" etc) and we // wish to support that. @@ -720,7 +720,7 @@ bool SkFontConfigInterfaceDirect::matchFamilySet(const char inFamilyName[], if (!match) { FcPatternDestroy(pattern); FcFontSetDestroy(font_set); - return NULL; + return nullptr; } FcPatternDestroy(pattern); |