catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
332 stars 81 forks source link

Fix some warnings #1112

Closed lars18th closed 1 year ago

Jalle19 commented 1 year ago

Can you add the warning message to the PR description?

lars18th commented 1 year ago

Can you add the warning message to the PR description?

It fixes:

stream.c:611:5: warning: implicit conversion from 'int' to 'char' changes value from 128 to -128 [-Wconstant-conversion]
copy16(rtp_buf, len + 0, 0x8021);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/minisatip.h:34:27: note: expanded from macro 'copy16'
a[i] = ((v) >> 8) & 0xFF;
~ ~~~~~~~~~~~^~~~~~
1 warning generated.
lars18th commented 1 year ago

Hi @Jalle19 ,

Added also a fix for this warning in pmt.c:

pmt.c:1092:32: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
        if ((ad->pids[i].flags == 1)) {
             ~~~~~~~~~~~~~~~~~~^~~~
pmt.c:1092:32: note: remove extraneous parentheses around the comparison to silence this warning
        if ((ad->pids[i].flags == 1)) {
            ~                  ^   ~
pmt.c:1092:32: note: use '=' to turn this equality comparison into an assignment
        if ((ad->pids[i].flags == 1)) {
                               ^~
                               =

Both are detected cross compiling with zig cc that uses LLVM. Ready to merge?