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