summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-09-14 18:26:26 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-09-15 02:03:25 +0000
commit69fe7110e6af83ca82d71275a70ae4983daddd6f (patch)
tree949485a0a401a14b9d90876cd5c277f4f7a911fa /core/fpdfdoc
parentb1f9205bb1a0671c31e44e7362784c770bf2a948 (diff)
downloadpdfium-69fe7110e6af83ca82d71275a70ae4983daddd6f.tar.xz
Make static const char* arrays more const.
Change-Id: I87b5e6cefe973b82b4868e56fc5285c95c53a12b Reviewed-on: https://pdfium-review.googlesource.com/12550 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/cpdf_aaction.cpp10
-rw-r--r--core/fpdfdoc/cpdf_aaction.h3
2 files changed, 9 insertions, 4 deletions
diff --git a/core/fpdfdoc/cpdf_aaction.cpp b/core/fpdfdoc/cpdf_aaction.cpp
index 033bf03a6a..fd29b52ef6 100644
--- a/core/fpdfdoc/cpdf_aaction.cpp
+++ b/core/fpdfdoc/cpdf_aaction.cpp
@@ -8,9 +8,13 @@
namespace {
-const char* g_sAATypes[] = {"E", "X", "D", "U", "Fo", "Bl", "PO", "PC",
- "PV", "PI", "O", "C", "K", "F", "V", "C",
- "WC", "WS", "DS", "WP", "DP", ""};
+constexpr const char* g_sAATypes[] = {"E", "X", "D", "U", "Fo", "Bl", "PO",
+ "PC", "PV", "PI", "O", "C", "K", "F",
+ "V", "C", "WC", "WS", "DS", "WP", "DP"};
+
+// |g_sAATypes| should have as many elements as enum AActionType.
+static_assert(FX_ArraySize(g_sAATypes) == CPDF_AAction::NumberOfActions,
+ "g_sAATypes count mismatch");
} // namespace
diff --git a/core/fpdfdoc/cpdf_aaction.h b/core/fpdfdoc/cpdf_aaction.h
index b2b691fc26..bacf1790f8 100644
--- a/core/fpdfdoc/cpdf_aaction.h
+++ b/core/fpdfdoc/cpdf_aaction.h
@@ -34,7 +34,8 @@ class CPDF_AAction {
SaveDocument,
DocumentSaved,
PrintDocument,
- DocumentPrinted
+ DocumentPrinted,
+ NumberOfActions // Must be last.
};
CPDF_AAction();