[hackers] [scc] Add return type to function prototypes || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Mon, 28 Sep 2015 10:33:26 +0200 (CEST)

commit 928508eccd9699691f7ef41f508b669953e60b06
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Fri Sep 25 18:35:52 2015 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Fri Sep 25 18:35:52 2015 +0200

    Add return type to function prototypes

diff --git a/cc1/code.c b/cc1/code.c
index 49c96fe..6765f02 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -270,6 +270,8 @@ emittype(Type *tp)
                 break;
         case FTN:
                 emitletter(tp);
+ putchar('\t');
+ emitletter(tp->type);
                 n = tp->n.elem;
                 for (vp = tp->p.pars; n-- > 0; ++vp) {
                         putchar('\t');
diff --git a/cc1/tests/test001.c b/cc1/tests/test001.c
index 64d17ad..6369e04 100644
--- a/cc1/tests/test001.c
+++ b/cc1/tests/test001.c
_AT_@ -2,9 +2,9 @@
 name: TEST001
 description: Basic hello world test
 output:
-F3 P
+F3 I P
 X4 F3 printf
-F5
+F5 I
 G6 F5 main
 {
 \
diff --git a/cc1/tests/test002.c b/cc1/tests/test002.c
index c4085ca..bd2d58c 100644
--- a/cc1/tests/test002.c
+++ b/cc1/tests/test002.c
_AT_@ -3,7 +3,7 @@ name: TEST002
 description: Test forward references before definition of types
 output:
 G4 P x
-F7
+F7 I
 G8 F7 main
 {
 \
diff --git a/cc1/tests/test003.c b/cc1/tests/test003.c
index 66c4d81..7e0170a 100644
--- a/cc1/tests/test003.c
+++ b/cc1/tests/test003.c
_AT_@ -2,7 +2,7 @@
 name: TEST003
 description: Select function to call inside ternary operator
 output:
-F1
+F1 I
 G2 F1 foo
 {
 \
diff --git a/cc1/tests/test004.c b/cc1/tests/test004.c
index b410489..9fb8fcf 100644
--- a/cc1/tests/test004.c
+++ b/cc1/tests/test004.c
_AT_@ -2,7 +2,7 @@
 name: TEST004
 description: Test integer operations
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test005.c b/cc1/tests/test005.c
index 92f949d..9a50743 100644
--- a/cc1/tests/test005.c
+++ b/cc1/tests/test005.c
_AT_@ -2,7 +2,7 @@
 name: TEST005
 description: Test unary integer operations
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test006.c b/cc1/tests/test006.c
index 110e45d..31503fb 100644
--- a/cc1/tests/test006.c
+++ b/cc1/tests/test006.c
_AT_@ -6,7 +6,7 @@ test006.c:6: warning: conditional expression is constant
 test006.c:8: warning: conditional expression is constant
 test006.c:11: warning: conditional expression is constant
 G1 K c
-F2
+F2 I
 G3 F2 main
 {
 \
diff --git a/cc1/tests/test007.c b/cc1/tests/test007.c
index 8a0946b..137e4ab 100644
--- a/cc1/tests/test007.c
+++ b/cc1/tests/test007.c
_AT_@ -2,7 +2,7 @@
 name: TEST007
 description: basic while test
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test008.c b/cc1/tests/test008.c
index dd073ee..461c819 100644
--- a/cc1/tests/test008.c
+++ b/cc1/tests/test008.c
_AT_@ -2,7 +2,7 @@
 name: TEST008
 description: Basic do while loop
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test009.c b/cc1/tests/test009.c
index c3ee1c7..39ba77f 100644
--- a/cc1/tests/test009.c
+++ b/cc1/tests/test009.c
_AT_@ -2,7 +2,7 @@
 name: TEST009
 description: Basic test for loops
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test010.c b/cc1/tests/test010.c
index f5f5705..8218b1d 100644
--- a/cc1/tests/test010.c
+++ b/cc1/tests/test010.c
_AT_@ -5,7 +5,7 @@ output:
 test010.c:9: warning: conditional expression is constant
 test010.c:11: warning: conditional expression is constant
 test010.c:31: warning: conditional expression is constant
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test011.c b/cc1/tests/test011.c
index 4a511ad..84ea114 100644
--- a/cc1/tests/test011.c
+++ b/cc1/tests/test011.c
_AT_@ -4,7 +4,7 @@ description: Basic test for goto
 output:
 test011.c:14: warning: 'foo' defined but not used
 test011.c:14: warning: 'start' defined but not used
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test012.c b/cc1/tests/test012.c
index 32ce7c9..06b04a5 100644
--- a/cc1/tests/test012.c
+++ b/cc1/tests/test012.c
_AT_@ -3,7 +3,7 @@ name: TEST012
 description: Basic switch test
 output:
 test012.c:39: warning: 'foo' defined but not used
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test013.c b/cc1/tests/test013.c
index 92ca0a5..05de402 100644
--- a/cc1/tests/test013.c
+++ b/cc1/tests/test013.c
_AT_@ -16,7 +16,7 @@ G8 Q h
 G9 O i
 G10 I j
 G11 N k
-F12
+F12 I
 G13 F12 main
 {
 \
diff --git a/cc1/tests/test014.c b/cc1/tests/test014.c
index 8f061d9..7f4ab89 100644
--- a/cc1/tests/test014.c
+++ b/cc1/tests/test014.c
_AT_@ -14,7 +14,7 @@ test014.c:29: error: incorrect storage class for file-scope declaration
 G1 I a
 Y2 K b
 X3 I c
-F5
+F5 I
 G6 F5 func1
 {
 \
_AT_@ -25,7 +25,7 @@ X10 I k
 T11 Z a
         r #I0
 }
-F13 I
+F13 0 I
 G14 F13 func2
 {
 R12 I par
diff --git a/cc1/tests/test015.c b/cc1/tests/test015.c
index 465c389..8859230 100644
--- a/cc1/tests/test015.c
+++ b/cc1/tests/test015.c
_AT_@ -11,7 +11,7 @@ M10 S8 s1
 S2 s
 M11 S5 s
 G12 S2 s2
-F13
+F13 I
 G14 F13 main
 {
 \
diff --git a/cc1/tests/test016.c b/cc1/tests/test016.c
index e9ab010..b8b9fff 100644
--- a/cc1/tests/test016.c
+++ b/cc1/tests/test016.c
_AT_@ -4,7 +4,7 @@ description: Basic pointer test
 output:
 test016.c:43: error: redefinition of 'func2'
 G1 I g
-F2
+F2 I
 G3 F2 func1
 {
 \
diff --git a/cc1/tests/test017.c b/cc1/tests/test017.c
index 6667633..820b992 100644
--- a/cc1/tests/test017.c
+++ b/cc1/tests/test017.c
_AT_@ -2,7 +2,7 @@
 name: TEST017
 description: Basic test about pointers and structs
 output:
-F9
+F9 I
 G10 F9 main
 {
 \
diff --git a/cc1/tests/test018.c b/cc1/tests/test018.c
index 9b3dd7b..05311db 100644
--- a/cc1/tests/test018.c
+++ b/cc1/tests/test018.c
_AT_@ -2,7 +2,7 @@
 name: TEST018
 description: Basic test for arrays
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test019.c b/cc1/tests/test019.c
index b012372..d3dfee5 100644
--- a/cc1/tests/test019.c
+++ b/cc1/tests/test019.c
_AT_@ -5,7 +5,7 @@ description: Basic test of constant folding in integer arithmetic operations
 output:
 test019.c:13: warning: division by 0
 test019.c:14: warning: division by 0
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test020.c b/cc1/tests/test020.c
index 58610dc..885110e 100644
--- a/cc1/tests/test020.c
+++ b/cc1/tests/test020.c
_AT_@ -5,7 +5,7 @@ description: Basic test for integer algebraic identities
 output:
 test020.c:81: warning: division by 0
 test020.c:82: warning: division by 0
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test021.c b/cc1/tests/test021.c
index 58cb567..3630c7f 100644
--- a/cc1/tests/test021.c
+++ b/cc1/tests/test021.c
_AT_@ -4,7 +4,7 @@ name: TEST021
 description: Basic test for char constants
 comments: This test is done for z80 implementation
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test022.c b/cc1/tests/test022.c
index 1edd5ce..a0d629e 100644
--- a/cc1/tests/test022.c
+++ b/cc1/tests/test022.c
_AT_@ -4,7 +4,7 @@ name: TEST022
 description: Basic test for int constants
 comments: This test is done for z80 data types
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test023.c b/cc1/tests/test023.c
index 825d72b..4a582e6 100644
--- a/cc1/tests/test023.c
+++ b/cc1/tests/test023.c
_AT_@ -4,7 +4,7 @@ name: TEST023
 description: Basic test for long constants
 comments: This test is done for z80 data types
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
diff --git a/cc1/tests/test024.c b/cc1/tests/test024.c
index 2441ed0..89fa7cf 100644
--- a/cc1/tests/test024.c
+++ b/cc1/tests/test024.c
_AT_@ -4,7 +4,7 @@ name: TEST024
 description: Basic test for long long constants
 comments: This test is done for z80 data types
 output:
-F1
+F1 I
 G2 F1 main
 {
 \
Received on Mon Sep 28 2015 - 10:33:26 CEST

This archive was generated by hypermail 2.3.0 : Mon Sep 28 2015 - 10:36:11 CEST