diff --git a/src/impl/win.cc b/src/impl/win.cc index d933fe9..c25bf4f 100644 --- a/src/impl/win.cc +++ b/src/impl/win.cc @@ -317,7 +317,7 @@ Serial::SerialImpl::read (uint8_t *buf, size_t size) throw PortNotOpenedException ("Serial::read"); } DWORD bytes_read; - if (!ReadFile(fd_, buf, size, &bytes_read, NULL)) { + if (!ReadFile(fd_, buf, static_cast(size), &bytes_read, NULL)) { stringstream ss; ss << "Error while reading from the serial port: " << GetLastError(); THROW (IOException, ss.str().c_str()); @@ -332,7 +332,7 @@ Serial::SerialImpl::write (const uint8_t *data, size_t length) throw PortNotOpenedException ("Serial::write"); } DWORD bytes_written; - if (!WriteFile(fd_, data, length, &bytes_written, NULL)) { + if (!WriteFile(fd_, data, static_cast(length), &bytes_written, NULL)) { stringstream ss; ss << "Error while writing to the serial port: " << GetLastError(); THROW (IOException, ss.str().c_str());