diff options
author | bungeman <bungeman@google.com> | 2016-01-06 08:30:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-06 08:30:59 -0800 |
commit | 54e63082191f337084f96083ca90d7c35273d6ff (patch) | |
tree | a24ad0a9760c7d29014e88ddd0f814f545856c1e /src/ports/SkFontMgr_android_parser.cpp | |
parent | 1e1e5094e0fda27b09826c573a3a68d08e7b6ae1 (diff) |
Add skstd::remove_pointer_t and use it.
This replaces an existing incomplete implementation. This also makes
it easier to update the current use in the future when switching to
<type_traits>.
Review URL: https://codereview.chromium.org/1555153002
Diffstat (limited to 'src/ports/SkFontMgr_android_parser.cpp')
-rw-r--r-- | src/ports/SkFontMgr_android_parser.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/ports/SkFontMgr_android_parser.cpp b/src/ports/SkFontMgr_android_parser.cpp index ba2296bffa..29ea52523d 100644 --- a/src/ports/SkFontMgr_android_parser.cpp +++ b/src/ports/SkFontMgr_android_parser.cpp @@ -12,6 +12,7 @@ #include "SkTDArray.h" #include "SkTSearch.h" #include "SkTemplates.h" +#include "SkTLogic.h" #include <dirent.h> #include <expat.h> @@ -579,9 +580,6 @@ static const XML_Memory_Handling_Suite sk_XML_alloc = { sk_free }; -template<typename T> struct remove_ptr {typedef T type;}; -template<typename T> struct remove_ptr<T*> {typedef T type;}; - /** * This function parses the given filename and stores the results in the given * families array. Returns the version of the file, negative if the file does not exist. @@ -598,7 +596,7 @@ static int parse_config_file(const char* filename, SkTDArray<FontFamily*>& famil return -1; } - SkAutoTCallVProc<remove_ptr<XML_Parser>::type, XML_ParserFree> parser( + SkAutoTCallVProc<skstd::remove_pointer_t<XML_Parser>, XML_ParserFree> parser( XML_ParserCreate_MM(nullptr, &sk_XML_alloc, nullptr)); if (!parser) { SkDebugf(SK_FONTMGR_ANDROID_PARSER_PREFIX "could not create XML parser\n"); |