* coding style harmonization in servers/
- explicitely declare void arguments - make a few string args const * better support for shorter displays in server screen * make target to create top level tag file
This commit is contained in:
@@ -45,7 +45,7 @@ void
|
||||
serialVFD_write_serial (Driver *drvthis, unsigned char *dat, size_t length)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
write (p->fd,dat,length);
|
||||
write(p->fd,dat,length);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -55,15 +55,15 @@ serialVFD_write_parallel (Driver *drvthis, unsigned char *dat, size_t length)
|
||||
PrivateData *p = drvthis->private_data;
|
||||
int i_para, j_para;
|
||||
|
||||
for(i_para = 0; i_para < length; i_para++) {
|
||||
for (i_para = 0; i_para < length; i_para++) {
|
||||
port_out(p->port, dat[i_para]);
|
||||
// port_in(p->port+1);
|
||||
port_out(p->port+2, WR_on);
|
||||
port_in(p->port+1);
|
||||
port_out(p->port+2, WR_off);
|
||||
port_in(p->port+1);
|
||||
for(j_para=0; j_para < MAXBUSY; j_para++) {
|
||||
if((port_in(p->port+1)) & Busy)
|
||||
for (j_para = 0; j_para < MAXBUSY; j_para++) {
|
||||
if ((port_in(p->port+1)) & Busy)
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -78,14 +78,14 @@ serialVFD_init_serial (Driver *drvthis)
|
||||
|
||||
/* Set up io port correctly, and open it...*/
|
||||
debug( RPT_DEBUG, "%s: Opening device: %s", __FUNCTION__, p->device);
|
||||
p->fd = open (p->device, O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
p->fd = open(p->device, O_RDWR | O_NOCTTY | O_NDELAY);
|
||||
|
||||
if (p->fd == -1) {
|
||||
report (RPT_ERR, "%s: open() of %s failed (%s)\n", __FUNCTION__, p->device, strerror (errno));
|
||||
report(RPT_ERR, "%s: open() of %s failed (%s)\n", __FUNCTION__, p->device, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
tcgetattr (p->fd, &portset);
|
||||
tcgetattr(p->fd, &portset);
|
||||
|
||||
// We use RAW mode
|
||||
#ifdef HAVE_CFMAKERAW
|
||||
@@ -102,11 +102,11 @@ serialVFD_init_serial (Driver *drvthis)
|
||||
#endif
|
||||
|
||||
// Set port speed
|
||||
cfsetospeed (&portset, p->speed);
|
||||
cfsetispeed (&portset, B0);
|
||||
cfsetospeed(&portset, p->speed);
|
||||
cfsetispeed(&portset, B0);
|
||||
|
||||
// Do it...
|
||||
tcsetattr (p->fd, TCSANOW, &portset);
|
||||
tcsetattr(p->fd, TCSANOW, &portset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -115,14 +115,14 @@ serialVFD_init_parallel (Driver *drvthis)
|
||||
{
|
||||
PrivateData *p = drvthis->private_data;
|
||||
#ifdef HAVE_PCSTYLE_LPT_CONTROL
|
||||
debug( RPT_DEBUG, "%s: Opening parallelport at: 0x%X", __FUNCTION__, p->port);
|
||||
if(port_access_multiple(p->port,3)) {
|
||||
report (RPT_ERR, "%s: port_access_multiple() of 0x%X failed (%s)\n", __FUNCTION__, p->port, strerror (errno));
|
||||
debug(RPT_DEBUG, "%s: Opening parallelport at: 0x%X", __FUNCTION__, p->port);
|
||||
if (port_access_multiple(p->port,3)) {
|
||||
report(RPT_ERR, "%s: port_access_multiple() of 0x%X failed (%s)\n", __FUNCTION__, p->port, strerror(errno));
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
#else
|
||||
report (RPT_ERR, "%s: LCDproc was compiled without PCstyle LPT support\n", __FUNCTION__);
|
||||
report(RPT_ERR, "%s: LCDproc was compiled without PCstyle LPT support\n", __FUNCTION__);
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
@@ -141,9 +141,9 @@ serialVFD_close_parallel (Driver *drvthis)
|
||||
#ifdef HAVE_PCSTYLE_LPT_CONTROL
|
||||
PrivateData *p = drvthis->private_data;
|
||||
|
||||
debug( RPT_DEBUG, "%s: Closing parallelport at: 0x%X", __FUNCTION__, p->port);
|
||||
if(port_deny_multiple(p->port,3)) {
|
||||
report (RPT_ERR, "%s: port_deny_multiple() of 0x%X failed (%s)\n", __FUNCTION__, p->port, strerror (errno));
|
||||
debug(RPT_DEBUG, "%s: Closing parallelport at: 0x%X", __FUNCTION__, p->port);
|
||||
if (port_deny_multiple(p->port,3)) {
|
||||
report(RPT_ERR, "%s: port_deny_multiple() of 0x%X failed (%s)\n", __FUNCTION__, p->port, strerror(errno));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user