Skip to content

Commit 75527f8

Browse files
Formatting
1 parent 709facc commit 75527f8

File tree

74 files changed

+7228
-7174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+7228
-7174
lines changed

.clang-format

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
BasedOnStyle: LLVM
2+
IndentWidth: 4
3+
TabWidth: 4
4+
UseTab: Never
5+
ContinuationIndentWidth: 8

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Start the OGO application:
105105
```
106106

107107
#### Format Code
108-
Auto-format Java code according to project standards:
108+
Auto-format Java and C++ code according to project standards:
109109

110110
```bash
111111
./tasks.sh format

pom.xml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,17 @@
275275
</executions>
276276
</plugin>
277277
<plugin>
278-
<groupId>com.spotify.fmt</groupId>
279-
<artifactId>fmt-maven-plugin</artifactId>
280-
<version>2.23</version>
278+
<groupId>net.revelc.code.formatter</groupId>
279+
<artifactId>formatter-maven-plugin</artifactId>
280+
<version>2.24.1</version>
281281
<executions>
282-
<execution>
283-
<goals>
284-
<goal>format</goal>
285-
</goals>
286-
</execution>
282+
<execution>
283+
<goals>
284+
<goal>format</goal>
285+
</goals>
286+
</execution>
287287
</executions>
288-
</plugin>
288+
</plugin>
289289
</plugins>
290290
</build>
291291
</project>

src/main/c/src/agent_util.cpp

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,18 @@ searchTag(int l,
5454
bool UTIL::AGENT::searchTag(int l, int h, const long value,
5555
const std::vector<long> &tags, int *index) {
5656

57-
while (l <= h) {
58-
*index = (int)(ceil((l + h) / 2.0));
57+
while (l <= h) {
58+
*index = (int)(ceil((l + h) / 2.0));
5959

60-
if (value == tags[*index]) {
61-
return true; /* Tag found at index mid */
62-
} else if (value > tags[*index]) {
63-
l = (*index) + 1;
64-
} else {
65-
h = (*index) - 1;
60+
if (value == tags[*index]) {
61+
return true; /* Tag found at index mid */
62+
} else if (value > tags[*index]) {
63+
l = (*index) + 1;
64+
} else {
65+
h = (*index) - 1;
66+
}
6667
}
67-
}
68-
return false;
68+
return false;
6969
}
7070

7171
/**
@@ -79,34 +79,34 @@ bool UTIL::AGENT::searchTag(int l, int h, const long value,
7979
*/
8080
void UTIL::AGENT::mergeSort(int i, int j, std::vector<long> &a,
8181
std::vector<long> &aux) {
82-
if (j <= i) {
83-
return;
84-
}
85-
int mid = (i + j) / 2;
86-
mergeSort(i, mid, a, aux);
87-
mergeSort(mid + 1, j, a, aux);
82+
if (j <= i) {
83+
return;
84+
}
85+
int mid = (i + j) / 2;
86+
mergeSort(i, mid, a, aux);
87+
mergeSort(mid + 1, j, a, aux);
8888

89-
int pointer_left = i;
90-
int pointer_right = mid + 1;
91-
int k;
89+
int pointer_left = i;
90+
int pointer_right = mid + 1;
91+
int k;
9292

93-
for (k = i; k <= j; k++) {
94-
if (pointer_left == mid + 1) {
95-
aux[k] = a[pointer_right];
96-
pointer_right++;
97-
} else if (pointer_right == j + 1) {
98-
aux[k] = a[pointer_left];
99-
pointer_left++;
100-
} else if (a[pointer_left] < a[pointer_right]) {
101-
aux[k] = a[pointer_left];
102-
pointer_left++;
103-
} else {
104-
aux[k] = a[pointer_right];
105-
pointer_right++;
93+
for (k = i; k <= j; k++) {
94+
if (pointer_left == mid + 1) {
95+
aux[k] = a[pointer_right];
96+
pointer_right++;
97+
} else if (pointer_right == j + 1) {
98+
aux[k] = a[pointer_left];
99+
pointer_left++;
100+
} else if (a[pointer_left] < a[pointer_right]) {
101+
aux[k] = a[pointer_left];
102+
pointer_left++;
103+
} else {
104+
aux[k] = a[pointer_right];
105+
pointer_right++;
106+
}
106107
}
107-
}
108108

109-
for (k = i; k <= j; k++) {
110-
a[k] = aux[k];
111-
}
109+
for (k = i; k <= j; k++) {
110+
a[k] = aux[k];
111+
}
112112
}

0 commit comments

Comments
 (0)