Supplement to "libeplayer3: Standardize comparison order and improve code readability"

Origin commit data
------------------
Commit: 0737aa3ba6
Author: vanhofen <vanhofen@gmx.de>
Date: 2024-03-25 (Mon, 25 Mar 2024)

Origin message was:
------------------
- addition to "small fix"

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

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2024-03-25 06:37:01 +01:00
committed by Thilo Graf
parent 73536563da
commit 900c92a67e
7 changed files with 16 additions and 16 deletions

View File

@@ -213,7 +213,7 @@ static int kbhit(void)
FD_SET(0, &readfds);
FD_SET(g_pfd[0], &readfds);
if (-1 == select(g_pfd[0] + 1, &readfds, NULL, NULL, &tv))
if (select(g_pfd[0] + 1, &readfds, NULL, NULL, &tv) == -1)
{
return 0;
}
@@ -253,7 +253,7 @@ static void SetNice(int prio)
sched_setscheduler(0, SCHED_RR, &param);
#else
//int prevPrio = getpriority(PRIO_PROCESS, 0);
if (-1 == setpriority(PRIO_PROCESS, 0, prio))
if (setpriority(PRIO_PROCESS, 0, prio) == -1)
{
printf("setpriority - failed\n");
}
@@ -390,7 +390,7 @@ static int HandleTracks(const Manager_t *ptrManager, const PlaybackCmd_t playbac
ok = sscanf(argvBuff + 1, "%d", &id);
}
if (id >= 0 || (1 == ok && id == -1))
if (id >= 0 || (ok == 1 && id == -1))
{
commandRetVal = g_player->playback->Command(g_player, playbackSwitchCmd, (void *)&id);
E2iSendMsg("{\"%c_%c\":{\"id\":%d,\"sts\":%d}}\n", argvBuff[0], 's', id, commandRetVal);
@@ -843,7 +843,7 @@ int main(int argc, char *argv[])
case 'o':
{
int flags = 0;
if (1 == sscanf(argvBuff + 1, "%d", &flags))
if (sscanf(argvBuff + 1, "%d", &flags) == 1)
{
progressive_playback_set(flags);
E2iSendMsg("{\"PROGRESSIVE_DOWNLOAD\":{\"flags\":%d, \"sts\":0}}\n", flags);
@@ -1022,7 +1022,7 @@ int main(int argc, char *argv[])
free(g_player);
}
if (isTermThreadStarted && 1 == write(g_pfd[1], "x", 1))
if (isTermThreadStarted && write(g_pfd[1], "x", 1) == 1)
{
pthread_join(termThread, NULL);
}