Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize flicker app sources #997

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 7 additions & 12 deletions hid/firefly/app/firefly.cpp
Expand Up @@ -23,6 +23,7 @@ Module Name:
--*/
#include "luminous.h"
#include <dontuse.h>
#include <memory>

#define USAGE \
_T("Usage: Flicker <-0 | -1 | -2>\n\
Expand All @@ -36,11 +37,8 @@ main(
_In_reads_(argc) PCHAR argv[]
)
{
int i, j, k;
BOOL bAdjustLight = FALSE;
BOOL bSuccessful;
ULONG lightSetting = 0;
CLuminous *luminous;

if (argc == 2) {

Expand All @@ -60,7 +58,7 @@ main(
exit(0);
}

luminous = new CLuminous();
auto luminous = std::make_unique<CLuminous>();

if (luminous == NULL) {

Expand All @@ -71,10 +69,10 @@ main(
if (!luminous->Open()) {

_tprintf(_T("Problem opening Luminous\n"));
delete(luminous);
return 0;
}

BOOL bSuccessful;
if (bAdjustLight) {

if (lightSetting < 2) {
Expand All @@ -91,10 +89,9 @@ main(
}

} else {

k=0;
j=1;
for(i = 500; (i>0)&&(j>0); i-=j) {
int k=0;
int j=1;
for(int i = 500; (i>0)&&(j>0); i-=j) {

j = (i*9/100);
Sleep(i);
Expand All @@ -104,7 +101,7 @@ main(
}
k=1-k;
}
for(i = 12; i<500; i+=j) {
for(int i = 12; i<500; i+=j) {

j = (i*9/100);
Sleep(i);
Expand All @@ -127,8 +124,6 @@ main(
End:
luminous->Close();

delete(luminous);

return 0;
}

Expand Down