summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <vkrause@kde.org>2014-09-27 13:41:47 (GMT)
committerVolker Krause <vkrause@kde.org>2014-09-27 13:41:47 (GMT)
commit146e585f0298a4c68596f7e332946459d0e388c7 (patch)
treeab882592952c4c5481a177a7f9edcb582dc28544
parentf8f90b15b307d7c67438a8eba68173e960ade8f8 (diff)
Make constants const, avoids a few extra symbols in the .data section.
-rw-r--r--generators/dvi/TeXFont_PK.cpp2
-rw-r--r--generators/dvi/length.cpp2
-rw-r--r--generators/dvi/pageSize.cpp2
-rw-r--r--ui/pageview.cpp4
-rw-r--r--ui/pageviewannotator.cpp2
-rw-r--r--ui/thumbnaillist.cpp2
6 files changed, 7 insertions, 7 deletions
diff --git a/generators/dvi/TeXFont_PK.cpp b/generators/dvi/TeXFont_PK.cpp
index 849460c..809756c 100644
--- a/generators/dvi/TeXFont_PK.cpp
+++ b/generators/dvi/TeXFont_PK.cpp
@@ -345,7 +345,7 @@ static const uchar bitflip[256] = {
15, 143, 79, 207, 47, 175, 111, 239, 31, 159, 95, 223, 63, 191, 127, 255
};
-static quint32 bit_masks[33] = {
+static const quint32 bit_masks[33] = {
0x0, 0x1, 0x3, 0x7,
0xf, 0x1f, 0x3f, 0x7f,
0xff, 0x1ff, 0x3ff, 0x7ff,
diff --git a/generators/dvi/length.cpp b/generators/dvi/length.cpp
index ba1cec2..956dda8 100644
--- a/generators/dvi/length.cpp
+++ b/generators/dvi/length.cpp
@@ -19,7 +19,7 @@ class unitOfDistance
const char* name;
};
-unitOfDistance distanceUnitTable[] = {
+static const unitOfDistance distanceUnitTable[] = {
// Metric units
{1.0f, "mm"},
{1.0f, "millimeter"},
diff --git a/generators/dvi/pageSize.cpp b/generators/dvi/pageSize.cpp
index cf7a33f..f7b855e 100644
--- a/generators/dvi/pageSize.cpp
+++ b/generators/dvi/pageSize.cpp
@@ -28,7 +28,7 @@ struct pageSizeItem
#define defaultMetricPaperSize 4 // Default paper size is "DIN A4"
#define defaultImperialPaperSize 8 // Default paper size is "US Letter"
-static pageSizeItem staticList[] = { {"DIN A0", 841.0f, 1189.0f, "mm"},
+static const pageSizeItem staticList[] = { {"DIN A0", 841.0f, 1189.0f, "mm"},
{"DIN A1", 594.0f, 841.0f, "mm"},
{"DIN A2", 420.0f, 594.0f, "mm"},
{"DIN A3", 297.0f, 420.0f, "mm"},
diff --git a/ui/pageview.cpp b/ui/pageview.cpp
index f1c5589..3a93d55 100644
--- a/ui/pageview.cpp
+++ b/ui/pageview.cpp
@@ -87,7 +87,7 @@
#include "url_utils.h"
#include "magnifierview.h"
-static int pageflags = PagePainter::Accessibility | PagePainter::EnhanceLinks |
+static const int pageflags = PagePainter::Accessibility | PagePainter::EnhanceLinks |
PagePainter::EnhanceImages | PagePainter::Highlights |
PagePainter::TextSelection | PagePainter::Annotations;
@@ -3274,7 +3274,7 @@ void PageView::drawDocumentOnPainter( const QRect & contentsRect, QPainter * p )
p->setPen( Qt::black );
p->drawRect( -1, -1, itemWidth + 1, itemHeight + 1 );
// draw bottom/right gradient
- static int levels = 2;
+ static const int levels = 2;
int r = backColor.red() / (levels + 2) + 6,
g = backColor.green() / (levels + 2) + 6,
b = backColor.blue() / (levels + 2) + 6;
diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp
index d155f8b..59ea9a0 100644
--- a/ui/pageviewannotator.cpp
+++ b/ui/pageviewannotator.cpp
@@ -188,7 +188,7 @@ class PickPointEngine : public AnnotatorEngine
rect.right = qMax(startpoint.x,point.x);
rect.bottom = qMax(startpoint.y,point.y);
qCDebug(OkularUiDebug).nospace() << "xyScale=" << xscale << "," << yscale;
- static int padding = 2;
+ static const int padding = 2;
const QFontMetricsF mf(ta->textFont());
const QRectF rcf = mf.boundingRect( Okular::NormalizedRect( rect.left, rect.top, 1.0, 1.0 ).geometry( (int)pagewidth, (int)pageheight ).adjusted( padding, padding, -padding, -padding ),
Qt::AlignTop | Qt::AlignLeft | Qt::TextWordWrap, ta->contents() );
diff --git a/ui/thumbnaillist.cpp b/ui/thumbnaillist.cpp
index 5caa84f..a01f5e1 100644
--- a/ui/thumbnaillist.cpp
+++ b/ui/thumbnaillist.cpp
@@ -338,7 +338,7 @@ void ThumbnailList::notifyCurrentPageChanged( int previousPage, int currentPage
void ThumbnailList::notifyPageChanged( int pageNumber, int changedFlags )
{
- static int interestingFlags = DocumentObserver::Pixmap | DocumentObserver::Bookmark | DocumentObserver::Highlights | DocumentObserver::Annotations;
+ static const int interestingFlags = DocumentObserver::Pixmap | DocumentObserver::Bookmark | DocumentObserver::Highlights | DocumentObserver::Annotations;
// only handle change notifications we are interested in
if ( !( changedFlags & interestingFlags ) )
return;