Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Stornelli2019-04-12 12:15:16 -0400
committerMarco Stornelli2019-05-12 09:42:21 -0400
commitf893b77dba991ba1b3348d72267573540e9ce8bd (patch)
tree91b5f2cbe30fb629af8007f444b31b138c077039 /core/org.eclipse.cdt.ui.tests/resources/formatter/preview
parent826a0b2c0effc6a8d1479ddbff8d5b4bbd31a6b6 (diff)
downloadorg.eclipse.cdt-f893b77dba991ba1b3348d72267573540e9ce8bd.tar.gz
org.eclipse.cdt-f893b77dba991ba1b3348d72267573540e9ce8bd.tar.xz
org.eclipse.cdt-f893b77dba991ba1b3348d72267573540e9ce8bd.zip
Bug 461435 - Added options to format pointers in methods
Rules used: 1) Default is right alignment to be compliant with built-in formatter rules; 2) Pointer with declarator without name will be always left alignment unless there's a nested declarator; 3) Return value of methods/functions is always left alignment; 4) If left alignment is selected, if space after comma is selected too for a declaration list, space is always forced after the comma. Change-Id: I82d5ad130e665e5357644cc59655a558f3fb732f Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
Diffstat (limited to 'core/org.eclipse.cdt.ui.tests/resources/formatter/preview')
-rw-r--r--core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp
index 4f07ae9de88..e712f9feab8 100644
--- a/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp
+++ b/core/org.eclipse.cdt.ui.tests/resources/formatter/preview/After.cpp
@@ -7,17 +7,17 @@ public:
Point(double x, double y) :
x(x), y(y) {
}
- double distance(const Point& other) const;
- int compareX(const Point& other) const;
+ double distance(const Point &other) const;
+ int compareX(const Point &other) const;
double x;
double y;
};
-double Point::distance(const Point& other) const {
+double Point::distance(const Point &other) const {
double dx = x - other.x;
double dy = y - other.y;
return sqrt(dx * dx + dy * dy);
}
-int Point::compareX(const Point& other) const {
+int Point::compareX(const Point &other) const {
if (x < other.x) {
return -1;
} else if (x > other.x) {

Back to the top