Commit 55db9fe7 authored by Russ Cox's avatar Russ Cox

build: fix unused parameters

Found with gcc 4.6 -Wunused -Wextra
but should be applicable to Plan 9 too.

R=ken2
CC=golang-dev
https://golang.org/cl/4958044
parent 948418f1
...@@ -538,6 +538,8 @@ genembedtramp(Type *rcvr, Type *method, Sym *newnam, int iface) ...@@ -538,6 +538,8 @@ genembedtramp(Type *rcvr, Type *method, Sym *newnam, int iface)
Prog *p; Prog *p;
Type *f; Type *f;
USED(iface);
if(debug['r']) if(debug['r'])
print("genembedtramp %T %T %S\n", rcvr, method, newnam); print("genembedtramp %T %T %S\n", rcvr, method, newnam);
......
...@@ -80,6 +80,8 @@ gbranch(int as, Type *t) ...@@ -80,6 +80,8 @@ gbranch(int as, Type *t)
{ {
Prog *p; Prog *p;
USED(t);
p = prog(as); p = prog(as);
p->to.type = D_BRANCH; p->to.type = D_BRANCH;
p->to.branch = P; p->to.branch = P;
......
...@@ -337,6 +337,9 @@ cover(void) ...@@ -337,6 +337,9 @@ cover(void)
uvlong uvlong
rgetzero(Map *map, char *reg) rgetzero(Map *map, char *reg)
{ {
USED(map);
USED(reg);
return 0; return 0;
} }
......
...@@ -129,6 +129,8 @@ makeclosure(Node *func, NodeList **init, int nowrap) ...@@ -129,6 +129,8 @@ makeclosure(Node *func, NodeList **init, int nowrap)
static int closgen; static int closgen;
char *p; char *p;
USED(init);
/* /*
* wrap body in external function * wrap body in external function
* with extra closure parameters. * with extra closure parameters.
......
...@@ -115,6 +115,8 @@ dumpdcl(char *st) ...@@ -115,6 +115,8 @@ dumpdcl(char *st)
Sym *s, *d; Sym *s, *d;
int i; int i;
USED(st);
i = 0; i = 0;
for(d=dclstack; d!=S; d=d->link) { for(d=dclstack; d!=S; d=d->link) {
i++; i++;
......
...@@ -92,6 +92,8 @@ usage(void) ...@@ -92,6 +92,8 @@ usage(void)
void void
fault(int s) fault(int s)
{ {
USED(s);
// If we've already complained about things // If we've already complained about things
// in the program, don't bother complaining // in the program, don't bother complaining
// about the seg fault too; let the user clean up // about the seg fault too; let the user clean up
...@@ -446,6 +448,8 @@ importfile(Val *f, int line) ...@@ -446,6 +448,8 @@ importfile(Val *f, int line)
Strlit *path; Strlit *path;
char *cleanbuf; char *cleanbuf;
USED(line);
// TODO(rsc): don't bother reloading imports more than once? // TODO(rsc): don't bother reloading imports more than once?
if(f->ctype != CTSTR) { if(f->ctype != CTSTR) {
......
...@@ -1201,6 +1201,8 @@ makenewvar(Type *t, NodeList **init, Node **nstar) ...@@ -1201,6 +1201,8 @@ makenewvar(Type *t, NodeList **init, Node **nstar)
static Node* static Node*
ascompatee1(int op, Node *l, Node *r, NodeList **init) ascompatee1(int op, Node *l, Node *r, NodeList **init)
{ {
USED(op);
return convas(nod(OAS, l, r), init); return convas(nod(OAS, l, r), init);
} }
...@@ -1257,6 +1259,8 @@ ascompatet(int op, NodeList *nl, Type **nr, int fp, NodeList **init) ...@@ -1257,6 +1259,8 @@ ascompatet(int op, NodeList *nl, Type **nr, int fp, NodeList **init)
int ucount; int ucount;
NodeList *nn, *mm; NodeList *nn, *mm;
USED(op);
/* /*
* check assign type list to * check assign type list to
* a expression list. called in * a expression list. called in
......
...@@ -98,7 +98,10 @@ waitfor(int pid) ...@@ -98,7 +98,10 @@ waitfor(int pid)
int int
spawn(char *prog, char **argv) spawn(char *prog, char **argv)
{ {
int pid = fork(); int pid;
USED(prog);
pid = fork();
if(pid < 0) if(pid < 0)
sysfatal("fork: %r"); sysfatal("fork: %r");
if(pid == 0) { if(pid == 0) {
......
...@@ -1532,6 +1532,8 @@ arwrite(int fd, Armember *bp) ...@@ -1532,6 +1532,8 @@ arwrite(int fd, Armember *bp)
int int
page(Arfile *ap) page(Arfile *ap)
{ {
USED(ap);
sysfatal("page"); sysfatal("page");
return 1; return 1;
} }
......
...@@ -387,6 +387,8 @@ addtohistogram(uvlong pc, uvlong callerpc, uvlong sp) ...@@ -387,6 +387,8 @@ addtohistogram(uvlong pc, uvlong callerpc, uvlong sp)
int h; int h;
PC *x; PC *x;
USED(sp);
h = (pc + callerpc*101) % Ncounters; h = (pc + callerpc*101) % Ncounters;
for(x = counters[h]; x != NULL; x = x->next) { for(x = counters[h]; x != NULL; x = x->next) {
if(x->pc == pc && x->callerpc == callerpc) { if(x->pc == pc && x->callerpc == callerpc) {
...@@ -437,6 +439,8 @@ uvlong nextpc; ...@@ -437,6 +439,8 @@ uvlong nextpc;
void void
xptrace(Map *map, uvlong pc, uvlong sp, Symbol *sym) xptrace(Map *map, uvlong pc, uvlong sp, Symbol *sym)
{ {
USED(map);
char buf[1024]; char buf[1024];
if(sym == nil){ if(sym == nil){
fprint(2, "syms\n"); fprint(2, "syms\n");
......
...@@ -29,6 +29,7 @@ THE SOFTWARE. ...@@ -29,6 +29,7 @@ THE SOFTWARE.
int int
exitcode(char *s) exitcode(char *s)
{ {
USED(s);
return 1; return 1;
} }
...@@ -502,6 +502,8 @@ commonllp64(int unused, Fhdr *fp, ExecHdr *hp) ...@@ -502,6 +502,8 @@ commonllp64(int unused, Fhdr *fp, ExecHdr *hp)
int32 pgsize; int32 pgsize;
uvlong entry; uvlong entry;
USED(unused);
hswal(&hp->e, sizeof(Exec)/sizeof(int32), beswal); hswal(&hp->e, sizeof(Exec)/sizeof(int32), beswal);
if(!(hp->e.exechdr.magic & HDR_MAGIC)) if(!(hp->e.exechdr.magic & HDR_MAGIC))
return 0; return 0;
...@@ -542,6 +544,10 @@ commonllp64(int unused, Fhdr *fp, ExecHdr *hp) ...@@ -542,6 +544,10 @@ commonllp64(int unused, Fhdr *fp, ExecHdr *hp)
static int static int
mipsboot(int fd, Fhdr *fp, ExecHdr *hp) mipsboot(int fd, Fhdr *fp, ExecHdr *hp)
{ {
USED(fd);
USED(fp);
USED(hp);
abort(); abort();
#ifdef unused #ifdef unused
USED(fd); USED(fd);
...@@ -573,6 +579,10 @@ abort(); ...@@ -573,6 +579,10 @@ abort();
static int static int
mips4kboot(int fd, Fhdr *fp, ExecHdr *hp) mips4kboot(int fd, Fhdr *fp, ExecHdr *hp)
{ {
USED(fd);
USED(fp);
USED(hp);
abort(); abort();
#ifdef unused #ifdef unused
USED(fd); USED(fd);
...@@ -604,6 +614,10 @@ abort(); ...@@ -604,6 +614,10 @@ abort();
static int static int
sparcboot(int fd, Fhdr *fp, ExecHdr *hp) sparcboot(int fd, Fhdr *fp, ExecHdr *hp)
{ {
USED(fd);
USED(fp);
USED(hp);
abort(); abort();
#ifdef unused #ifdef unused
USED(fd); USED(fd);
...@@ -624,6 +638,10 @@ abort(); ...@@ -624,6 +638,10 @@ abort();
static int static int
nextboot(int fd, Fhdr *fp, ExecHdr *hp) nextboot(int fd, Fhdr *fp, ExecHdr *hp)
{ {
USED(fd);
USED(fp);
USED(hp);
abort(); abort();
#ifdef unused #ifdef unused
USED(fd); USED(fd);
...@@ -645,7 +663,6 @@ abort(); ...@@ -645,7 +663,6 @@ abort();
static int static int
elf64dotout(int fd, Fhdr *fp, ExecHdr *hp) elf64dotout(int fd, Fhdr *fp, ExecHdr *hp)
{ {
uvlong (*swav)(uvlong); uvlong (*swav)(uvlong);
uint32 (*swal)(uint32); uint32 (*swal)(uint32);
ushort (*swab)(ushort); ushort (*swab)(ushort);
......
...@@ -13,17 +13,17 @@ ...@@ -13,17 +13,17 @@
#include <mach.h> #include <mach.h>
#include "obj.h" #include "obj.h"
int _is2(char* x) { return 0; } int _is2(char* x) { USED(x); return 0; }
int _is7(char* x) { return 0; } int _is7(char* x) { USED(x); return 0; }
int _is9(char* x) { return 0; } int _is9(char* x) { USED(x); return 0; }
int _isk(char* x) { return 0; } int _isk(char* x) { USED(x); return 0; }
int _isq(char* x) { return 0; } int _isq(char* x) { USED(x); return 0; }
int _isv(char* x) { return 0; } int _isv(char* x) { USED(x); return 0; }
int _isu(char* x) { return 0; } int _isu(char* x) { USED(x); return 0; }
int _read2(Biobuf* b, Prog* p) { return 0; } int _read2(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
int _read7(Biobuf* b, Prog* p) { return 0; } int _read7(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
int _read9(Biobuf* b, Prog* p) { return 0; } int _read9(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
int _readk(Biobuf* b, Prog* p) { return 0; } int _readk(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
int _readq(Biobuf* b, Prog* p) { return 0; } int _readq(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
int _readv(Biobuf* b, Prog* p) { return 0; } int _readv(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
int _readu(Biobuf* b, Prog* p) { return 0; } int _readu(Biobuf* b, Prog* p) { USED(b); USED(p); return 0; }
...@@ -807,6 +807,8 @@ ptraceerr: ...@@ -807,6 +807,8 @@ ptraceerr:
static int static int
ptracesegrw(Map *map, Seg *seg, uvlong addr, void *v, uint n, int isr) ptracesegrw(Map *map, Seg *seg, uvlong addr, void *v, uint n, int isr)
{ {
USED(seg);
return ptracerw(isr ? PTRACE_PEEKDATA : PTRACE_POKEDATA, PTRACE_PEEKDATA, return ptracerw(isr ? PTRACE_PEEKDATA : PTRACE_POKEDATA, PTRACE_PEEKDATA,
isr, map->pid, addr, v, n); isr, map->pid, addr, v, n);
} }
...@@ -938,6 +940,8 @@ ptraceregrw(Map *map, Seg *seg, uvlong addr, void *v, uint n, int isr) ...@@ -938,6 +940,8 @@ ptraceregrw(Map *map, Seg *seg, uvlong addr, void *v, uint n, int isr)
int laddr; int laddr;
uvlong u; uvlong u;
USED(seg);
if((laddr = go2linux(addr)) < 0){ if((laddr = go2linux(addr)) < 0){
if(isr){ if(isr){
memset(v, 0, n); memset(v, 0, n);
......
...@@ -138,6 +138,8 @@ fdrw(Map *map, Seg *s, uvlong addr, void *v, uint n, int isread) ...@@ -138,6 +138,8 @@ fdrw(Map *map, Seg *s, uvlong addr, void *v, uint n, int isread)
{ {
int tot, m; int tot, m;
USED(map);
for(tot=0; tot<n; tot+=m){ for(tot=0; tot<n; tot+=m){
if(isread) if(isread)
m = pread(s->fd, (uchar*)v+tot, n-tot, addr+tot); m = pread(s->fd, (uchar*)v+tot, n-tot, addr+tot);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment