p5: fix [-Wunused-but-set-variable] compiler warnings

merge-requests/1/head
Olaf Meeuwissen 2015-12-26 14:56:12 +09:00
rodzic f9e4496380
commit 572e61d39a
1 zmienionych plików z 12 dodań i 12 usunięć

Wyświetl plik

@ -214,19 +214,19 @@ read_data (int fd, uint8_t * data, int length)
static void static void
index_write_data (int fd, uint8_t index, uint8_t * data, int length) index_write_data (int fd, uint8_t index, uint8_t * data, int length)
{ {
int mode, rc; int mode;
unsigned char bval; unsigned char bval;
bval = index; bval = index;
mode = IEEE1284_MODE_EPP | IEEE1284_ADDR; mode = IEEE1284_MODE_EPP | IEEE1284_ADDR;
rc = ioctl (fd, PPSETMODE, &mode); ioctl (fd, PPSETMODE, &mode);
rc = write (fd, &bval, 1); write (fd, &bval, 1);
mode = IEEE1284_MODE_EPP | IEEE1284_DATA; mode = IEEE1284_MODE_EPP | IEEE1284_DATA;
rc = ioctl (fd, PPSETMODE, &mode); ioctl (fd, PPSETMODE, &mode);
mode = 0; /* data forward */ mode = 0; /* data forward */
rc = ioctl (fd, PPDATADIR, &mode); ioctl (fd, PPDATADIR, &mode);
rc = write (fd, data, length); write (fd, data, length);
return; return;
} }
@ -469,7 +469,7 @@ setadresses (int fd, uint16_t start, uint16_t end)
static int static int
open_pp (const char *devicename) open_pp (const char *devicename)
{ {
int fd, rc, mode = 0; int fd, mode = 0;
char *name; char *name;
DBG (DBG_proc, "open_pp: start, devicename=%s\n", devicename); DBG (DBG_proc, "open_pp: start, devicename=%s\n", devicename);
@ -512,8 +512,8 @@ open_pp (const char *devicename)
free(name); free(name);
/* claim device and set it to EPP */ /* claim device and set it to EPP */
rc = ioctl (fd, PPCLAIM); ioctl (fd, PPCLAIM);
rc = ioctl (fd, PPGETMODES, &mode); ioctl (fd, PPGETMODES, &mode);
if (mode & PARPORT_MODE_PCSPP) if (mode & PARPORT_MODE_PCSPP)
DBG (DBG_io, "PARPORT_MODE_PCSPP\n"); DBG (DBG_io, "PARPORT_MODE_PCSPP\n");
if (mode & PARPORT_MODE_TRISTATE) if (mode & PARPORT_MODE_TRISTATE)
@ -546,12 +546,12 @@ open_pp (const char *devicename)
if (mode == -1) if (mode == -1)
{ {
DBG (DBG_error, "open_pp: no EPP mode, giving up ...\n"); DBG (DBG_error, "open_pp: no EPP mode, giving up ...\n");
rc = ioctl (fd, PPRELEASE); ioctl (fd, PPRELEASE);
close (fd); close (fd);
return -1; return -1;
} }
rc = ioctl (fd, PPNEGOT, &mode); ioctl (fd, PPNEGOT, &mode);
rc = ioctl (fd, PPSETMODE, &mode); ioctl (fd, PPSETMODE, &mode);
DBG (DBG_proc, "open_pp: exit\n"); DBG (DBG_proc, "open_pp: exit\n");
return fd; return fd;
} }