[libdvdnav-devel] [PATCH] Fix compilation

Jean-Baptiste Kempf jb at videolan.org
Tue Nov 19 10:11:25 CET 2019


No. C99 is necessary.

On Tue, Nov 19, 2019, at 10:10, KO Myung-Hun wrote:
> -----
>   CC       src/searching.lo
> src/searching.c: In function 'dvdnav_scan_admap':
> src/searching.c:100:9: error: 'for' loop initial declarations are only 
> allowed in C99 or C11 mode
>          for ( uint32_t check=1 ; check<=32 && 
> address+check<admap_entries ; check++ ) {
>          ^
> src/searching.c:100:9: note: use option -std=c99, -std=gnu99, -std=c11 
> or -std=gnu11 to compile your code
> -----
> ---
>  src/searching.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/searching.c b/src/searching.c
> index 11c3f98..cb18fa4 100644
> --- a/src/searching.c
> +++ b/src/searching.c
> @@ -97,7 +97,8 @@ static dvdnav_status_t dvdnav_scan_admap(dvdnav_t 
> *this, int32_t domain, uint32_
>           * not. */
>          uint32_t ooo_address = 0;
>          uint32_t ooo_vobu = SRI_END_OF_CELL;
> -        for ( uint32_t check=1 ; check<=32 && 
> address+check<admap_entries ; check++ ) {
> +        uint32_t check;
> +        for ( check=1 ; check<=32 && address+check<admap_entries ; 
> check++ ) {
>            uint32_t check_vobu = 
> admap->vobu_start_sectors[address+check];
>            if (check_vobu < next_vobu && check_vobu < ooo_vobu) {
>              ooo_address = address+check;
> -- 
> 2.22.0
> 
> _______________________________________________
> libdvdnav-devel mailing list
> libdvdnav-devel at videolan.org
> https://mailman.videolan.org/listinfo/libdvdnav-devel

-- 
Jean-Baptiste Kempf -  President
+33 672 704 734


More information about the libdvdnav-devel mailing list