mirror of
https://github.com/wjwwood/serial.git
synced 2026-01-22 19:54:57 +08:00
Fix warning in Win64
This commit is contained in:
parent
124e601d2f
commit
54d7a9474a
@ -317,7 +317,7 @@ Serial::SerialImpl::read (uint8_t *buf, size_t size)
|
|||||||
throw PortNotOpenedException ("Serial::read");
|
throw PortNotOpenedException ("Serial::read");
|
||||||
}
|
}
|
||||||
DWORD bytes_read;
|
DWORD bytes_read;
|
||||||
if (!ReadFile(fd_, buf, size, &bytes_read, NULL)) {
|
if (!ReadFile(fd_, buf, static_cast<DWORD>(size), &bytes_read, NULL)) {
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
ss << "Error while reading from the serial port: " << GetLastError();
|
ss << "Error while reading from the serial port: " << GetLastError();
|
||||||
THROW (IOException, ss.str().c_str());
|
THROW (IOException, ss.str().c_str());
|
||||||
@ -332,7 +332,7 @@ Serial::SerialImpl::write (const uint8_t *data, size_t length)
|
|||||||
throw PortNotOpenedException ("Serial::write");
|
throw PortNotOpenedException ("Serial::write");
|
||||||
}
|
}
|
||||||
DWORD bytes_written;
|
DWORD bytes_written;
|
||||||
if (!WriteFile(fd_, data, length, &bytes_written, NULL)) {
|
if (!WriteFile(fd_, data, static_cast<DWORD>(length), &bytes_written, NULL)) {
|
||||||
stringstream ss;
|
stringstream ss;
|
||||||
ss << "Error while writing to the serial port: " << GetLastError();
|
ss << "Error while writing to the serial port: " << GetLastError();
|
||||||
THROW (IOException, ss.str().c_str());
|
THROW (IOException, ss.str().c_str());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user