]> Cypherpunks repositories - gostls13.git/commitdiff
build: fix unused parameters
authorRuss Cox <rsc@golang.org>
Thu, 25 Aug 2011 20:08:13 +0000 (16:08 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 25 Aug 2011 20:08:13 +0000 (16:08 -0400)
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

15 files changed:
src/cmd/6g/gobj.c
src/cmd/6g/gsubr.c
src/cmd/cov/main.c
src/cmd/gc/closure.c
src/cmd/gc/dcl.c
src/cmd/gc/lex.c
src/cmd/gc/walk.c
src/cmd/godefs/main.c
src/cmd/gopack/ar.c
src/cmd/prof/main.c
src/lib9/exitcode.c
src/libmach/executable.c
src/libmach/fakeobj.c
src/libmach/linux.c
src/libmach/map.c

index ba8a4870ecbadf60d990d97808750a5207814006..5e57568c3ec83f208f298ee21375b8b18aa10c71 100644 (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);
index d0d6d0c96d594ba7c10a58bbae1749478999d764..88c7b132a1f80580ba15069baca9fb2d57a9bbd9 100644 (file)
@@ -79,6 +79,8 @@ Prog*
 gbranch(int as, Type *t)
 {
        Prog *p;
+       
+       USED(t);
 
        p = prog(as);
        p->to.type = D_BRANCH;
index 5ff22c00a3499de5dedd978af2402bd2d08c810d..ecbabf371ecc7d617e9c59d267dc896ef1282c54 100644 (file)
@@ -337,6 +337,9 @@ cover(void)
 uvlong
 rgetzero(Map *map, char *reg)
 {
+       USED(map);
+       USED(reg);
+
        return 0;
 }
 
index 1261eefb7d64adba70156c1e3c2a5eae0cf81abe..7b21bf3ab19f1a1d894a5152b8268e40366c1b0b 100644 (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.
index 5f1ff63cfe950dec30c2ed930b2d784d5a605041..0c593dac4500466f575e448bc2f717862701aab6 100644 (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++;
index 18ca55d82eb13727b16415d405d5b940be13de7b..77667579fb2be36fa2798cf3720a70b03b69209d 100644 (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) {
index 9cd4ee919ce90866f1050f460ed69d24abb4bbd7..3a26b3988a5a35e91f187ac5a9ae06fe30c4a729 100644 (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
index 6a863017951a92f2db77fc47ef74e39fe7991084..38b2962facc973d0ef6dec334085484775c5181d 100644 (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) {
index 0b5e608c744802bafbfa86a0333a283dbe4e49a4..96f36605fdbb01ef87bc8daf3a846a8c7ca64f9c 100644 (file)
@@ -1532,6 +1532,8 @@ arwrite(int fd, Armember *bp)
 int
 page(Arfile *ap)
 {
+       USED(ap);
+
        sysfatal("page");
        return 1;
 }
index f36759cd32d581017279bbf037b5b2136e9b86b5..f0acaf1c07850f1448f16125400f21704b9d9a0f 100644 (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");
index 234492acfc28d56220587349da1b304cec2b03f3..a952b2da29dc9656f7be243d8407761950709b5f 100644 (file)
@@ -29,6 +29,7 @@ THE SOFTWARE.
 int
 exitcode(char *s)
 {
+       USED(s);
        return 1;
 }
 
index e90334438198648c6b5ca0779e5eb7223f2a65d7..1ad6e3b5d29e093a2a296399c363448f26fa77e2 100644 (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);
index ea7ef012cf652f54fb537c8d018ba958dc67d77b..a4a897cfe7580e43f64333fb23eab74aa2cabb78 100644 (file)
 #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; }
index 6ce18957fa71ebf8184601d96e16687fc8e972f9..2c143266a8dc4077686f1ef22fda6c58b3ff177f 100644 (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){
index ebfe03702704e76d5c217ad07b4bc96bd9a2f771..cd5ef0985bf21884b9c8baeb42d1ebf193665428 100644 (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)