1
0
mirror of https://github.com/golang/go synced 2024-11-24 12:10:03 -07:00

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
This commit is contained in:
Russ Cox 2011-08-25 16:08:13 -04:00
parent 948418f16a
commit 55db9fe730
15 changed files with 68 additions and 16 deletions

View File

@ -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);

View File

@ -79,6 +79,8 @@ Prog*
gbranch(int as, Type *t)
{
Prog *p;
USED(t);
p = prog(as);
p->to.type = D_BRANCH;

View File

@ -337,6 +337,9 @@ cover(void)
uvlong
rgetzero(Map *map, char *reg)
{
USED(map);
USED(reg);
return 0;
}

View File

@ -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.

View File

@ -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++;

View File

@ -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) {

View File

@ -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

View File

@ -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) {

View File

@ -1532,6 +1532,8 @@ arwrite(int fd, Armember *bp)
int
page(Arfile *ap)
{
USED(ap);
sysfatal("page");
return 1;
}

View File

@ -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");

View File

@ -29,6 +29,7 @@ THE SOFTWARE.
int
exitcode(char *s)
{
USED(s);
return 1;
}

View File

@ -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);

View File

@ -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; }

View File

@ -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){

View File

@ -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)