summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_parser.h
diff options
context:
space:
mode:
authorArtem Strygin <art-snake@yandex-team.ru>2017-08-01 15:25:13 +0300
committerChromium commit bot <commit-bot@chromium.org>2017-08-01 22:41:02 +0000
commit07a71da70e7d52dbc65cd184edec3c45e1e8567e (patch)
tree0a06bdd7ca2fb868ff77bd25ba35b1c9bb5bd29d /core/fpdfapi/parser/cpdf_parser.h
parent7d8544ad898255fc4dffab0a36c6cb69fce421a1 (diff)
downloadpdfium-07a71da70e7d52dbc65cd184edec3c45e1e8567e.tar.xz
Improve readability in CPDF_Parser::ObjectInfo.
Make CPDF_Parser::ObjectInfo::pos a union, since the data is used as an object number when the object is compressed. Change-Id: Id7c32759f7411cc80285bb7f3088b5aa6ff5bf05 Reviewed-on: https://pdfium-review.googlesource.com/9570 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_parser.h')
-rw-r--r--core/fpdfapi/parser/cpdf_parser.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_parser.h b/core/fpdfapi/parser/cpdf_parser.h
index 4d78d7052f..ece1e6a2d4 100644
--- a/core/fpdfapi/parser/cpdf_parser.h
+++ b/core/fpdfapi/parser/cpdf_parser.h
@@ -111,8 +111,13 @@ class CPDF_Parser {
protected:
struct ObjectInfo {
ObjectInfo() : pos(0), type(ObjectType::kFree), gennum(0) {}
-
- FX_FILESIZE pos;
+ // if type is ObjectType::kCompressed the archive_obj_num should be used.
+ // if type is ObjectType::kNotCompressed the pos should be used.
+ // In other cases its are unused.
+ union {
+ FX_FILESIZE pos;
+ FX_FILESIZE archive_obj_num;
+ };
ObjectType type;
uint16_t gennum;
};