diff options
author | Tom Sepez <tsepez@chromium.org> | 2018-02-26 21:02:52 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-26 21:02:52 +0000 |
commit | 0bc02c152bd0c178a5946196e2054a5cdc7650f4 (patch) | |
tree | 4a651b86f0d240c4996ea77f041274d241e59c93 /xfa | |
parent | 611431decd9a5b7dd456355fe763b2dee9c2a1a1 (diff) | |
download | pdfium-0bc02c152bd0c178a5946196e2054a5cdc7650f4.tar.xz |
Add some more missing consts.chromium/3356
Get things out of the .data section.
Change-Id: I375cf00186a3d5d8d10f5d147bd4b692f5db3683
Reviewed-on: https://pdfium-review.googlesource.com/27130
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa')
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmlexer.cpp | 2 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp | 10 | ||||
-rw-r--r-- | xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h | 8 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_node_statics.cpp | 8 |
4 files changed, 13 insertions, 15 deletions
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp index 41989f0a2d..3559fb7aeb 100644 --- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp @@ -78,7 +78,7 @@ const XFA_FMKeyword keyWords[] = { }; #ifndef NDEBUG -const wchar_t* tokenStrings[] = { +const wchar_t* const tokenStrings[] = { L"TOKand", L"TOKlparen", L"TOKrparen", L"TOKmul", L"TOKplus", L"TOKcomma", L"TOKminus", L"TOKdot", L"TOKdiv", L"TOKlt", L"TOKassign", L"TOKgt", diff --git a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp index 6312ba6b3d..023516bb6e 100644 --- a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp +++ b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.cpp @@ -4,17 +4,7 @@ #include "xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h" -namespace { - -// Arbitarily picked by looking at how deep a translation got before hitting -// the getting fuzzer memory limits. Should be larger then |kMaxParseDepth| in -// cxfa_fmparser.cpp. -const unsigned int kMaxDepth = 5000; - -} // namespace - unsigned long CXFA_FMToJavaScriptDepth::depth_ = 0; -unsigned long CXFA_FMToJavaScriptDepth::max_depth_ = kMaxDepth; void CXFA_FMToJavaScriptDepth::Reset() { depth_ = 0; diff --git a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h index 14f87a68f5..f4cd1be472 100644 --- a/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h +++ b/xfa/fxfa/fm2js/cxfa_fmtojavascriptdepth.h @@ -10,13 +10,17 @@ class CXFA_FMToJavaScriptDepth { CXFA_FMToJavaScriptDepth() { depth_++; } ~CXFA_FMToJavaScriptDepth() { depth_--; } - bool IsWithinMaxDepth() const { return depth_ <= max_depth_; } + bool IsWithinMaxDepth() const { return depth_ <= kMaxDepth; } static void Reset(); private: + // Arbitarily picked by looking at how deep a translation got before hitting + // the getting fuzzer memory limits. Should be larger then |kMaxParseDepth| in + // cxfa_fmparser.cpp. + const unsigned long kMaxDepth = 5000; + static unsigned long depth_; - static unsigned long max_depth_; }; #endif // XFA_FXFA_FM2JS_CXFA_FMTOJAVASCRIPTDEPTH_H_ diff --git a/xfa/fxfa/parser/cxfa_node_statics.cpp b/xfa/fxfa/parser/cxfa_node_statics.cpp index 93860c6a0a..3d64c1a66f 100644 --- a/xfa/fxfa/parser/cxfa_node_statics.cpp +++ b/xfa/fxfa/parser/cxfa_node_statics.cpp @@ -318,7 +318,9 @@ namespace { struct ElementNameInfo { uint32_t hash; XFA_Element element; -} ElementNameToEnum[] = { +}; + +const ElementNameInfo ElementNameToEnum[] = { {0x23ee3 /* ps */, XFA_Element::Ps}, {0x25363 /* to */, XFA_Element::To}, {0x2587e /* ui */, XFA_Element::Ui}, @@ -631,7 +633,9 @@ struct ElementNameInfo { struct AttributeNameInfo { uint32_t hash; XFA_Attribute attribute; -} AttributeNameInfoToEnum[] = { +}; + +const AttributeNameInfo AttributeNameInfoToEnum[] = { {0x68 /* h */, XFA_Attribute::H}, {0x77 /* w */, XFA_Attribute::W}, {0x78 /* x */, XFA_Attribute::X}, |