hdd-info: formatting code using astyle

Origin commit data
------------------
Branch: ni/coolstream
Commit: 02e0ae9e3d
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-11-07 (Sun, 07 Nov 2021)

Origin message was:
------------------
- hdd-info: formatting code using astyle

------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2021-11-07 19:44:03 +01:00
parent 158f16b0b7
commit b115077d09
2 changed files with 61 additions and 60 deletions

View File

@@ -61,17 +61,15 @@ static char *trim(char *txt)
if (*txt == ' ') if (*txt == ' ')
{ {
for (p1=p2=txt; for (p1 = p2 = txt; (*p1 == ' ') || (*p1 == '\t') || (*p1 == '\n') || (*p1 == '\r'); p1++)
(*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r'); {};
p1++){};
while (*p1) while (*p1)
*p2++ = *p1++; *p2++ = *p1++;
*p2 = '\0'; *p2 = '\0';
} }
if ((l = strlen(txt)) > 0) if ((l = strlen(txt)) > 0)
for (p1=txt+l-1; for (p1 = txt + l - 1; (*p1 == ' ') || (*p1 == '\t') || (*p1 == '\n') || (*p1 == '\r'); *p1-- = '\0')
(*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r'); {};
*p1--='\0'){};
return (txt); return (txt);
} }
@@ -113,18 +111,21 @@ int CHDDInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey)
{ {
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd); g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) { if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer()))
if(fader.FadeDone()) { {
if (fader.FadeDone())
{
doLoop = false; doLoop = false;
} }
} }
else if ( ( msg == CRCInput::RC_timeout ) || else if ((msg == CRCInput::RC_timeout) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_ok))
( msg == CRCInput::RC_home ) || {
( msg == CRCInput::RC_ok ) ) { if (fader.StartFadeOut())
if(fader.StartFadeOut()) { {
timeoutEnd = CRCInput::calcTimeoutEnd(1); timeoutEnd = CRCInput::calcTimeoutEnd(1);
msg = 0; msg = 0;
} else }
else
doLoop = false; doLoop = false;
} }
else if (CNeutrinoApp::getInstance()->listModeKey(msg)) else if (CNeutrinoApp::getInstance()->listModeKey(msg))
@@ -142,8 +143,7 @@ int CHDDInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey)
} }
else if (mr & messages_return::unhandled) else if (mr & messages_return::unhandled)
{ {
if ((msg <= CRCInput::RC_MaxRC) && if ((msg <= CRCInput::RC_MaxRC) && (data == 0)) /* <- button pressed */
(data == 0)) /* <- button pressed */
{ {
timeoutEnd = CRCInput::calcTimeoutEnd(timeout); timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
} }
@@ -180,7 +180,8 @@ int CHDDInfoMenu::show()
buf << "/sys/block/" << namelist[i]->d_name << "/device/model"; buf << "/sys/block/" << namelist[i]->d_name << "/device/model";
f = fopen(buf.str().c_str(), "r"); f = fopen(buf.str().c_str(), "r");
if(f) { if (f)
{
fscanf(f, "%127[^\n]", (char *) &model); fscanf(f, "%127[^\n]", (char *) &model);
fclose(f); fclose(f);
} }