mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-26 15:02:50 +02:00
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:
@@ -61,17 +61,15 @@ static char *trim(char *txt)
|
||||
|
||||
if (*txt == ' ')
|
||||
{
|
||||
for (p1=p2=txt;
|
||||
(*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r');
|
||||
p1++){};
|
||||
for (p1 = p2 = txt; (*p1 == ' ') || (*p1 == '\t') || (*p1 == '\n') || (*p1 == '\r'); p1++)
|
||||
{};
|
||||
while (*p1)
|
||||
*p2++ = *p1++;
|
||||
*p2 = '\0';
|
||||
}
|
||||
if ((l = strlen(txt)) > 0)
|
||||
for (p1=txt+l-1;
|
||||
(*p1==' ') || (*p1=='\t') || (*p1=='\n') || (*p1=='\r');
|
||||
*p1--='\0'){};
|
||||
for (p1 = txt + l - 1; (*p1 == ' ') || (*p1 == '\t') || (*p1 == '\n') || (*p1 == '\r'); *p1-- = '\0')
|
||||
{};
|
||||
return (txt);
|
||||
}
|
||||
|
||||
@@ -113,18 +111,21 @@ int CHDDInfoMenu::exec(CMenuTarget* parent, const std::string &actionKey)
|
||||
{
|
||||
g_RCInput->getMsgAbsoluteTimeout(&msg, &data, &timeoutEnd);
|
||||
|
||||
if((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer())) {
|
||||
if(fader.FadeDone()) {
|
||||
if ((msg == NeutrinoMessages::EVT_TIMER) && (data == fader.GetFadeTimer()))
|
||||
{
|
||||
if (fader.FadeDone())
|
||||
{
|
||||
doLoop = false;
|
||||
}
|
||||
}
|
||||
else if ( ( msg == CRCInput::RC_timeout ) ||
|
||||
( msg == CRCInput::RC_home ) ||
|
||||
( msg == CRCInput::RC_ok ) ) {
|
||||
if(fader.StartFadeOut()) {
|
||||
else if ((msg == CRCInput::RC_timeout) || (msg == CRCInput::RC_home) || (msg == CRCInput::RC_ok))
|
||||
{
|
||||
if (fader.StartFadeOut())
|
||||
{
|
||||
timeoutEnd = CRCInput::calcTimeoutEnd(1);
|
||||
msg = 0;
|
||||
} else
|
||||
}
|
||||
else
|
||||
doLoop = false;
|
||||
}
|
||||
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)
|
||||
{
|
||||
if ((msg <= CRCInput::RC_MaxRC) &&
|
||||
(data == 0)) /* <- button pressed */
|
||||
if ((msg <= CRCInput::RC_MaxRC) && (data == 0)) /* <- button pressed */
|
||||
{
|
||||
timeoutEnd = CRCInput::calcTimeoutEnd(timeout);
|
||||
}
|
||||
@@ -180,7 +180,8 @@ int CHDDInfoMenu::show()
|
||||
buf << "/sys/block/" << namelist[i]->d_name << "/device/model";
|
||||
|
||||
f = fopen(buf.str().c_str(), "r");
|
||||
if(f) {
|
||||
if (f)
|
||||
{
|
||||
fscanf(f, "%127[^\n]", (char *) &model);
|
||||
fclose(f);
|
||||
}
|
||||
|
Reference in New Issue
Block a user