Mark global functions and/or variables in fdread(8) static where possible.

This allows compilers and static analyzers to do more thorough analysis.
This commit is contained in:
Ed Schouten 2011-11-06 19:01:54 +00:00
parent e8f386b409
commit d938340a93

View File

@ -44,14 +44,14 @@
#include "fdutil.h" #include "fdutil.h"
int quiet, recover; static int quiet, recover;
unsigned char fillbyte = 0xf0; /* "foo" */ static unsigned char fillbyte = 0xf0; /* "foo" */
int doread(int fd, FILE *of, const char *_devname); static int doread(int fd, FILE *of, const char *_devname);
int doreadid(int fd, unsigned int numids, unsigned int trackno); static int doreadid(int fd, unsigned int numids, unsigned int trackno);
void usage(void); static void usage(void);
void static void
usage(void) usage(void)
{ {
@ -155,7 +155,7 @@ main(int argc, char **argv)
return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname)); return (numids? doreadid(fd, numids, trackno): doread(fd, of, _devname));
} }
int static int
doread(int fd, FILE *of, const char *_devname) doread(int fd, FILE *of, const char *_devname)
{ {
char *trackbuf; char *trackbuf;
@ -294,7 +294,7 @@ doread(int fd, FILE *of, const char *_devname)
return (nerrs? EX_IOERR: EX_OK); return (nerrs? EX_IOERR: EX_OK);
} }
int static int
doreadid(int fd, unsigned int numids, unsigned int trackno) doreadid(int fd, unsigned int numids, unsigned int trackno)
{ {
int rv = 0; int rv = 0;