diff options
author | Hans Wennborg <hans@chromium.org> | 2018-10-22 19:17:02 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-10-22 19:17:02 +0000 |
commit | 2f62d36bfac781428f3896b443177e033be4c554 (patch) | |
tree | 4e77be5f0da1335ae54adfe7d62a7200cd134bbb /fpdfsdk | |
parent | c320e9c7ad01ab48625e51fb3b6476d98b6167de (diff) | |
download | pdfium-2f62d36bfac781428f3896b443177e033be4c554.tar.xz |
Rename CPDF_Object::Type enumerators with k prefixes
This was originally motivated by Clang's newly enhanced -Wshadow
warning, which complained about BOOLEAN shadowing a BOOLEAN typedef
in winnt.h. The warning has since been changed to not fire on enums
shadowing types, but it was suggested that this kind of naming change
was desirable anyway.
Bug: chromium:895475
Change-Id: I278ce9dbbd88f802fe5bc77fca28b082aa5e684d
Reviewed-on: https://pdfium-review.googlesource.com/c/44330
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r-- | fpdfsdk/fpdf_annot.cpp | 39 | ||||
-rw-r--r-- | fpdfsdk/fpdf_ppo.cpp | 8 |
2 files changed, 25 insertions, 22 deletions
diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp index 2c8e68eca7..95730e5369 100644 --- a/fpdfsdk/fpdf_annot.cpp +++ b/fpdfsdk/fpdf_annot.cpp @@ -121,28 +121,31 @@ static_assert(static_cast<int>(CPDF_Annot::AppearanceMode::Down) == // These checks ensure the consistency of dictionary value types across core/ // and public/. -static_assert(static_cast<int>(CPDF_Object::Type::BOOLEAN) == +static_assert(static_cast<int>(CPDF_Object::Type::kBoolean) == FPDF_OBJECT_BOOLEAN, - "CPDF_Object::BOOLEAN value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::NUMBER) == FPDF_OBJECT_NUMBER, - "CPDF_Object::NUMBER value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::STRING) == FPDF_OBJECT_STRING, - "CPDF_Object::STRING value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::NAME) == FPDF_OBJECT_NAME, - "CPDF_Object::NAME value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::ARRAY) == FPDF_OBJECT_ARRAY, - "CPDF_Object::ARRAY value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::DICTIONARY) == + "CPDF_Object::kBoolean value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kNumber) == + FPDF_OBJECT_NUMBER, + "CPDF_Object::kNumber value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kString) == + FPDF_OBJECT_STRING, + "CPDF_Object::kString value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kName) == FPDF_OBJECT_NAME, + "CPDF_Object::kName value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kArray) == FPDF_OBJECT_ARRAY, + "CPDF_Object::kArray value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kDictionary) == FPDF_OBJECT_DICTIONARY, - "CPDF_Object::DICTIONARY value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::STREAM) == FPDF_OBJECT_STREAM, - "CPDF_Object::STREAM value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::NULLOBJ) == + "CPDF_Object::kDictionary value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kStream) == + FPDF_OBJECT_STREAM, + "CPDF_Object::kStream value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kNullobj) == FPDF_OBJECT_NULLOBJ, - "CPDF_Object::NULLOBJ value mismatch"); -static_assert(static_cast<int>(CPDF_Object::Type::REFERENCE) == + "CPDF_Object::kNullobj value mismatch"); +static_assert(static_cast<int>(CPDF_Object::Type::kReference) == FPDF_OBJECT_REFERENCE, - "CPDF_Object::REFERENCE value mismatch"); + "CPDF_Object::kReference value mismatch"); bool HasAPStream(CPDF_Dictionary* pAnnotDict) { return !!GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); diff --git a/fpdfsdk/fpdf_ppo.cpp b/fpdfsdk/fpdf_ppo.cpp index 5c5930e097..e313f4ad55 100644 --- a/fpdfsdk/fpdf_ppo.cpp +++ b/fpdfsdk/fpdf_ppo.cpp @@ -350,7 +350,7 @@ bool CPDF_PageOrganizer::PDFDocInit() { bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj, ObjectNumberMap* pObjNumberMap) { switch (pObj->GetType()) { - case CPDF_Object::REFERENCE: { + case CPDF_Object::kReference: { CPDF_Reference* pReference = pObj->AsReference(); uint32_t newobjnum = GetNewObjId(pObjNumberMap, pReference); if (newobjnum == 0) @@ -358,7 +358,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj, pReference->SetRef(dest(), newobjnum); break; } - case CPDF_Object::DICTIONARY: { + case CPDF_Object::kDictionary: { CPDF_Dictionary* pDict = pObj->AsDictionary(); std::vector<ByteString> bad_keys; { @@ -378,7 +378,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj, pDict->RemoveFor(key); break; } - case CPDF_Object::ARRAY: { + case CPDF_Object::kArray: { CPDF_Array* pArray = pObj->AsArray(); for (size_t i = 0; i < pArray->size(); ++i) { CPDF_Object* pNextObj = pArray->GetObjectAt(i); @@ -389,7 +389,7 @@ bool CPDF_PageOrganizer::UpdateReference(CPDF_Object* pObj, } break; } - case CPDF_Object::STREAM: { + case CPDF_Object::kStream: { CPDF_Stream* pStream = pObj->AsStream(); CPDF_Dictionary* pDict = pStream->GetDict(); if (!pDict) |