From 07e1d533fd079c30d8666f30e85b8a3256841d5b Mon Sep 17 00:00:00 2001 From: Philippe Charnier Date: Thu, 25 Sep 1997 06:44:39 +0000 Subject: [PATCH] Remove unused variables. Lowercase err() strings. --- usr.sbin/moused/moused.8 | 12 +++++--- usr.sbin/moused/moused.c | 60 ++++++++++++++-------------------------- 2 files changed, 29 insertions(+), 43 deletions(-) diff --git a/usr.sbin/moused/moused.8 b/usr.sbin/moused/moused.8 index 1cd413879da7..1115babf90e4 100644 --- a/usr.sbin/moused/moused.8 +++ b/usr.sbin/moused/moused.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $Id: moused.8,v 1.4 1997/07/25 13:21:35 wosch Exp $ +.\" $Id: moused.8,v 1.5 1997/07/27 23:10:33 wosch Exp $ .\" .Dd December 16, 1996 .Dt MOUSED 8 @@ -110,10 +110,14 @@ for a microsoft mouse and enable the mousepointer. .Sh AUTHORS The .Nm -command was written by Michael Smith. This manual page -was written by Mike Pritchard . +command was written by +.An Michael Smith . + +This manual page +was written by +.An Mike Pritchard Aq mpp@FreeBSD.org . .Sh HISTORY The -.Nm moused +.Nm command first appeared in .Fx 2.2 . diff --git a/usr.sbin/moused/moused.c b/usr.sbin/moused/moused.c index f05c77a82d46..5e4abda3f53b 100644 --- a/usr.sbin/moused/moused.c +++ b/usr.sbin/moused/moused.c @@ -29,8 +29,6 @@ ** OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, ** EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** - ** - ** $Id: moused.c,v 1.8 1997/03/29 12:10:26 peter Exp $ **/ /** @@ -45,12 +43,18 @@ ** **/ +#ifndef lint +static const char rcsid[] = + "$Id$"; +#endif /* not lint */ + +#include +#include +#include +#include #include #include #include -#include -#include -#include #include #include #include @@ -58,9 +62,8 @@ #include #define debug(fmt,args...) \ - if (debug&&nodaemon) fprintf(stderr,"%s: " fmt "\n", progname, ##args) + if (debug&&nodaemon) warnx(fmt, ##args) -char *progname; int debug = 0; int nodaemon = 0; @@ -150,13 +153,9 @@ main(int argc, char *argv[]) int c,i,cfd; u_char b; ACTIVITY *act; - struct termios t; struct mouse_info mouse; - int saved_buttons = 0; fd_set fds; - progname = argv[0]; - while((c = getopt(argc,argv,"cdfr:sp:t:h?RDS:")) != -1) switch(c) { @@ -229,13 +228,13 @@ main(int argc, char *argv[]) default: if (rodent.portname) break; - warnx("No port name specified"); + warnx("no port name specified"); usage(); } if ((rodent.mfd = open(rodent.portname, O_RDWR, 0)) == -1) { - warn("Can't open %s",rodent.portname); + warn("can't open %s",rodent.portname); usage(); } r_init(); /* call init function */ @@ -269,7 +268,7 @@ main(int argc, char *argv[]) mouse.u.data.y = act->dy; mouse.u.data.buttons = act->buttons; ioctl(cfd, CONS_MOUSECTL, &mouse); - debug("Activity : buttons 0x%02x dx %d dy %d", + debug("activity : buttons 0x%02x dx %d dy %d", act->buttons,act->dx,act->dy); } } @@ -284,26 +283,9 @@ main(int argc, char *argv[]) void usage(void) { - fprintf(stderr, - " Usage is %s [options] -p -t \n" - " Options are -s Select 9600 baud mouse.\n" - " -f Don't become a daemon\n" - " -d Enable debugging messages\n" - " -c Enable ChordMiddle option\n" - " -R Lower RTS\n" - " -D Lower DTR\n" - " -S baud Select explicit baud (1200..9600).\n" - " should be one of :\n" - " microsoft\n" - " mousesystems\n" - " mmseries\n" - " logitech\n" - " busmouse\n" - " mouseman\n" - " ps/2\n" - " mmhittab\n" - ,progname); - + fprintf(stderr, "%s\n%s\n", + "usage: moused [-DRcdfs] [-r samplerate] [-S baudrate]", + " -p -t "); exit(1); } @@ -565,7 +547,7 @@ r_protocol(u_char rBuf) * assembly full package */ - debug("Assembled full packet (len %d) %x,%x,%x,%x,%x", + debug("assembled full packet (len %d) %x,%x,%x,%x,%x", proto[rodent.rtype][4], pBuf[0],pBuf[1],pBuf[2],pBuf[3],pBuf[4]); switch(rodent.rtype) @@ -660,7 +642,7 @@ unsigned cflag; if (tcgetattr(rodent.mfd, &tty) < 0) { - err(1, "Warning: unable to get status of mouse fd"); + err(1, "warning: unable to get status of mouse fd"); } tty.c_iflag = IGNBRK | IGNPAR; @@ -692,7 +674,7 @@ unsigned cflag; if (tcsetattr(rodent.mfd, TCSADRAIN, &tty) < 0) { - err(1, "Unable to set status of mouse fd"); + err(1, "unable to set status of mouse fd"); } switch (new) @@ -723,13 +705,13 @@ unsigned cflag; { if (write(rodent.mfd, c, 2) != 2) { - err(1, "Unable to write to mouse fd"); + err(1, "unable to write to mouse fd"); } } usleep(100000); if (tcsetattr(rodent.mfd, TCSADRAIN, &tty) < 0) { - err(1,"Unable to set status of mouse fd"); + err(1,"unable to set status of mouse fd"); } }