[hackers] [scc] remove unused variables || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Tue, 10 May 2016 19:46:34 +0200 (CEST)

commit 052d45077e5008befb2a3fefeaecaa49b4b38ed6
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Tue May 10 19:36:12 2016 +0200
Commit: Roberto E. Vargas Caballero <Roberto E. Vargas Caballero>
CommitDate: Mon May 9 17:56:23 2016 +0200

    remove unused variables

diff --git a/cc1/code.c b/cc1/code.c
index fa50a7f..e175fdd 100644
--- a/cc1/code.c
+++ b/cc1/code.c
_AT_@ -9,9 +9,7 @@
 #include "cc1.h"
 
 static void emitbin(unsigned, void *),
- emitswitcht(unsigned, void *),
             emitcast(unsigned, void *),
- emitswitch(unsigned, void *),
             emitsym(unsigned, void *),
             emitexp(unsigned, void *),
             emitsymid(unsigned, void *),
_AT_@ -188,11 +186,9 @@ emitvar(Symbol *sym)
 static void
 emitconst(Node *np)
 {
- char *bp, c;
         Symbol *sym = np->sym;
         Type *tp = np->type;
         TUINT u;
- size_t n;
 
         switch (tp->op) {
         case PTR:
_AT_@ -241,7 +237,6 @@ static void
 emittype(Type *tp)
 {
         TINT n;
- Type **vp;
         Symbol **sp;
         char *tag;
 
_AT_@ -291,7 +286,7 @@ emitstring(Symbol *sym, Type *tp)
         char *bp, *s, *lim;
         int n;
 
- bp = bp = sym->u.s;
+ bp = sym->u.s;
         lim = &sym->u.s[tp->n.elem];
         while (bp < lim) {
                 s = bp;
diff --git a/cc1/decl.c b/cc1/decl.c
index 3ee3cf4..0d87c62 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
_AT_@ -283,7 +283,6 @@ fundcl(struct declarators *dp)
         Symbol *syms[NR_FUNPARAM+1], **pars;
         int k_r, ntypes, nsyms;
         size_t size;
- void (*fp)(Type **, Symbol **, int *, int *);
 
         pushctx();
         expect('(');
_AT_@ -367,7 +366,7 @@ static Type *
 specifier(int *sclass, int *qualifier)
 {
         Type *tp = NULL;
- int spec, qlf, sign, type, cls, size, mask;
+ int spec, qlf, sign, type, cls, size;
 
         spec = qlf = sign = type = cls = size = 0;
 
diff --git a/cc1/expr.c b/cc1/expr.c
index bbd3385..60a78ee 100644
--- a/cc1/expr.c
+++ b/cc1/expr.c
_AT_@ -56,7 +56,6 @@ promote(Node *np)
 {
         Type *tp;
         Node *new;
- unsigned r;
         struct limits *lim, *ilim;
 
         tp = np->type;
_AT_@ -85,7 +84,7 @@ promote(Node *np)
 static void
 arithconv(Node **p1, Node **p2)
 {
- int n, to = 0, s1, s2;
+ int to = 0, s1, s2;
         unsigned r1, r2;
         Type *tp1, *tp2;
         Node *np1, *np2;
diff --git a/cc1/fold.c b/cc1/fold.c
index dfcfa05..bebe0dd 100644
--- a/cc1/fold.c
+++ b/cc1/fold.c
_AT_@ -383,7 +383,7 @@ commutative(int *op, Node **lp, Node **rp)
 static Node *
 identity(int *op, Node *lp, Node *rp)
 {
- int iszeror, isoner, istruer, val;
+ int iszeror, isoner, istruer;
         int iszerol, isonel, istruel;
 
         if (!rp)
diff --git a/cc1/init.c b/cc1/init.c
index 9245ec8..09ceaf5 100644
--- a/cc1/init.c
+++ b/cc1/init.c
_AT_@ -51,7 +51,6 @@ arydesig(Init *ip)
 static TINT
 fielddesig(Init *ip)
 {
- TINT npos;
         int ons;
         Symbol *sym, **p;
         Type *tp = ip->type;
_AT_@ -79,7 +78,6 @@ fielddesig(Init *ip)
 static Init *
 designation(Init *ip)
 {
- struct designator *dp;
         TINT (*fun)(Init *);
 
         switch (yytoken) {
diff --git a/cc1/symbol.c b/cc1/symbol.c
index 8d540a4..6d8cfcc 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
_AT_@ -102,8 +102,6 @@ void
 popctx(void)
 {
         Symbol *next, *sym;
- char *name;
- short f;
 
         if (--curctx == GLOBALCTX) {
                 for (sym = labels; sym; sym = next) {
diff --git a/cc2/arch/amd64-sysv/code.c b/cc2/arch/amd64-sysv/code.c
index 368dfbf..6f66ee5 100644
--- a/cc2/arch/amd64-sysv/code.c
+++ b/cc2/arch/amd64-sysv/code.c
_AT_@ -34,7 +34,6 @@ static char *
 symname(Symbol *sym)
 {
         static char name[IDENTSIZ+1];
- static unsigned short id;
 
         if (sym->name) {
                 switch (sym->kind) {
diff --git a/cc2/arch/i386-sysv/code.c b/cc2/arch/i386-sysv/code.c
index b58a7f1..657f422 100644
--- a/cc2/arch/i386-sysv/code.c
+++ b/cc2/arch/i386-sysv/code.c
_AT_@ -34,7 +34,6 @@ static char *
 symname(Symbol *sym)
 {
         static char name[IDENTSIZ+1];
- static unsigned short id;
 
         if (sym->name) {
                 switch (sym->kind) {
diff --git a/cc2/arch/qbe/code.c b/cc2/arch/qbe/code.c
index 7cdf575..b48abef 100644
--- a/cc2/arch/qbe/code.c
+++ b/cc2/arch/qbe/code.c
_AT_@ -157,7 +157,6 @@ sigil(Symbol *sym)
 static char *
 symname(Symbol *sym)
 {
- static unsigned id;
         char c = sigil(sym);
 
         if (sym->name) {
diff --git a/cc2/arch/z80/code.c b/cc2/arch/z80/code.c
index cb22dac..9899bc5 100644
--- a/cc2/arch/z80/code.c
+++ b/cc2/arch/z80/code.c
_AT_@ -35,7 +35,6 @@ static char *
 symname(Symbol *sym)
 {
         static char name[IDENTSIZ+1];
- static unsigned short id;
 
         if (sym->name) {
                 switch (sym->kind) {
diff --git a/cc2/node.c b/cc2/node.c
index deadbe8..4120869 100644
--- a/cc2/node.c
+++ b/cc2/node.c
_AT_@ -20,7 +20,6 @@ struct arena {
 
 static struct arena *arena;
 static Node *freep;
-static int inhome;
 
 Node *
 newnode(int op)
diff --git a/cc2/parser.c b/cc2/parser.c
index de3bb0b..fdc1513 100644
--- a/cc2/parser.c
+++ b/cc2/parser.c
_AT_@ -32,8 +32,8 @@ union tokenop {
 
 typedef void parsefun(char *, union tokenop);
 static parsefun type, symbol, getname, unary, binary, ternary, call,
- parameter, constant, composed, binit, einit,
- jump, oreturn, loop, assign, ocase, casetbl;
+ constant, composed, binit, einit,
+ jump, oreturn, loop, assign, casetbl;
 
 typedef void evalfun(void);
 static evalfun vardecl, beginfun, endfun, endpars, stmt,
Received on Tue May 10 2016 - 19:46:34 CEST

This archive was generated by hypermail 2.3.0 : Tue May 10 2016 - 19:48:12 CEST