From 4c22c65b5e98b1fbb2954dd3cf872d73093c6e4e Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Tue, 10 Jan 2017 12:00:19 +0100 Subject: [PATCH] Constify data and put it into the .rodata section --- src/zxing/zxing/oned/Code39Reader.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/zxing/zxing/oned/Code39Reader.cpp b/src/zxing/zxing/oned/Code39Reader.cpp index 312260b..32abb6f 100644 --- a/src/zxing/zxing/oned/Code39Reader.cpp +++ b/src/zxing/zxing/oned/Code39Reader.cpp @@ -37,7 +37,7 @@ using zxing::oned::Code39Reader; using zxing::BitArray; namespace { - const char* ALPHABET = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"; + const char ALPHABET[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"; /** * These represent the encodings of characters, as patterns of wide and narrow @@ -46,7 +46,7 @@ namespace { * and narrow, with 1s representing "wide" and 0s representing narrow. */ const int CHARACTER_ENCODINGS_LEN = 44; - int CHARACTER_ENCODINGS[CHARACTER_ENCODINGS_LEN] = { + const int CHARACTER_ENCODINGS[CHARACTER_ENCODINGS_LEN] = { 0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, 0x124, 0x064, // 0-9 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00D, 0x10C, 0x04C, 0x01C, // A-J 0x103, 0x043, 0x142, 0x013, 0x112, 0x052, 0x007, 0x106, 0x046, 0x016, // K-T @@ -54,11 +54,11 @@ namespace { 0x0A8, 0x0A2, 0x08A, 0x02A // $-% }; - int ASTERISK_ENCODING = 0x094; - const char* ALPHABET_STRING = + const int ASTERISK_ENCODING = 0x094; + const char ALPHABET_STRING[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%"; - std::string alphabet_string (ALPHABET_STRING); + const std::string alphabet_string (ALPHABET_STRING); } void Code39Reader::init(bool usingCheckDigit_, bool extendedMode_) {