summaryrefslogtreecommitdiff
path: root/fofi
diff options
context:
space:
mode:
authorVolker Krause <vkrause@kde.org>2019-09-29 16:52:55 +0200
committerVolker Krause <vkrause@kde.org>2019-09-29 16:52:55 +0200
commit7ee694c461e35639842b88a6ce4b8b828b733a63 (patch)
tree42e34044a277c06d50693ec5a65c9208fe6152db /fofi
parent5242a057594f3e635727a3b2f482a3aace10a0e4 (diff)
Make some static data tables const
This moves 14.4kB from .data to .rodata, and another 11.6kB from .data to .data.rel.ro.
Diffstat (limited to 'fofi')
-rw-r--r--fofi/FoFiEncodings.cc6
-rw-r--r--fofi/FoFiEncodings.h6
-rw-r--r--fofi/FoFiType1C.cc6
3 files changed, 9 insertions, 9 deletions
diff --git a/fofi/FoFiEncodings.cc b/fofi/FoFiEncodings.cc
index 905a3d9c..43a715e9 100644
--- a/fofi/FoFiEncodings.cc
+++ b/fofi/FoFiEncodings.cc
@@ -945,7 +945,7 @@ const char *fofiType1CStdStrings[391] = {
"Semibold"
};
-unsigned short fofiType1CISOAdobeCharset[229] = {
+const unsigned short fofiType1CISOAdobeCharset[229] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
@@ -971,7 +971,7 @@ unsigned short fofiType1CISOAdobeCharset[229] = {
220, 221, 222, 223, 224, 225, 226, 227, 228
};
-unsigned short fofiType1CExpertCharset[166] = {
+const unsigned short fofiType1CExpertCharset[166] = {
0, 1, 229, 230, 231, 232, 233, 234, 235, 236,
237, 238, 13, 14, 15, 99, 239, 240, 241, 242,
243, 244, 245, 246, 247, 248, 27, 28, 249, 250,
@@ -991,7 +991,7 @@ unsigned short fofiType1CExpertCharset[166] = {
373, 374, 375, 376, 377, 378
};
-unsigned short fofiType1CExpertSubsetCharset[87] = {
+const unsigned short fofiType1CExpertSubsetCharset[87] = {
0, 1, 231, 232, 235, 236, 237, 238, 13, 14,
15, 99, 239, 240, 241, 242, 243, 244, 245, 246,
247, 248, 27, 28, 249, 250, 251, 253, 254, 255,
diff --git a/fofi/FoFiEncodings.h b/fofi/FoFiEncodings.h
index c4fbf48d..72a438b5 100644
--- a/fofi/FoFiEncodings.h
+++ b/fofi/FoFiEncodings.h
@@ -35,8 +35,8 @@ extern const char * const fofiType1ExpertEncoding[256];
//------------------------------------------------------------------------
extern const char *fofiType1CStdStrings[391];
-extern unsigned short fofiType1CISOAdobeCharset[229];
-extern unsigned short fofiType1CExpertCharset[166];
-extern unsigned short fofiType1CExpertSubsetCharset[87];
+extern const unsigned short fofiType1CISOAdobeCharset[229];
+extern const unsigned short fofiType1CExpertCharset[166];
+extern const unsigned short fofiType1CExpertSubsetCharset[87];
#endif
diff --git a/fofi/FoFiType1C.cc b/fofi/FoFiType1C.cc
index c3d47b4f..03223863 100644
--- a/fofi/FoFiType1C.cc
+++ b/fofi/FoFiType1C.cc
@@ -2502,13 +2502,13 @@ bool FoFiType1C::readCharset() {
int nLeft, i, j;
if (topDict.charsetOffset == 0) {
- charset = fofiType1CISOAdobeCharset;
+ charset = const_cast<unsigned short*>(fofiType1CISOAdobeCharset);
charsetLength = sizeof(fofiType1CISOAdobeCharset) / sizeof(unsigned short);
} else if (topDict.charsetOffset == 1) {
- charset = fofiType1CExpertCharset;
+ charset = const_cast<unsigned short*>(fofiType1CExpertCharset);
charsetLength = sizeof(fofiType1CExpertCharset) / sizeof(unsigned short);
} else if (topDict.charsetOffset == 2) {
- charset = fofiType1CExpertSubsetCharset;
+ charset = const_cast<unsigned short*>(fofiType1CExpertSubsetCharset);
charsetLength = sizeof(fofiType1CExpertSubsetCharset) / sizeof(unsigned short);
} else {
charset = (unsigned short *)gmallocn(nGlyphs, sizeof(unsigned short));