aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2013-12-15 10:46:39 +1100
committerNeil <nyamatongwe@gmail.com>2013-12-15 10:46:39 +1100
commit7c020de8903c45bcc32795e28cc13a32285513f3 (patch)
tree07122e00dc818dd09b200fb7a1e80980ab2699fa /src
parent90990e1c3f2a1ea94c5ff4449f991652e2cd9e14 (diff)
downloadscintilla-mirror-7c020de8903c45bcc32795e28cc13a32285513f3.tar.gz
Format normalization - whitespace and braces made consistent.
Parameter names added to method declarations.
Diffstat (limited to 'src')
-rw-r--r--src/AutoComplete.h2
-rw-r--r--src/CaseConvert.cxx2
-rw-r--r--src/CellBuffer.h4
-rw-r--r--src/Document.cxx6
-rw-r--r--src/Document.h10
-rw-r--r--src/Editor.cxx16
-rw-r--r--src/Editor.h2
-rw-r--r--src/PerLine.cxx2
-rw-r--r--src/PositionCache.cxx2
-rw-r--r--src/RESearch.cxx36
-rw-r--r--src/ScintillaBase.cxx2
-rw-r--r--src/SplitVector.h4
-rw-r--r--src/UniConversion.cxx2
-rw-r--r--src/XPM.cxx4
-rw-r--r--src/XPM.h2
15 files changed, 52 insertions, 44 deletions
diff --git a/src/AutoComplete.h b/src/AutoComplete.h
index 9977196a2..f7a0c3f1e 100644
--- a/src/AutoComplete.h
+++ b/src/AutoComplete.h
@@ -71,7 +71,7 @@ public:
/// The list string contains a sequence of words separated by the separator character
void SetList(const char *list);
-
+
/// Return the position of the currently selected list item
int GetSelection() const;
diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx
index 59819bcf6..f983458c0 100644
--- a/src/CaseConvert.cxx
+++ b/src/CaseConvert.cxx
@@ -510,7 +510,7 @@ void SetupConversions(enum CaseConversion conversion) {
int upper = symmetricCaseConversionRanges[i++];
int length = symmetricCaseConversionRanges[i++];
int pitch = symmetricCaseConversionRanges[i++];
- for (int j=0;j<length*pitch;j+=pitch) {
+ for (int j=0; j<length*pitch; j+=pitch) {
AddSymmetric(conversion, lower+j, upper+j);
}
}
diff --git a/src/CellBuffer.h b/src/CellBuffer.h
index 82179ac9a..6b719de27 100644
--- a/src/CellBuffer.h
+++ b/src/CellBuffer.h
@@ -17,8 +17,8 @@ class PerLine {
public:
virtual ~PerLine() {}
virtual void Init()=0;
- virtual void InsertLine(int)=0;
- virtual void RemoveLine(int)=0;
+ virtual void InsertLine(int line)=0;
+ virtual void RemoveLine(int line)=0;
};
/**
diff --git a/src/Document.cxx b/src/Document.cxx
index 78aa22794..acf4d9755 100644
--- a/src/Document.cxx
+++ b/src/Document.cxx
@@ -955,7 +955,7 @@ bool Document::InsertString(int position, const char *s, int insertLength) {
int SCI_METHOD Document::AddData(char *data, int length) {
try {
int position = Length();
- InsertString(position,data, length);
+ InsertString(position, data, length);
} catch (std::bad_alloc &) {
return SC_STATUS_BADALLOC;
} catch (...) {
@@ -1892,7 +1892,7 @@ void SCI_METHOD Document::DecorationFillRange(int position, int value, int fillL
bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
WatcherWithUserData wwud(watcher, userData);
- std::vector<WatcherWithUserData>::iterator it =
+ std::vector<WatcherWithUserData>::iterator it =
std::find(watchers.begin(), watchers.end(), wwud);
if (it != watchers.end())
return false;
@@ -1901,7 +1901,7 @@ bool Document::AddWatcher(DocWatcher *watcher, void *userData) {
}
bool Document::RemoveWatcher(DocWatcher *watcher, void *userData) {
- std::vector<WatcherWithUserData>::iterator it =
+ std::vector<WatcherWithUserData>::iterator it =
std::find(watchers.begin(), watchers.end(), WatcherWithUserData(watcher, userData));
if (it != watchers.end()) {
watchers.erase(it);
diff --git a/src/Document.h b/src/Document.h
index d02025cb5..1e43076ca 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -443,12 +443,12 @@ public:
*/
class DocModification {
public:
- int modificationType;
+ int modificationType;
int position;
- int length;
- int linesAdded; /**< Negative if lines deleted. */
- const char *text; /**< Only valid for changes to text, not for changes to style. */
- int line;
+ int length;
+ int linesAdded; /**< Negative if lines deleted. */
+ const char *text; /**< Only valid for changes to text, not for changes to style. */
+ int line;
int foldLevelNow;
int foldLevelPrev;
int annotationLinesAdded;
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 074668059..764e00dce 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1988,7 +1988,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
}
} else if (levelNum > SC_FOLDLEVELBASE) {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
- }
+ }
} else {
if (levelNum < levelNextNum) {
if (cs.GetExpanded(lineDoc)) {
@@ -1998,7 +1998,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {
}
} else if (levelNum > SC_FOLDLEVELBASE) {
marks |= 1 << SC_MARKNUM_FOLDERSUB;
- }
+ }
}
needWhiteClosure = false;
int firstFollowupLine = cs.DocFromDisplay(cs.DisplayFromDoc(lineDoc + 1));
@@ -2300,7 +2300,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou
posCache.MeasureWidths(surface, vstyle, STYLE_CONTROLCHAR, ts.representation->stringRep.c_str(),
static_cast<unsigned int>(ts.representation->stringRep.length()), positionsRepr, pdoc);
representationWidth = positionsRepr[ts.representation->stringRep.length()-1] + vstyle.ctrlCharPadding;
- }
+ }
}
for (int ii=0; ii < ts.length; ii++)
ll->positions[ts.start + 1 + ii] = representationWidth;
@@ -3464,7 +3464,7 @@ void Editor::DrawCarets(Surface *surface, ViewStyle &vsDraw, int lineDoc, int xS
int caretWidthOffset = 0;
PRectangle rcCaret = rcLine;
- if (posCaret.Position() == pdoc->Length()) { // At end of document
+ if (posCaret.Position() == pdoc->Length()) { // At end of document
caretAtEOF = true;
widthOverstrikeCaret = vsDraw.aveCharWidth;
} else if ((posCaret.Position() - posLineStart) >= ll->numCharsInLine) { // At end of line
@@ -4960,7 +4960,7 @@ void Editor::NotifyMacroRecord(unsigned int iMessage, uptr_t wParam, sptr_t lPar
case SCI_NEWLINE:
default:
// printf("Filtered out %ld of macro recording\n", iMessage);
- return ;
+ return;
}
// Send notification
@@ -7018,7 +7018,7 @@ void Editor::SetFoldExpanded(int lineDoc, bool expanded) {
void Editor::FoldLine(int line, int action) {
if (line >= 0) {
if (action == SC_FOLDACTION_TOGGLE) {
- if ((pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG) == 0) {
+ if ((pdoc->GetLevel(line) & SC_FOLDLEVELHEADERFLAG) == 0) {
line = pdoc->GetFoldParent(line);
if (line < 0)
return;
@@ -8445,7 +8445,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
if (wParam <= MARKER_MAX) {
vs.markers[wParam].SetXPM(CharPtrFromSPtr(lParam));
vs.CalcLargestMarkerHeight();
- };
+ }
InvalidateStyleData();
RedrawSelMargin();
break;
@@ -8466,7 +8466,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
if (wParam <= MARKER_MAX) {
vs.markers[wParam].SetRGBAImage(sizeRGBAImage, scaleRGBAImage / 100.0, reinterpret_cast<unsigned char *>(lParam));
vs.CalcLargestMarkerHeight();
- };
+ }
InvalidateStyleData();
RedrawSelMargin();
break;
diff --git a/src/Editor.h b/src/Editor.h
index da4787b0a..7a8f1eb1d 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -119,7 +119,7 @@ public:
}
private:
void FixSelectionForClipboard() {
- // To avoid truncating the contents of the clipboard when pasted where the
+ // To avoid truncating the contents of the clipboard when pasted where the
// clipboard contains NUL characters, replace NUL characters by spaces.
std::replace(s.begin(), s.end(), '\0', ' ');
}
diff --git a/src/PerLine.cxx b/src/PerLine.cxx
index a066bd647..7bf892240 100644
--- a/src/PerLine.cxx
+++ b/src/PerLine.cxx
@@ -98,7 +98,7 @@ bool MarkerHandleSet::RemoveNumber(int markerNum, bool all) {
delete mhn;
performedDeletion = true;
if (!all)
- break;
+ break;
} else {
pmhn = &((*pmhn)->next);
}
diff --git a/src/PositionCache.cxx b/src/PositionCache.cxx
index 7201ff548..413796f85 100644
--- a/src/PositionCache.cxx
+++ b/src/PositionCache.cxx
@@ -454,7 +454,7 @@ BreakFinder::~BreakFinder() {
TextSegment BreakFinder::Next() {
if (subBreak == -1) {
int prev = nextBreak;
- while (nextBreak < lineEnd) {
+ while (nextBreak < lineEnd) {
int charWidth = 1;
if (encodingFamily == efUnicode)
charWidth = UTF8DrawBytes(reinterpret_cast<unsigned char *>(ll->chars) + nextBreak, lineEnd - nextBreak);
diff --git a/src/RESearch.cxx b/src/RESearch.cxx
index efa23eb84..81eddf013 100644
--- a/src/RESearch.cxx
+++ b/src/RESearch.cxx
@@ -333,16 +333,18 @@ static int GetHexaChar(unsigned char hd1, unsigned char hd2) {
hexValue += 16 * (hd1 - 'A' + 10);
} else if (hd1 >= 'a' && hd1 <= 'f') {
hexValue += 16 * (hd1 - 'a' + 10);
- } else
+ } else {
return -1;
+ }
if (hd2 >= '0' && hd2 <= '9') {
hexValue += hd2 - '0';
} else if (hd2 >= 'A' && hd2 <= 'F') {
hexValue += hd2 - 'A' + 10;
} else if (hd2 >= 'a' && hd2 <= 'f') {
hexValue += hd2 - 'a' + 10;
- } else
+ } else {
return -1;
+ }
return hexValue;
}
@@ -472,18 +474,18 @@ const char *RESearch::Compile(const char *pattern, int length, bool caseSensitiv
break;
case '^': /* match beginning */
- if (p == pattern)
+ if (p == pattern) {
*mp++ = BOL;
- else {
+ } else {
*mp++ = CHR;
*mp++ = *p;
}
break;
case '$': /* match endofline */
- if (!*(p+1))
+ if (!*(p+1)) {
*mp++ = EOL;
- else {
+ } else {
*mp++ = CHR;
*mp++ = *p;
}
@@ -498,8 +500,9 @@ const char *RESearch::Compile(const char *pattern, int length, bool caseSensitiv
mask = '\377';
i++;
p++;
- } else
+ } else {
mask = 0;
+ }
if (*p == '-') { /* real dash */
i++;
@@ -523,9 +526,9 @@ const char *RESearch::Compile(const char *pattern, int length, bool caseSensitiv
i++;
c2 = static_cast<unsigned char>(*++p);
if (c2 == '\\') {
- if (!*(p+1)) // End of RE
+ if (!*(p+1)) { // End of RE
return badpat("Missing ]");
- else {
+ } else {
i++;
p++;
int incr;
@@ -654,8 +657,9 @@ const char *RESearch::Compile(const char *pattern, int length, bool caseSensitiv
if (tagc > n) {
*mp++ = static_cast<char>(REF);
*mp++ = static_cast<char>(n);
- } else
+ } else {
return badpat("Undetermined reference");
+ }
break;
default:
if (!posix && *p == '(') {
@@ -663,16 +667,18 @@ const char *RESearch::Compile(const char *pattern, int length, bool caseSensitiv
tagstk[++tagi] = tagc;
*mp++ = BOT;
*mp++ = static_cast<char>(tagc++);
- } else
+ } else {
return badpat("Too many \\(\\) pairs");
+ }
} else if (!posix && *p == ')') {
if (*sp == BOT)
return badpat("Null pattern inside \\(\\)");
if (tagi > 0) {
*mp++ = static_cast<char>(EOT);
*mp++ = static_cast<char>(tagstk[tagi--]);
- } else
+ } else {
return badpat("Unmatched \\)");
+ }
} else {
int incr;
int c = GetBackslashExpression(p, incr);
@@ -697,16 +703,18 @@ const char *RESearch::Compile(const char *pattern, int length, bool caseSensitiv
tagstk[++tagi] = tagc;
*mp++ = BOT;
*mp++ = static_cast<char>(tagc++);
- } else
+ } else {
return badpat("Too many () pairs");
+ }
} else if (posix && *p == ')') {
if (*sp == BOT)
return badpat("Null pattern inside ()");
if (tagi > 0) {
*mp++ = static_cast<char>(EOT);
*mp++ = static_cast<char>(tagstk[tagi--]);
- } else
+ } else {
return badpat("Unmatched )");
+ }
} else {
unsigned char c = *p;
if (!c) // End of RE
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 9190cd6d5..1fb4d6f27 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -209,7 +209,7 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {
if (ac.chooseSingle && (listType == 0)) {
if (list && !strchr(list, ac.GetSeparator())) {
const char *typeSep = strchr(list, ac.GetTypesep());
- int lenInsert = typeSep ?
+ int lenInsert = typeSep ?
static_cast<int>(typeSep-list) : static_cast<int>(strlen(list));
if (ac.ignoreCase) {
// May need to convert the case before invocation, so remove lenEntered characters
diff --git a/src/SplitVector.h b/src/SplitVector.h
index 0c6e350cb..288c9e39f 100644
--- a/src/SplitVector.h
+++ b/src/SplitVector.h
@@ -272,7 +272,7 @@ public:
GapTo(position);
return body + position + gapLength;
} else {
- return body + position ;
+ return body + position;
}
} else {
return body + position + gapLength;
@@ -280,7 +280,7 @@ public:
}
int GapPosition() const {
- return part1Length;
+ return part1Length;
}
};
diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx
index b769250c8..2286e047d 100644
--- a/src/UniConversion.cxx
+++ b/src/UniConversion.cxx
@@ -159,7 +159,7 @@ static int BytesFromLead(int leadByte) {
void UTF8BytesOfLeadInitialise() {
if (!initialisedBytesOfLead) {
- for (int i=0;i<256;i++) {
+ for (int i=0; i<256; i++) {
UTF8BytesOfLead[i] = BytesFromLead(i);
}
initialisedBytesOfLead = true;
diff --git a/src/XPM.cxx b/src/XPM.cxx
index 915636de9..4191e1e92 100644
--- a/src/XPM.cxx
+++ b/src/XPM.cxx
@@ -120,7 +120,7 @@ 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);
- for (size_t x = 0; x<len; x++)
+ for (size_t x = 0; x<len; x++)
pixels[y * width + x] = static_cast<unsigned char>(lform[x]);
}
}
@@ -244,7 +244,7 @@ void RGBAImage::SetPixel(int x, int y, ColourDesired colour, int alpha) {
pixel[3] = static_cast<unsigned char>(alpha);
}
-RGBAImageSet::RGBAImageSet() : height(-1), width(-1){
+RGBAImageSet::RGBAImageSet() : height(-1), width(-1) {
}
RGBAImageSet::~RGBAImageSet() {
diff --git a/src/XPM.h b/src/XPM.h
index c19025d1a..2648fecd9 100644
--- a/src/XPM.h
+++ b/src/XPM.h
@@ -62,7 +62,7 @@ public:
float GetScaledWidth() const { return width / scale; }
int CountBytes() const;
const unsigned char *Pixels() const;
- void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff);
+ void SetPixel(int x, int y, ColourDesired colour, int alpha=0xff);
};
/**