turn some comparsions for a better readability; pt. 2

Origin commit data
------------------
Branch: ni/coolstream
Commit: 5284271ddb
Author: vanhofen <vanhofen@gmx.de>
Date: 2024-03-26 (Tue, 26 Mar 2024)

Origin message was:
------------------
- turn some comparsions for a better readability; pt. 2

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

------------------
This commit was generated by Migit
This commit is contained in:
vanhofen
2024-03-26 23:34:30 +01:00
parent 3d4a3889aa
commit 57ae2e0df5
2 changed files with 30 additions and 30 deletions

View File

@@ -110,7 +110,7 @@ void gethotlist()
if (!fgets(line, sizeof(line), hl)) if (!fgets(line, sizeof(line), hl))
break; break;
if (1 == sscanf(line, "%x", (unsigned int*)&hotlist[maxhotlist+1])) if (sscanf(line, "%x", (unsigned int*)&hotlist[maxhotlist+1]) == 1)
{ {
if (hotlist[maxhotlist+1] >= 0x100 && hotlist[maxhotlist+1] <= 0x899) if (hotlist[maxhotlist+1] >= 0x100 && hotlist[maxhotlist+1] <= 0x899)
{ {
@@ -1966,58 +1966,58 @@ int Init(int source)
if (!fgets(line, sizeof(line), conf)) if (!fgets(line, sizeof(line), conf))
break; break;
if (1 == sscanf(line, "ScreenMode16x9Normal %i", &ival)) if (sscanf(line, "ScreenMode16x9Normal %i", &ival) == 1)
screen_mode1 = ival & 1; screen_mode1 = ival & 1;
else if (1 == sscanf(line, "Brightness %i", &ival)) else if (sscanf(line, "Brightness %i", &ival) == 1)
color_mode = ival; color_mode = ival;
else if (1 == sscanf(line, "AutoNational %i", &ival)) else if (sscanf(line, "AutoNational %i", &ival) == 1)
auto_national = ival & 1; auto_national = ival & 1;
else if (1 == sscanf(line, "NationalSubset %i", &ival)) else if (sscanf(line, "NationalSubset %i", &ival) == 1)
{ {
if (ival >= 0 && ival <= (int) MAX_NATIONAL_SUBSET) if (ival >= 0 && ival <= (int) MAX_NATIONAL_SUBSET)
national_subset = ival; national_subset = ival;
} }
else if (1 == sscanf(line, "MenuLanguage %i", &ival)) else if (sscanf(line, "MenuLanguage %i", &ival) == 1)
{ {
if (ival >= 0 && ival <= MAXMENULANGUAGE) if (ival >= 0 && ival <= MAXMENULANGUAGE)
menulanguage = ival; menulanguage = ival;
} }
else if (1 == sscanf(line, "SwapUpDown %i", &ival)) else if (sscanf(line, "SwapUpDown %i", &ival) == 1)
swapupdown = ival & 1; swapupdown = ival & 1;
else if (1 == sscanf(line, "ShowHexPages %i", &ival)) else if (sscanf(line, "ShowHexPages %i", &ival) == 1)
showhex = ival & 1; showhex = ival & 1;
else if (1 == sscanf(line, "Transparency %i", &ival)) else if (sscanf(line, "Transparency %i", &ival) == 1)
trans_mode = ival; trans_mode = ival;
else if (1 == sscanf(line, "TTFWidthFactor16 %i", &ival)) else if (sscanf(line, "TTFWidthFactor16 %i", &ival) == 1)
TTFWidthFactor16 = ival; TTFWidthFactor16 = ival;
else if (1 == sscanf(line, "TTFHeightFactor16 %i", &ival)) else if (sscanf(line, "TTFHeightFactor16 %i", &ival) == 1)
TTFHeightFactor16 = ival; TTFHeightFactor16 = ival;
else if (1 == sscanf(line, "TTFShiftX %i", &ival)) else if (sscanf(line, "TTFShiftX %i", &ival) == 1)
TTFShiftX = ival; TTFShiftX = ival;
else if (1 == sscanf(line, "TTFShiftY %i", &ival)) else if (sscanf(line, "TTFShiftY %i", &ival) == 1)
TTFShiftY = ival; TTFShiftY = ival;
else if (1 == sscanf(line, "Screenmode %i", &ival)) else if (sscanf(line, "Screenmode %i", &ival) == 1)
screenmode[0] = ival; screenmode[0] = ival;
else if (1 == sscanf(line, "ScreenmodeBoxed %i", &ival)) else if (sscanf(line, "ScreenmodeBoxed %i", &ival) == 1)
screenmode[1] = ival; screenmode[1] = ival;
else if (1 == sscanf(line, "ShowFLOF %i", &ival)) else if (sscanf(line, "ShowFLOF %i", &ival) == 1)
showflof = ival & 1; showflof = ival & 1;
else if (1 == sscanf(line, "Show39 %i", &ival)) else if (sscanf(line, "Show39 %i", &ival) == 1)
show39 = ival & 1; show39 = ival & 1;
else if (1 == sscanf(line, "ShowLevel2p5 %i", &ival)) else if (sscanf(line, "ShowLevel2p5 %i", &ival) == 1)
showl25 = ival & 1; showl25 = ival & 1;
else if (1 == sscanf(line, "DumpLevel2p5 %i", &ival)) else if (sscanf(line, "DumpLevel2p5 %i", &ival) == 1)
dumpl25 = ival & 1; dumpl25 = ival & 1;
else if (1 == sscanf(line, "UseTTF %i", &ival)) else if (sscanf(line, "UseTTF %i", &ival) == 1)
usettf = ival & 1; usettf = ival & 1;
#if 0 #if 0
else if (1 == sscanf(line, "StartX %i", &ival)) else if (sscanf(line, "StartX %i", &ival) == 1)
sx = ival; sx = ival;
else if (1 == sscanf(line, "EndX %i", &ival)) else if (sscanf(line, "EndX %i", &ival) == 1)
ex = ival; ex = ival;
else if (1 == sscanf(line, "StartY %i", &ival)) else if (sscanf(line, "StartY %i", &ival) == 1)
sy = ival; sy = ival;
else if (1 == sscanf(line, "EndY %i", &ival)) else if (sscanf(line, "EndY %i", &ival) == 1)
ey = ival; ey = ival;
#endif #endif
} }

View File

@@ -229,14 +229,14 @@ void * DmxTSReader( void * /*Ptr*/ )
Stream[u].Filter.pes_type=DMX_PES_OTHER; Stream[u].Filter.pes_type=DMX_PES_OTHER;
Stream[u].Filter.flags=0; Stream[u].Filter.flags=0;
//Stream[u].Filter.flags=DMX_IMMEDIATE_START; //Stream[u].Filter.flags=DMX_IMMEDIATE_START;
if (-1==ioctl(Stream[u].fd, DMX_SET_PES_FILTER, &(Stream[u].Filter)) ) { if (ioctl(Stream[u].fd, DMX_SET_PES_FILTER, &(Stream[u].Filter)) == -1) {
perror("ERROR: main() - DMX_SET_PES_FILTER ioctl"); perror("ERROR: main() - DMX_SET_PES_FILTER ioctl");
fprintf(stderr, "EXIT\n"); fprintf(stderr, "EXIT\n");
fflush(stderr); fflush(stderr);
exit(-1); exit(-1);
} }
if ( -1==ioctl(Stream[u].fd, DMX_START, 0) ) { if (ioctl(Stream[u].fd, DMX_START, 0) == -1) {
perror("ERROR: DmxReader() - DMX_START ioctl"); perror("ERROR: DmxReader() - DMX_START ioctl");
fprintf(stderr, "EXIT\n"); fprintf(stderr, "EXIT\n");
fflush(stderr); fflush(stderr);
@@ -252,14 +252,14 @@ void * DmxTSReader( void * /*Ptr*/ )
Stream[u].Filter.pes_type=DMX_PES_OTHER; Stream[u].Filter.pes_type=DMX_PES_OTHER;
Stream[u].Filter.flags=0; Stream[u].Filter.flags=0;
//Stream[u].Filter.flags=DMX_IMMEDIATE_START; //Stream[u].Filter.flags=DMX_IMMEDIATE_START;
if (-1==ioctl(Stream[u].fd, DMX_SET_PES_FILTER, &(Stream[u].Filter)) ) { if (ioctl(Stream[u].fd, DMX_SET_PES_FILTER, &(Stream[u].Filter)) == -1) {
perror("ERROR: main() - DMX_SET_PES_FILTER ioctl"); perror("ERROR: main() - DMX_SET_PES_FILTER ioctl");
fprintf(stderr, "EXIT\n"); fprintf(stderr, "EXIT\n");
fflush(stderr); fflush(stderr);
exit(-1); exit(-1);
} }
if ( -1==ioctl(Stream[u].fd, DMX_START, 0) ) { if (ioctl(Stream[u].fd, DMX_START, 0) == -1) {
perror("ERROR: DmxReader() - DMX_START ioctl"); perror("ERROR: DmxReader() - DMX_START ioctl");
fprintf(stderr, "EXIT\n"); fprintf(stderr, "EXIT\n");
fflush(stderr); fflush(stderr);
@@ -345,14 +345,14 @@ void * DmxReader( void * Ptr )
//CurStream->Filter.flags=0; //CurStream->Filter.flags=0;
CurStream->Filter.flags=DMX_IMMEDIATE_START; CurStream->Filter.flags=DMX_IMMEDIATE_START;
if (-1==ioctl(CurStream->fd, DMX_SET_PES_FILTER, &(CurStream->Filter)) ) { if (ioctl(CurStream->fd, DMX_SET_PES_FILTER, &(CurStream->Filter)) == -1) {
perror("ERROR: main() - DMX_SET_PES_FILTER ioctl"); perror("ERROR: main() - DMX_SET_PES_FILTER ioctl");
fprintf(stderr, "EXIT\n"); fprintf(stderr, "EXIT\n");
fflush(stderr); fflush(stderr);
exit(-1); exit(-1);
} }
if ( -1==ioctl(CurStream->fd, DMX_START, 0) ) { if (ioctl(CurStream->fd, DMX_START, 0) == -1) {
perror("ERROR: DmxReader() - DMX_START ioctl"); perror("ERROR: DmxReader() - DMX_START ioctl");
fprintf(stderr, "EXIT\n"); fprintf(stderr, "EXIT\n");
fflush(stderr); fflush(stderr);