mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-06 09:17:25 +00:00
Remove unused variables. Lowercase err() strings.
This commit is contained in:
parent
997485f93c
commit
07e1d533fd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=29849
@ -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 <mpp@FreeBSD.org>.
|
||||
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 .
|
||||
|
@ -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 <err.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <termios.h>
|
||||
#include <machine/console.h>
|
||||
#include <sys/types.h>
|
||||
@ -58,9 +62,8 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#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 <port> -t <mousetype>\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"
|
||||
" <mousetype> 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 <port> -t <mousetype>");
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user