diff --git a/runastyle b/runastyle index 1ee4a2288..135a4419e 100755 --- a/runastyle +++ b/runastyle @@ -28,4 +28,5 @@ astyle $style $options test/*.cpp astyle $style $options test/*.h astyle $style $options tools/*.cpp +astyle $style $options --recursive "samples/*.c" diff --git a/samples/AssignmentAddressToInteger/bad.c b/samples/AssignmentAddressToInteger/bad.c new file mode 100644 index 000000000..ca721f548 --- /dev/null +++ b/samples/AssignmentAddressToInteger/bad.c @@ -0,0 +1,11 @@ +int foo(int *p) +{ + int a = p; + return a + 4; +} +int main() +{ + int i[10]; + foo(i); +} + diff --git a/samples/AssignmentAddressToInteger/good.c b/samples/AssignmentAddressToInteger/good.c new file mode 100644 index 000000000..ebddc4b8c --- /dev/null +++ b/samples/AssignmentAddressToInteger/good.c @@ -0,0 +1,11 @@ +int* foo(int *p) +{ + return p + 4; +} +int main() +{ + int i[10]; + foo(i); +} + +