X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=sidebyside;f=source%2Fio%2Fwindows%2Fserial.cpp;h=bd086dd4d88e0985d6ab292f0bebeed92f5453f2;hb=41363aed34382386f915f17c1a961750b4fdcb14;hp=0092754549bde4f22f4d8ec8c7e947feedeca5be;hpb=609c9a508cfdc7b42c46c4f21d17639204165a00;p=libs%2Fcore.git diff --git a/source/io/windows/serial.cpp b/source/io/windows/serial.cpp index 0092754..bd086dd 100644 --- a/source/io/windows/serial.cpp +++ b/source/io/windows/serial.cpp @@ -13,7 +13,7 @@ void Serial::platform_init(const string &port) { string name = "\\\\.\\"+port; - *handle = CreateFile(name.c_str(), GENERIC_READ|GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, 0); + *handle = CreateFile(name.c_str(), GENERIC_READ|GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, nullptr); if(!handle) throw system_error(format("CreateFile(%s)", port)); mode = M_READ|M_WRITE; @@ -28,14 +28,14 @@ void Serial::platform_init(const string &port) } -void Serial::DeviceState::get_from(const Handle &handle) +void Serial::DeviceState::get_from(const Handle &h) { - GetCommState(*handle, &state); + GetCommState(*h, &state); } -void Serial::DeviceState::apply_to(const Handle &handle) +void Serial::DeviceState::apply_to(const Handle &h) { - if(SetCommState(*handle, &state)==0) + if(SetCommState(*h, &state)==0) throw system_error("SetCommState"); }