FD- / RPiPlay

An open-source AirPlay mirroring server for the Raspberry Pi. Supports iOS 9 and up.
GNU General Public License v3.0
4.95k stars 354 forks source link

Fix #197: Missing braces in for loop #198

Closed Zenexer closed 2 years ago

Zenexer commented 3 years ago

Fixes #197.

fduncanh commented 3 years ago

Those braces are optional, it's a one line "for" statement. Your proposed change is cosmetic.

Zenexer commented 3 years ago

@fduncanh They aren't optional if that entire line is meant to be looped. Currently, it's effectively this:

for ( i = 0; i < s->payloadSize; i++ ) {
    printf("%ld.%d: ", (long int)(b->p - b->start), b->bits_left);
}

s->data[i] = bs_read_u8(b); printf("s->data[i]: %d \n", s->data[i]); 

Implicit braces are per-statement, not per-line.

fduncanh commented 3 years ago

sorry, you are right of course. Luckily, from the function name it seems to be in code only used at some time for debugging h264-bitstream code.

It's never referenced unless HAVE_SEI is defined, which appears not to be the case. (so it appears to be dead code)

In my use (not RPi) of RPiPlay, that h264-bitstream code is never compiled,

fduncanh commented 3 years ago

you should report it upstream here: (there appears still to be someone occasionally looking at issues there)

https://github.com/aizvorski/h264bitstream

FD- commented 2 years ago

Yeah, please report it to upstream! We're not using that part of the code, but other consumers of h264bitstream may.