aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2017-04-07 19:44:59 +1000
committerNeil <nyamatongwe@gmail.com>2017-04-07 19:44:59 +1000
commit1595b1fbedf5587bc7c60cc7a1156ac1bca69f59 (patch)
tree351e4826ae9f0f2996ac82d8c0c89c428bcb30b2 /src
parentd97e0e4187f3130e2f06bc032040bc25485a2ece (diff)
downloadscintilla-mirror-1595b1fbedf5587bc7c60cc7a1156ac1bca69f59.tar.gz
Prefer C++ static cast over C-style casts.
Diffstat (limited to 'src')
-rw-r--r--src/AutoComplete.cxx4
-rw-r--r--src/Indicator.cxx7
2 files changed, 6 insertions, 5 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx
index 3de39bfcc..1cbc68c3a 100644
--- a/src/AutoComplete.cxx
+++ b/src/AutoComplete.cxx
@@ -156,7 +156,7 @@ void AutoComplete::SetList(const char *list) {
Sorter IndexSort(this, list);
sortMatrix.clear();
- for (int i = 0; i < (int)IndexSort.indices.size() / 2; ++i)
+ for (int i = 0; i < static_cast<int>(IndexSort.indices.size()) / 2; ++i)
sortMatrix.push_back(i);
std::sort(sortMatrix.begin(), sortMatrix.end(), IndexSort);
if (autoSort == SC_ORDER_CUSTOM || sortMatrix.size() < 2) {
@@ -186,7 +186,7 @@ void AutoComplete::SetList(const char *list) {
item[wordLen] = '\0';
sortedList += item;
}
- for (int i = 0; i < (int)sortMatrix.size(); ++i)
+ for (int i = 0; i < static_cast<int>(sortMatrix.size()); ++i)
sortMatrix[i] = i;
lb->SetList(sortedList.c_str(), separator, typesep);
}
diff --git a/src/Indicator.cxx b/src/Indicator.cxx
index 4a2d43895..18ae0f2c8 100644
--- a/src/Indicator.cxx
+++ b/src/Indicator.cxx
@@ -21,7 +21,8 @@ using namespace Scintilla;
static PRectangle PixelGridAlign(const PRectangle &rc) {
// Move left and right side to nearest pixel to avoid blurry visuals
- return PRectangle::FromInts(int(rc.left + 0.5), int(rc.top), int(rc.right + 0.5), int(rc.bottom));
+ return PRectangle::FromInts(static_cast<int>(rc.left + 0.5), static_cast<int>(rc.top),
+ static_cast<int>(rc.right + 0.5), static_cast<int>(rc.bottom));
}
void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &rcLine, const PRectangle &rcCharacter, DrawState drawState, int value) const {
@@ -35,8 +36,8 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r
surface->PenColour(sacDraw.fore);
int ymid = static_cast<int>(rc.bottom + rc.top) / 2;
if (sacDraw.style == INDIC_SQUIGGLE) {
- int x = int(rc.left+0.5);
- const int xLast = int(rc.right+0.5);
+ int x = static_cast<int>(rc.left+0.5);
+ const int xLast = static_cast<int>(rc.right+0.5);
int y = 0;
surface->MoveTo(x, static_cast<int>(rc.top) + y);
while (x < xLast) {