Skip to content

Commit 86ba0a7

Browse files
committed
Format C sources with new clang-format.
1 parent de0138a commit 86ba0a7

File tree

19 files changed

+50
-48
lines changed

19 files changed

+50
-48
lines changed

sulong/tests/com.oracle.truffle.llvm.tests.inlineasm.native/inlineasm/inlineassembly003.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2021, Oracle and/or its affiliates.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -32,7 +32,7 @@
3232
int main() {
3333
int arg1 = 0;
3434
int not = 0;
35-
__asm__("notl %%eax;" : "=a"(not ) : "a"(arg1));
35+
__asm__("notl %%eax;" : "=a"(not) : "a"(arg1));
3636

3737
if (not != -1) {
3838
abort();

sulong/tests/com.oracle.truffle.llvm.tests.inlineasm.native/inlineasm/inlineassembly005.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2016, 2021, Oracle and/or its affiliates.
2+
* Copyright (c) 2016, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -32,5 +32,5 @@ int main() {
3232
int arg2 = 9;
3333
int or = 0;
3434
__asm__("orl %%ebx, %%eax;" : "=a"(or) : "a"(arg1), "b"(arg2));
35-
return or ;
35+
return or;
3636
}

sulong/tests/com.oracle.truffle.llvm.tests.interop.native/interop/interopUndefinedToIntConv.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates.
2+
* Copyright (c) 2020, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -38,7 +38,7 @@ struct Order {
3838
POLYGLOT_DECLARE_STRUCT(Order);
3939

4040
int main() {
41-
struct Order o = (struct Order){ .price = 100 };
41+
struct Order o = (struct Order) { .price = 100 };
4242

4343
/* The following line represents: void *foo = polyglot_eval("js", "(order) => order.price"); */
4444
void *foo = polyglot_import("getPrice");

sulong/tests/com.oracle.truffle.llvm.tests.interop.native/interop/polyglotArrayToNative.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -48,7 +48,7 @@ void get_Simple_array_typeid(uint64_t len, void (*ret)(polyglot_typeid typeid))
4848
ret(polyglot_array_typeid(polyglot_VoidPtr_typeid(), len));
4949
}
5050

51-
#define WRAP(x) ((Simple){ (x) })
51+
#define WRAP(x) ((Simple) { (x) })
5252

5353
void *simple_array_to_native(VoidPtr *polyglot_array, uint64_t size) {
5454
Simple *native = (Simple *) malloc(size * sizeof(Simple));

sulong/tests/com.oracle.truffle.llvm.tests.irdebug.native/src/vectorKinds.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2018, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -45,10 +45,10 @@ template <typename T> void doReceive(T toInspect) {
4545
}
4646

4747
__attribute__((constructor)) void test() {
48-
doReceive((v9sb){ '0', '1', '2', '3', '4', '5', '6', '7', '8' });
49-
doReceive((v8ss){ 0, 1, 2, 3, 4, 5, 6, 7 });
50-
doReceive((v7si){ 0, 1, 2, 3, 4, 5, 6 });
51-
doReceive((v6sl){ 0L, 1L, 2L, 3L, 4L, 5L });
52-
doReceive((v5flt){ 0.0f, 1.1f, 2.2f, 3.3f, 4.4f });
53-
doReceive((v4dbl){ 0.0, 1.1, 2.2, 3.3 });
48+
doReceive((v9sb) { '0', '1', '2', '3', '4', '5', '6', '7', '8' });
49+
doReceive((v8ss) { 0, 1, 2, 3, 4, 5, 6, 7 });
50+
doReceive((v7si) { 0, 1, 2, 3, 4, 5, 6 });
51+
doReceive((v6sl) { 0L, 1L, 2L, 3L, 4L, 5L });
52+
doReceive((v5flt) { 0.0f, 1.1f, 2.2f, 3.3f, 4.4f });
53+
doReceive((v4dbl) { 0.0, 1.1, 2.2, 3.3 });
5454
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/arrayTest/compoundLiteral1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -34,6 +34,6 @@ int func() {
3434

3535
int main() {
3636
int *arr;
37-
arr = (int[]){ 1, func(), func() };
37+
arr = (int[]) { 1, func(), func() };
3838
return arr[0] + arr[1] + arr[2] + func();
3939
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/arrayTest/constSizeVarArray1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -30,5 +30,5 @@
3030
int main() {
3131
long n = 5;
3232
int x[3 * n];
33-
return &x == (int(*)[3 * n]) x;
33+
return &x == (int (*)[3 * n]) x;
3434
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/arrayTest/constSizeVarArray2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -31,7 +31,7 @@ char n = 5;
3131

3232
int func() {
3333
int x[3 * n];
34-
return &x == (int(*)[3 * n]) x;
34+
return &x == (int (*)[3 * n]) x;
3535
}
3636

3737
int main() {

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/functionTest/functionTestSpecialFormat1.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -29,7 +29,9 @@
2929
*/
3030
int test(t)
3131
int t;
32-
{ return t + 1; }
32+
{
33+
return t + 1;
34+
}
3335

3436
int main() {
3537
return test(3);

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/structTest/compoundLiteral.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -34,6 +34,6 @@ struct test {
3434

3535
int main() {
3636
struct test t;
37-
t = (struct test){ 4 + 5, 2 };
37+
t = (struct test) { 4 + 5, 2 };
3838
return t.a + t.b;
3939
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/structTest/compoundLiteral2.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -35,6 +35,6 @@ struct test {
3535

3636
int main() {
3737
struct test t;
38-
t = (struct test){ 4 + 5, { 43, 12, 2 }, 3 };
38+
t = (struct test) { 4 + 5, { 43, 12, 2 }, 3 };
3939
return t.a + t.b[0] + t.c + t.b[1] + t.b[2];
4040
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/structTest/compoundLiteral3.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -33,6 +33,6 @@ struct test {
3333
};
3434

3535
int main() {
36-
struct test t = (struct test){ 9, 2 };
36+
struct test t = (struct test) { 9, 2 };
3737
return t.a + t.b;
3838
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/structTest/passPerValue7.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -44,5 +44,5 @@ int function(struct test t, int iter) {
4444

4545
int main() {
4646
struct test t = { 1, 2 };
47-
return (function((struct test){ 1, 2 }, 20) + function(t, 10)) % 256;
47+
return (function((struct test) { 1, 2 }, 20) + function(t, 10)) % 256;
4848
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/structTest/passPerValue9.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -53,7 +53,7 @@ int func(struct test t) {
5353
}
5454

5555
int main() {
56-
struct test t = { { 1, 2, 3 }, &(struct point){ 4, 5 } };
56+
struct test t = { { 1, 2, 3 }, &(struct point) { 4, 5 } };
5757
int ret = func(t) + func(t);
5858
return ret + t.a[0] + t.a[1] + t.a[2] + t.p->x + t.p->y;
5959
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/truffle-c/structTest/structTest27.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2022, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -161,8 +161,8 @@ int main() {
161161
insert(1);
162162
display(head, f);
163163

164-
fprintf(f, "%i", delete (2));
165-
fprintf(f, "%i", delete (8));
164+
fprintf(f, "%i", delete(2));
165+
fprintf(f, "%i", delete(8));
166166

167167
display(head, f);
168168

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/varargs/varStructDouble.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -54,6 +54,6 @@ int foo(__attribute__((unused)) double y0, __attribute__((unused)) double y1, do
5454
}
5555

5656
int main() {
57-
return foo(0., 0., 6., (struct _point){ 1., 0. }, (struct _point){ 2., 0. }, (struct _point){ 3., 0. }, (struct _point){ 5., 0. },
58-
(struct _point){ 7., 0. }, (struct _point){ 11., 0. });
57+
return foo(0., 0., 6., (struct _point) { 1., 0. }, (struct _point) { 2., 0. }, (struct _point) { 3., 0. }, (struct _point) { 5., 0. },
58+
(struct _point) { 7., 0. }, (struct _point) { 11., 0. });
5959
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/varargs/varStructLong.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -54,6 +54,6 @@ int foo(__attribute__((unused)) long y0, __attribute__((unused)) long y1, long y
5454
}
5555

5656
int main() {
57-
return foo(0L, 0L, 6L, (struct _point){ 1L, 0L }, (struct _point){ 2L, 0L }, (struct _point){ 3L, 0L }, (struct _point){ 5L, 0L },
58-
(struct _point){ 7L, 0L }, (struct _point){ 11L, 0L });
57+
return foo(0L, 0L, 6L, (struct _point) { 1L, 0L }, (struct _point) { 2L, 0L }, (struct _point) { 3L, 0L }, (struct _point) { 5L, 0L },
58+
(struct _point) { 7L, 0L }, (struct _point) { 11L, 0L });
5959
}

sulong/tests/com.oracle.truffle.llvm.tests.sulong.native/c/varargs/varStructModifyPtr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -56,7 +56,7 @@ int foo(int x, ...) {
5656
}
5757

5858
int main() {
59-
struct _point p = { 19L, &(struct _bar){ 3 } };
59+
struct _point p = { 19L, &(struct _bar) { 3 } };
6060

6161
return foo(2, p) + foo(2, p);
6262
}

sulong/tests/com.oracle.truffle.llvm.tests.sulongcpp.native/cpp/test009.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2020, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
*
44
* All rights reserved.
55
*
@@ -35,17 +35,17 @@ class someClass {
3535

3636
class someOtherClass : public someClass {};
3737

38-
bool instanceof (someClass * c) {
38+
bool instanceof(someClass *c) {
3939
someOtherClass *other = dynamic_cast<someOtherClass *>(c);
4040
return other != 0;
4141
}
4242

4343
int main() {
4444
someClass c;
45-
if (instanceof (&c) == true)
45+
if (instanceof(&c) == true)
4646
return 1;
4747
someOtherClass c2;
48-
if (instanceof (&c2) == false)
48+
if (instanceof(&c2) == false)
4949
return 1;
5050
return 0;
5151
}

0 commit comments

Comments
 (0)