Skip to content

Commit

Permalink
A few trivial tidy-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
nlp80 committed Dec 14, 2016
1 parent 567a304 commit e4c4b25
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions irFFB/irFFB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ DWORD WINAPI readWheelThread(LPVOID lParam) {

while (true) {

res = WaitForSingleObject(wheelEvent, 1000);
res = WaitForSingleObject(wheelEvent, INFINITE);

if (!ffdevice)
continue;
Expand Down Expand Up @@ -244,7 +244,7 @@ int APIENTRY wWinMain(
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow
) {
) {

UNREFERENCED_PARAMETER(hPrevInstance);
UNREFERENCED_PARAMETER(lpCmdLine);
Expand Down Expand Up @@ -316,7 +316,7 @@ int APIENTRY wWinMain(

if (
irsdk_startup() && (hdr = irsdk_getHeader()) &&
(hdr->status & irsdk_stConnected) && hdr->bufLen != dataLen && hdr->bufLen != 0
hdr->status & irsdk_stConnected && hdr->bufLen != dataLen && hdr->bufLen != 0
) {

handles[0] = hDataValidEvent;
Expand Down Expand Up @@ -355,7 +355,8 @@ int APIENTRY wWinMain(
if (wasOnTrack && !*isOnTrack) {
wasOnTrack = false;
text(L"Has left track");
setFFB(0);
force = 0;
setFFB(force);
}

else if (!wasOnTrack && *isOnTrack) {
Expand Down Expand Up @@ -1098,9 +1099,9 @@ inline int scaleTorque(float t) {

if (minForce) {
if (t > 0 && t < minForce)
t = (float)minForce;
return minForce;
else if (t < 0 && t > -minForce)
t = (float)-minForce;
return -minForce;
}

return f2i(t);
Expand Down

0 comments on commit e4c4b25

Please sign in to comment.