Make this WARNS=6 clean by:
- declaring 'mode2str' as returning a 'const char *' - prototyping all function - rename the argument 'version' to 'ver', not to shadow the now prototyped function 'version'. Also mark it as WARNS?= 6 clean to try to keep it clean. Tested by: make universe (including amd64)
This commit is contained in:
parent
25a5b3324b
commit
8fb7e78565
@ -2,5 +2,6 @@
|
||||
|
||||
PROG= atacontrol
|
||||
MAN= atacontrol.8
|
||||
WARNS?= 6
|
||||
|
||||
.include <bsd.prog.mk>
|
||||
|
@ -40,7 +40,16 @@
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
|
||||
char *
|
||||
const char *mode2str(int mode);
|
||||
int str2mode(char *str);
|
||||
void usage(void);
|
||||
int version(int ver);
|
||||
void param_print(struct ata_params *parm);
|
||||
void cap_print(struct ata_params *parm);
|
||||
int ata_cap_print(int fd, int channel, int device);
|
||||
int info_print(int fd, int channel, int prchan);
|
||||
|
||||
const char *
|
||||
mode2str(int mode)
|
||||
{
|
||||
switch (mode) {
|
||||
@ -91,14 +100,14 @@ usage()
|
||||
}
|
||||
|
||||
int
|
||||
version(int version)
|
||||
version(int ver)
|
||||
{
|
||||
int bit;
|
||||
|
||||
if (version == 0xffff)
|
||||
if (ver == 0xffff)
|
||||
return 0;
|
||||
for (bit = 15; bit >= 0; bit--)
|
||||
if (version & (1<<bit))
|
||||
if (ver & (1<<bit))
|
||||
return bit;
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user