diff options
author | Neil <nyamatongwe@gmail.com> | 2017-04-06 21:04:37 +1000 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2017-04-06 21:04:37 +1000 |
commit | cda15af9657880e91ccf65603e109b202d9e78bf (patch) | |
tree | eb730cdcc810842ce2255c3d2af9872041583a74 /src/XPM.cxx | |
parent | dba2fe55b8a4ab4ac34795fe4a4b30a729c77016 (diff) | |
download | scintilla-mirror-cda15af9657880e91ccf65603e109b202d9e78bf.tar.gz |
Added const where possible.
Diffstat (limited to 'src/XPM.cxx')
-rw-r--r-- | src/XPM.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx index 646981a80..0e5795cc5 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -117,24 +117,24 @@ void XPM::Init(const char *const *linesForm) { for (int y=0; y<height; y++) { const char *lform = linesForm[y+nColours+1]; - size_t len = MeasureLength(lform); + const size_t len = MeasureLength(lform); for (size_t x = 0; x<len; x++) pixels[y * width + x] = static_cast<unsigned char>(lform[x]); } } -void XPM::Draw(Surface *surface, PRectangle &rc) { +void XPM::Draw(Surface *surface, const PRectangle &rc) { if (pixels.empty()) { return; } // Centre the pixmap - int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); - int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); + const int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); + const int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); for (int y=0; y<height; y++) { int prevCode = 0; int xStartRun = 0; for (int x=0; x<width; x++) { - int code = pixels[y * width + x]; + const int code = pixels[y * width + x]; if (code != prevCode) { FillRun(surface, prevCode, startX + xStartRun, startY + y, startX + x); xStartRun = x; |