[hackers] [scc] cleanup: move enums above structs etc. || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Fri, 20 May 2016 20:23:46 +0200 (CEST)

commit 605d8bfc73a69a16e8ff6992f73cf207425d386e
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Fri May 20 19:45:31 2016 +0200
Commit: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
CommitDate: Fri May 20 19:45:31 2016 +0200

    cleanup: move enums above structs etc.

diff --git a/cc1/cc1.h b/cc1/cc1.h
index d586d5d..58962f1 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
_AT_@ -4,100 +4,6 @@
 
 #define GLOBALCTX 0
 
-
-/*
- * Definition of structures
- */
-typedef struct type Type;
-typedef struct symbol Symbol;
-typedef struct swtch Switch;
-typedef struct node Node;
-typedef struct input Input;
-
-struct limits {
- union {
- TUINT i;
- TFLOAT f;
- } max;
- union {
- TUINT i;
- TFLOAT f;
- } min;
-};
-
-struct keyword {
- char *str;
- unsigned char token, value;
-};
-
-struct type {
- unsigned char op; /* type builder operator */
- char ns; /* namespace for struct members */
- short id; /* type id, used in dcls */
- char letter; /* letter of the type */
- unsigned char prop; /* type properties */
- unsigned long size; /* sizeof the type */
- unsigned char align; /* align of the type */
- Type *type; /* base type */
- Symbol *tag; /* symbol of the strug tag */
- Type *next; /* next element in the hash */
- union {
- Type **pars; /* Function type parameters */
- Symbol **fields; /* fields of aggregate type */
- } p;
- union {
- unsigned char rank; /* convertion rank */
- TINT elem; /* number of type parameters */
- } n;
-};
-
-struct symbol {
- char *name;
- Type *type;
- unsigned short id;
- unsigned char ctx;
- char ns;
- unsigned char token;
- short flags;
- union {
- TINT i;
- TUINT u;
- TFLOAT f;
- char *s;
- unsigned char token;
- Node **init;
- Symbol **pars;
- } u;
- struct symbol *next;
- struct symbol *hash;
-};
-
-struct node {
- unsigned char op;
- Type *type;
- Symbol *sym;
- char flags;
- struct node *left, *right;
-};
-
-struct swtch {
- short nr;
- char hasdef;
-};
-
-struct yystype {
- Symbol *sym;
- unsigned char token;
-};
-
-struct input {
- char *fname;
- FILE *fp;
- char *line, *begin, *p;
- struct input *next;
- unsigned short nline;
-};
-
 /*
  * Definition of enumerations
  */
_AT_@ -340,6 +246,99 @@ enum op {
         OINIT
 };
 
+/*
+ * Definition of structures
+ */
+typedef struct type Type;
+typedef struct symbol Symbol;
+typedef struct swtch Switch;
+typedef struct node Node;
+typedef struct input Input;
+
+struct limits {
+ union {
+ TUINT i;
+ TFLOAT f;
+ } max;
+ union {
+ TUINT i;
+ TFLOAT f;
+ } min;
+};
+
+struct keyword {
+ char *str;
+ unsigned char token, value;
+};
+
+struct type {
+ unsigned char op; /* type builder operator */
+ char ns; /* namespace for struct members */
+ short id; /* type id, used in dcls */
+ char letter; /* letter of the type */
+ unsigned int prop; /* type properties */
+ unsigned long size; /* sizeof the type */
+ unsigned char align; /* align of the type */
+ Type *type; /* base type */
+ Symbol *tag; /* symbol of the strug tag */
+ Type *next; /* next element in the hash */
+ union {
+ Type **pars; /* Function type parameters */
+ Symbol **fields; /* fields of aggregate type */
+ } p;
+ union {
+ unsigned char rank; /* convertion rank */
+ TINT elem; /* number of type parameters */
+ } n;
+};
+
+struct symbol {
+ char *name;
+ Type *type;
+ unsigned short id;
+ unsigned char ctx;
+ char ns;
+ unsigned char token;
+ short flags;
+ union {
+ TINT i;
+ TUINT u;
+ TFLOAT f;
+ char *s;
+ unsigned char token;
+ Node **init;
+ Symbol **pars;
+ } u;
+ struct symbol *next;
+ struct symbol *hash;
+};
+
+struct node {
+ unsigned char op;
+ Type *type;
+ Symbol *sym;
+ char flags;
+ struct node *left, *right;
+};
+
+struct swtch {
+ short nr;
+ char hasdef;
+};
+
+struct yystype {
+ Symbol *sym;
+ unsigned char token;
+};
+
+struct input {
+ char *fname;
+ FILE *fp;
+ char *line, *begin, *p;
+ struct input *next;
+ unsigned short nline;
+};
+
 /* error.c */
 extern void error(char *fmt, ...);
 extern void warn(char *fmt, ...);
Received on Fri May 20 2016 - 20:23:46 CEST

This archive was generated by hypermail 2.3.0 : Fri May 20 2016 - 20:24:14 CEST