diff --git a/winpr/libwinpr/comm/comm.c b/winpr/libwinpr/comm/comm.c index 97af7936f..f8e30e793 100644 --- a/winpr/libwinpr/comm/comm.c +++ b/winpr/libwinpr/comm/comm.c @@ -70,8 +70,6 @@ typedef struct comm_device COMM_DEVICE; static COMM_DEVICE** sCommDevices = NULL; static CRITICAL_SECTION sCommDevicesLock; -static HANDLE_CREATOR sCommHandleCreator = { 0 }; - static pthread_once_t sCommInitialized = PTHREAD_ONCE_INIT; static int CommGetFd(HANDLE handle) diff --git a/winpr/libwinpr/comm/comm_sercx2_sys.c b/winpr/libwinpr/comm/comm_sercx2_sys.c index 983cb5e39..5cb19f237 100644 --- a/winpr/libwinpr/comm/comm_sercx2_sys.c +++ b/winpr/libwinpr/comm/comm_sercx2_sys.c @@ -70,14 +70,13 @@ static const ULONG SERCX2_SYS_SUPPORTED_EV_MASK = /* use Serial.sys for basis (not SerCx.sys) */ static BOOL set_wait_mask(WINPR_COMM* pComm, const ULONG* pWaitMask) { - ULONG possibleMask = 0; - SERIAL_DRIVER* pSerialSys = SerialSys_s(); + const SERIAL_DRIVER* pSerialSys = SerialSys_s(); WINPR_ASSERT(pComm); WINPR_ASSERT(pWaitMask); WINPR_ASSERT(pSerialSys); - possibleMask = *pWaitMask & SERCX2_SYS_SUPPORTED_EV_MASK; + const ULONG possibleMask = *pWaitMask & SERCX2_SYS_SUPPORTED_EV_MASK; if (possibleMask != *pWaitMask) { @@ -97,7 +96,7 @@ static BOOL set_wait_mask(WINPR_COMM* pComm, const ULONG* pWaitMask) static BOOL purge(WINPR_COMM* pComm, const ULONG* pPurgeMask) { - SERIAL_DRIVER* pSerialSys = SerialSys_s(); + const SERIAL_DRIVER* pSerialSys = SerialSys_s(); WINPR_ASSERT(pComm); WINPR_ASSERT(pPurgeMask); diff --git a/winpr/libwinpr/comm/comm_sercx_sys.c b/winpr/libwinpr/comm/comm_sercx_sys.c index 7b345d659..39843c1b3 100644 --- a/winpr/libwinpr/comm/comm_sercx_sys.c +++ b/winpr/libwinpr/comm/comm_sercx_sys.c @@ -32,7 +32,7 @@ static BOOL set_handflow(WINPR_COMM* pComm, const SERIAL_HANDFLOW* pHandflow) { SERIAL_HANDFLOW SerCxHandflow; BOOL result = TRUE; - SERIAL_DRIVER* pSerialSys = SerialSys_s(); + const SERIAL_DRIVER* pSerialSys = SerialSys_s(); memcpy(&SerCxHandflow, pHandflow, sizeof(SERIAL_HANDFLOW)); @@ -121,10 +121,9 @@ static BOOL set_handflow(WINPR_COMM* pComm, const SERIAL_HANDFLOW* pHandflow) static BOOL get_handflow(WINPR_COMM* pComm, SERIAL_HANDFLOW* pHandflow) { - BOOL result = 0; - SERIAL_DRIVER* pSerialSys = SerialSys_s(); + const SERIAL_DRIVER* pSerialSys = SerialSys_s(); - result = pSerialSys->get_handflow(pComm, pHandflow); + BOOL result = pSerialSys->get_handflow(pComm, pHandflow); /* filter out unsupported bits by SerCx.sys * @@ -153,10 +152,10 @@ static const ULONG SERCX_SYS_SUPPORTED_EV_MASK = SERIAL_EV_RXCHAR | static BOOL set_wait_mask(WINPR_COMM* pComm, const ULONG* pWaitMask) { - ULONG possibleMask = 0; - SERIAL_DRIVER* pSerialSys = SerialSys_s(); + const SERIAL_DRIVER* pSerialSys = SerialSys_s(); + WINPR_ASSERT(pWaitMask); - possibleMask = *pWaitMask & SERCX_SYS_SUPPORTED_EV_MASK; + const ULONG possibleMask = *pWaitMask & SERCX_SYS_SUPPORTED_EV_MASK; if (possibleMask != *pWaitMask) {