]> git.sur5r.net Git - cc65/blobdiff - test/ref/init.c
remote TABs in doc/ and test/
[cc65] / test / ref / init.c
index dc3f28a81473445d8d1ea574501722258187ac04..3742446d61009633a339fc8c470e4d3bbe07df48 100644 (file)
@@ -1,94 +1,95 @@
-/*\r
-  !!DESCRIPTION!! variable initialization\r
-  !!ORIGIN!!      LCC 4.1 Testsuite\r
-  !!LICENCE!!     own, freely distributeable for non-profit. read CPYRIGHT.LCC\r
-*/\r
-\r
-/* todo: add back conditional stuff here ! */\r
-\r
-typedef struct { int codes[3]; char name[6]; } Word;\r
-\r
+/*
+  !!DESCRIPTION!! variable initialization
+  !!ORIGIN!!      LCC 4.1 Testsuite
+  !!LICENCE!!     own, freely distributeable for non-profit. read CPYRIGHT.LCC
+*/
+
+#include "common.h"
+/* todo: add back conditional stuff here ! */
+
+typedef struct { int codes[3]; char name[6]; } Word;
+
 #ifdef NO_IMPLICIT_FUNC_PROTOTYPES
 
-#ifdef NO_OLD_FUNC_DECL\r
-f();\r
-void g(Word *p);\r
-h();\r
-#else\r
-f();\r
-g();\r
-h();\r
-#endif\r
-\r
-#endif\r
-\r
-/*\r
-Word words[] = {\r
-        1, 2, 3,"if",\r
-       { { 4, 5 }, { 'f', 'o', 'r' } },\r
-        6, 7, 8, {"else"},\r
-        { { 9, 10, 11,}, 'w', 'h', 'i', 'l', 'e', },\r
-        { 0 },\r
-}, *wordlist = words;\r
-*/\r
-\r
-Word words[] = {\r
-        {{1, 2, 3},"if"},\r
-       { { 4, 5 }, { 'f', 'o', 'r' } },\r
-        {{6, 7, 8}, "else"},\r
-        { { 9, 10, 11}, {'w', 'h', 'i', 'l', 'e', }},\r
-        {{ 0 }},\r
-}, *wordlist = words;\r
-\r
-/*int x[][5] = { 1, 2, 3, 4, 0, { 5, 6 }, { 7 } };*/\r
-int x[][5] = { {1, 2, 3, 4, 0 }, { 5, 6 }, { 7 } };\r
+#ifdef NO_OLD_FUNC_DECL
+f();
+void g(Word *p);
+h();
+#else
+f();
+g();
+h();
+#endif
+
+#endif
+
+/*
+Word words[] = {
+        1, 2, 3,"if",
+        { { 4, 5 }, { 'f', 'o', 'r' } },
+        6, 7, 8, {"else"},
+        { { 9, 10, 11,}, 'w', 'h', 'i', 'l', 'e', },
+        { 0 },
+}, *wordlist = words;
+*/
+
+Word words[] = {
+        {{1, 2, 3},"if"},
+        { { 4, 5 }, { 'f', 'o', 'r' } },
+        {{6, 7, 8}, "else"},
+        { { 9, 10, 11}, {'w', 'h', 'i', 'l', 'e', }},
+        {{ 0 }},
+}, *wordlist = words;
+
+/*int x[][5] = { 1, 2, 3, 4, 0, { 5, 6 }, { 7 } };*/
+int x[][5] = { {1, 2, 3, 4, 0 }, { 5, 6 }, { 7 } };
 int *y[] = { x[0], x[1], x[2], 0 };
 
-main()\r
-{\r
-       int i, j;\r
-\r
-       for (i = 0; y[i]; i++) {\r
-               for (j = 0; y[i][j]; j++)\r
-                       printf(" %d", y[i][j]);\r
-               printf("\n");\r
-       }\r
-       f();\r
-       g(wordlist);\r
-       return 0;\r
-}\r
-\r
-f() {\r
-       static char *keywords[] = {"if", "for", "else", "while", 0, };\r
-       char **p;\r
-\r
-       for (p = keywords; *p; p++)\r
-               printf("%s\n", *p);\r
-}\r
-\r
-#ifdef NO_OLD_FUNC_DECL\r
-void g(Word *p)\r
-#else\r
-g(p)\r
-Word *p;\r
-#endif\r
-{\r
-       int i;\r
-\r
-       for ( ; p->codes[0]; p++) {\r
-               for (i = 0; i < sizeof p->codes/sizeof(p->codes[0]); i++)\r
-                       printf("%d ", p->codes[i]);\r
-               printf("%s\n", p->name);\r
-       }\r
-       h();\r
-}\r
-\r
-h()\r
-{\r
-       int i;\r
-\r
-       for (i = 0; i < sizeof(words)/sizeof(Word); i++)\r
-               printf("%d %d %d %s\n", words[i].codes[0],\r
-                       words[i].codes[1], words[i].codes[2],\r
-                       &words[i].name[0]);\r
-}\r
+main()
+{
+        int i, j;
+
+        for (i = 0; y[i]; i++) {
+                for (j = 0; y[i][j]; j++)
+                        printf(" %d", y[i][j]);
+                printf("\n");
+        }
+        f();
+        g(wordlist);
+        return 0;
+}
+
+f() {
+        static char *keywords[] = {"if", "for", "else", "while", 0, };
+        char **p;
+
+        for (p = keywords; *p; p++)
+                printf("%s\n", *p);
+}
+
+#ifdef NO_OLD_FUNC_DECL
+void g(Word *p)
+#else
+g(p)
+Word *p;
+#endif
+{
+        int i;
+
+        for ( ; p->codes[0]; p++) {
+                for (i = 0; i < sizeof p->codes/sizeof(p->codes[0]); i++)
+                        printf("%d ", p->codes[i]);
+                printf("%s\n", p->name);
+        }
+        h();
+}
+
+h()
+{
+        int i;
+
+        for (i = 0; i < sizeof(words)/sizeof(Word); i++)
+                printf("%d %d %d %s\n", words[i].codes[0],
+                        words[i].codes[1], words[i].codes[2],
+                        &words[i].name[0]);
+}