[hackers] [scc] Move function brackets to a line || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Sat, 15 Aug 2015 23:27:07 +0200 (CEST)

commit d9bbd7ad7628e10d605a7958db16a432164c4a1d
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Sat Aug 15 19:55:47 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Sat Aug 15 19:55:47 2015 +0200

    Move function brackets to a line
    
    This make easier to parse the IR, because there is no difference
    between a prototype and a function.

diff --git a/cc1/code.c b/cc1/code.c
index e7d77b2..ec27c71 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -330,7 +330,7 @@ emitfun(unsigned op, void *arg)
         int n;
 
         emitdcl(op, arg);
- puts("\t{");
+ puts("\n{");
 
         n = sym->type->n.elem;
         for (sp = sym->u.pars; n-- > 0; ++sp) {
diff --git a/cc1/tests/test001.c b/cc1/tests/test001.c
index 4e94677..97c701f 100644
--- a/cc1/tests/test001.c
+++ b/cc1/tests/test001.c
_AT_@ -5,7 +5,8 @@ output:
 F3 P
 X1 F3 printf
 F1
-G2 F1 main {
+G2 F1 main
+{
 -
         X1 "68656C6C6F20776F726C640A aP pP cI
         yI #I0
diff --git a/cc1/tests/test002.c b/cc1/tests/test002.c
index f39497c..4978ac5 100644
--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
_AT_@ -4,7 +4,8 @@ description: Test forward references before definition of types
 output:
 G4 P x
 F1
-G6 F1 main {
+G6 F1 main
+{
 -
 S2 S (
 M5 I i
diff --git a/cc1/tests/test003.c b/cc1/tests/test003.c
index d1fad25..9b3d3f2 100644
--- a/cc1/tests/test003.c
+++ b/cc1/tests/test003.c
_AT_@ -3,15 +3,18 @@ name: TEST003
 description: Select function to call inside ternary operator
 output:
 F1
-G1 F1 foo {
+G1 F1 foo
+{
 -
         yI #I2A
 }
-G2 F1 bar {
+G2 F1 bar
+{
 -
         yI #I18
 }
-G3 F1 main {
+G3 F1 main
+{
 -
         yI G1 cI
 }
diff --git a/cc1/tests/test004.c b/cc1/tests/test004.c
index de4583d..cfa8ed3 100644
--- a/cc1/tests/test004.c
+++ b/cc1/tests/test004.c
_AT_@ -3,7 +3,8 @@ name: TEST004
 description: Test integer operations
 output:
 F1
-G1 F1 main {
+G1 F1 main
+{
 -
 A2 I x
         A2 #I0 :I
diff --git a/cc1/tests/test005.c b/cc1/tests/test005.c
index eb80573..08f4265 100644
--- a/cc1/tests/test005.c
+++ b/cc1/tests/test005.c
_AT_@ -3,7 +3,8 @@ name: TEST005
 description: Test unary integer operations
 output:
 F1
-G1 F1 main {
+G1 F1 main
+{
 -
 A2 I x
         A2 #I3 :I
diff --git a/cc1/tests/test006.c b/cc1/tests/test006.c
index b1fa74d..ebfd61e 100644
--- a/cc1/tests/test006.c
+++ b/cc1/tests/test006.c
_AT_@ -2,12 +2,13 @@
 name: TEST006
 description: Basic test for if
 output:
-test006.c:41: warning: conditional expression is constant
-test006.c:43: warning: conditional expression is constant
-test006.c:46: warning: conditional expression is constant
+test006.c:42: warning: conditional expression is constant
+test006.c:44: warning: conditional expression is constant
+test006.c:47: warning: conditional expression is constant
 G1 M c
 F1
-G2 F1 main {
+G2 F1 main
+{
 -
         j L2 #I0
         yI #I1
Received on Sat Aug 15 2015 - 23:27:07 CEST

This archive was generated by hypermail 2.3.0 : Sat Aug 15 2015 - 23:36:19 CEST