Date: Tue, 3 May 2011 04:44:51 +0000 (UTC) From: Craig Rodrigues <rodrigc@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r221358 - head/lib/libstand Message-ID: <201105030444.p434ipEj069845@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rodrigc Date: Tue May 3 04:44:50 2011 New Revision: 221358 URL: http://svn.freebsd.org/changeset/base/221358 Log: Switch to ANSI function prototypes in a few places. Get rid of some unused parameter warnings. Modified: head/lib/libstand/__main.c head/lib/libstand/bswap.c head/lib/libstand/cd9660.c head/lib/libstand/environment.c head/lib/libstand/getopt.c head/lib/libstand/tftp.c Modified: head/lib/libstand/__main.c ============================================================================== --- head/lib/libstand/__main.c Tue May 3 01:55:27 2011 (r221357) +++ head/lib/libstand/__main.c Tue May 3 04:44:50 2011 (r221358) @@ -38,6 +38,6 @@ __FBSDID("$FreeBSD$"); void __main(void); void -__main() +__main(void) { } Modified: head/lib/libstand/bswap.c ============================================================================== --- head/lib/libstand/bswap.c Tue May 3 01:55:27 2011 (r221357) +++ head/lib/libstand/bswap.c Tue May 3 04:44:50 2011 (r221358) @@ -16,9 +16,11 @@ static char *rcsid = "$NetBSD: bswap64.c #undef bswap32 #undef bswap64 +u_int32_t bswap32(u_int32_t x); +u_int64_t bswap64(u_int64_t x); + u_int32_t -bswap32(x) - u_int32_t x; +bswap32(u_int32_t x) { return ((x << 24) & 0xff000000 ) | ((x << 8) & 0x00ff0000 ) | @@ -27,8 +29,7 @@ bswap32(x) } u_int64_t -bswap64(x) - u_int64_t x; +bswap64(u_int64_t x) { u_int32_t *p = (u_int32_t*)&x; u_int32_t t; Modified: head/lib/libstand/cd9660.c ============================================================================== --- head/lib/libstand/cd9660.c Tue May 3 01:55:27 2011 (r221357) +++ head/lib/libstand/cd9660.c Tue May 3 04:44:50 2011 (r221358) @@ -545,7 +545,7 @@ again: } static int -cd9660_write(struct open_file *f, void *start, size_t size, size_t *resid) +cd9660_write(struct open_file *f __unused, void *start __unused, size_t size __unused, size_t *resid __unused) { return EROFS; } Modified: head/lib/libstand/environment.c ============================================================================== --- head/lib/libstand/environment.c Tue May 3 01:55:27 2011 (r221357) +++ head/lib/libstand/environment.c Tue May 3 04:44:50 2011 (r221358) @@ -207,13 +207,14 @@ env_discard(struct env_var *ev) } int -env_noset(struct env_var *ev, int flags, const void *value) +env_noset(struct env_var *ev __unused, int flags __unused, + const void *value __unused) { return(EPERM); } int -env_nounset(struct env_var *ev) +env_nounset(struct env_var *ev __unused) { return(EPERM); } Modified: head/lib/libstand/getopt.c ============================================================================== --- head/lib/libstand/getopt.c Tue May 3 01:55:27 2011 (r221357) +++ head/lib/libstand/getopt.c Tue May 3 04:44:50 2011 (r221358) @@ -52,10 +52,7 @@ char *optarg; /* argument associated wi * Parse argc/argv argument vector. */ int -getopt(nargc, nargv, ostr) - int nargc; - char * const *nargv; - const char *ostr; +getopt(int nargc, char * const *nargv, const char *ostr) { static char *place = EMSG; /* option letter processing */ char *oli; /* option letter list index */ Modified: head/lib/libstand/tftp.c ============================================================================== --- head/lib/libstand/tftp.c Tue May 3 01:55:27 2011 (r221357) +++ head/lib/libstand/tftp.c Tue May 3 04:44:50 2011 (r221358) @@ -110,11 +110,7 @@ static const int tftperrors[8] = { }; static ssize_t -recvtftp(d, pkt, len, tleft) - struct iodesc *d; - void *pkt; - ssize_t len; - time_t tleft; +recvtftp(struct iodesc *d, void *pkt, ssize_t len, time_t tleft) { struct tftphdr *t; @@ -168,8 +164,7 @@ recvtftp(d, pkt, len, tleft) /* send request, expect first block (or error) */ static int -tftp_makereq(h) - struct tftp_handle *h; +tftp_makereq(struct tftp_handle *h) { struct { u_char header[HEADER_SIZE]; @@ -212,8 +207,7 @@ tftp_makereq(h) /* ack block, expect next */ static int -tftp_getnextblock(h) - struct tftp_handle *h; +tftp_getnextblock(struct tftp_handle *h) { struct { u_char header[HEADER_SIZE]; @@ -246,9 +240,7 @@ tftp_getnextblock(h) } static int -tftp_open(path, f) - const char *path; - struct open_file *f; +tftp_open(const char *path, struct open_file *f) { struct tftp_handle *tftpfile; struct iodesc *io; @@ -287,11 +279,8 @@ tftp_open(path, f) } static int -tftp_read(f, addr, size, resid) - struct open_file *f; - void *addr; - size_t size; - size_t *resid; /* out */ +tftp_read(struct open_file *f, void *addr, size_t size, + size_t *resid /* out */) { struct tftp_handle *tftpfile; static int tc = 0; @@ -361,8 +350,7 @@ tftp_read(f, addr, size, resid) } static int -tftp_close(f) - struct open_file *f; +tftp_close(struct open_file *f) { struct tftp_handle *tftpfile; tftpfile = (struct tftp_handle *) f->f_fsdata; @@ -377,19 +365,14 @@ tftp_close(f) } static int -tftp_write(f, start, size, resid) - struct open_file *f; - void *start; - size_t size; - size_t *resid; /* out */ +tftp_write(struct open_file *f __unused, void *start __unused, size_t size __unused, + size_t *resid /* out */ __unused) { return (EROFS); } static int -tftp_stat(f, sb) - struct open_file *f; - struct stat *sb; +tftp_stat(struct open_file *f, struct stat *sb) { struct tftp_handle *tftpfile; tftpfile = (struct tftp_handle *) f->f_fsdata; @@ -403,10 +386,7 @@ tftp_stat(f, sb) } static off_t -tftp_seek(f, offset, where) - struct open_file *f; - off_t offset; - int where; +tftp_seek(struct open_file *f, off_t offset, int where) { struct tftp_handle *tftpfile; tftpfile = (struct tftp_handle *) f->f_fsdata;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105030444.p434ipEj069845>