commit 052d45077e5008befb2a3fefeaecaa49b4b38ed6
parent 98effae319f860ea2684b5a0709d2da923145f38
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 10 May 2016 19:36:12 +0200
remove unused variables
Diffstat:
12 files changed, 6 insertions(+), 22 deletions(-)
diff --git a/cc1/code.c b/cc1/code.c
@@ -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 *),
@@ -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:
@@ -241,7 +237,6 @@ static void
emittype(Type *tp)
{
TINT n;
- Type **vp;
Symbol **sp;
char *tag;
@@ -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
@@ -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('(');
@@ -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
@@ -56,7 +56,6 @@ promote(Node *np)
{
Type *tp;
Node *new;
- unsigned r;
struct limits *lim, *ilim;
tp = np->type;
@@ -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
@@ -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
@@ -51,7 +51,6 @@ arydesig(Init *ip)
static TINT
fielddesig(Init *ip)
{
- TINT npos;
int ons;
Symbol *sym, **p;
Type *tp = ip->type;
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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,