From 54d7a9474a068df755a590ed86c29ae590b414d8 Mon Sep 17 00:00:00 2001 From: Linquize Date: Sat, 26 Jul 2014 21:59:53 +0800 Subject: [PATCH] Fix warning in Win64 --- src/impl/win.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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());