Fix some compiler warnings

This commit is contained in:
IMback
2017-11-03 19:04:15 +01:00
parent da117507f2
commit e07866b906

View File

@ -5,13 +5,13 @@ struct termios toptions;
void sWrite(int port, char string[], size_t length) void sWrite(int port, char string[], size_t length)
{ {
if(port != -1) write(port, string, length); if(port != -1) write(port, string, length);
else for( int j = 0; j < length; j++ )std::cout<<string[j]; else for( size_t j = 0; j < length; j++ )std::cout<<string[j];
} }
void sWrite(int port, const char string[], size_t length) void sWrite(int port, const char string[], size_t length)
{ {
if(port != -1) write(port, string, length); if(port != -1) write(port, string, length);
else for( int j = 0; j < length; j++ )std::cout<<string[j]; else for( size_t j = 0; j < length; j++ )std::cout<<string[j];
} }
ssize_t sRead(int port, void *buf, size_t count) ssize_t sRead(int port, void *buf, size_t count)
@ -33,7 +33,7 @@ int serialport_init(const char* device, int baud)
{ {
perror("init_serialport: Couldn't get term attributes"); perror("init_serialport: Couldn't get term attributes");
return -1; return -1;
}
cfsetispeed(&toptions, baud); cfsetispeed(&toptions, baud);
cfsetospeed(&toptions, baud); cfsetospeed(&toptions, baud);
// 8N1 // 8N1