mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
Cleanup code to make it WARNS=6 clean:
- ANSIfy prototypes; - Add __unused for parameters that is not being currently used; - Add a header for subrountines being called from other modules. Reviewed by: mjacob
This commit is contained in:
parent
8fa0490a2e
commit
2804a96a50
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=198934
@ -47,9 +47,7 @@
|
||||
#define BADSTAT \
|
||||
(SES_ENCSTAT_UNRECOV|SES_ENCSTAT_CRITICAL|SES_ENCSTAT_NONCRITICAL)
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
int fd, delay, dev;
|
||||
ses_encstat stat, *carray;
|
||||
|
@ -38,9 +38,10 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include SESINC
|
||||
|
||||
#include "eltsub.h"
|
||||
|
||||
char *
|
||||
geteltnm(type)
|
||||
int type;
|
||||
geteltnm(int type)
|
||||
{
|
||||
static char rbuf[132];
|
||||
|
||||
@ -116,8 +117,7 @@ geteltnm(type)
|
||||
}
|
||||
|
||||
static char *
|
||||
scode2ascii(code)
|
||||
u_char code;
|
||||
scode2ascii(u_char code)
|
||||
{
|
||||
static char rbuf[32];
|
||||
switch (code & 0xf) {
|
||||
@ -154,9 +154,7 @@ scode2ascii(code)
|
||||
|
||||
|
||||
char *
|
||||
stat2ascii(eletype, cstat)
|
||||
int eletype;
|
||||
u_char *cstat;
|
||||
stat2ascii(int eletype __unused, u_char *cstat)
|
||||
{
|
||||
static char ebuf[256], *scode;
|
||||
|
||||
|
36
share/examples/ses/srcs/eltsub.h
Normal file
36
share/examples/ses/srcs/eltsub.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* $FreeBSD$ */
|
||||
/*
|
||||
* Copyright (c) 2000 by Matthew Jacob
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification, immediately at the beginning of the file.
|
||||
* 2. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* the GNU Public License ("GPL").
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
|
||||
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* Matthew Jacob
|
||||
* Feral Software
|
||||
* mjacob@feral.com
|
||||
*/
|
||||
|
||||
char * geteltnm(int);
|
||||
char * stat2ascii(int, u_char *);
|
@ -40,13 +40,10 @@
|
||||
#include <fcntl.h>
|
||||
#include SESINC
|
||||
|
||||
extern char *geteltnm __P((int));
|
||||
extern char *stat2ascii __P((int, u_char *));
|
||||
#include "eltsub.h"
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
ses_object *objp;
|
||||
ses_objstat ob;
|
||||
|
@ -41,9 +41,7 @@
|
||||
#include SESINC
|
||||
|
||||
int
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
unsigned int nobj;
|
||||
int fd;
|
||||
|
@ -39,12 +39,10 @@
|
||||
#include <sys/ioctl.h>
|
||||
#include SESINC
|
||||
|
||||
extern char *geteltnm __P((int));
|
||||
#include "eltsub.h"
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
ses_object *objp;
|
||||
int nobj, fd, i;
|
||||
|
@ -39,9 +39,7 @@
|
||||
#include SESINC
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
int fd;
|
||||
int i;
|
||||
|
@ -40,9 +40,7 @@
|
||||
#include SESINC
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
int fd;
|
||||
|
||||
|
@ -49,13 +49,11 @@
|
||||
*/
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
static char *usage =
|
||||
static const char *usage =
|
||||
"usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n";
|
||||
int fd, polltime, dev, devbase, nodaemon, bpri;
|
||||
int fd, polltime, dev, devbase, nodaemon;
|
||||
ses_encstat stat, *carray;
|
||||
|
||||
if (a < 2) {
|
||||
@ -115,7 +113,6 @@ main(a, v)
|
||||
|
||||
for (;;) {
|
||||
for (dev = devbase; dev < a; dev++) {
|
||||
char buf[128];
|
||||
fd = open(v[dev], O_RDWR);
|
||||
if (fd < 0) {
|
||||
syslog(LOG_ERR, "%s: %m", v[dev]);
|
||||
|
@ -40,9 +40,7 @@
|
||||
#include SESINC
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
int fd;
|
||||
long val;
|
||||
|
@ -40,9 +40,7 @@
|
||||
#include SESINC
|
||||
|
||||
int
|
||||
main(a, v)
|
||||
int a;
|
||||
char **v;
|
||||
main(int a, char **v)
|
||||
{
|
||||
int fd;
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user