[libbluray-devel] [PATCH[ Compiler happynessm for functions

Petri Hintukainen phintuka at users.sourceforge.net
Tue Mar 22 13:06:55 CET 2011


Erik Van Grunderbeeck wrote:
> @@ -662,7 +662,7 @@ static int _libbdplus_open(BLURAY *bd, const char *keyfile_path)
>          return 0;
>      }
>  
> -    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, _libaacs_get_vid(bd) ?: vid);
> +    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, _libaacs_get_vid(bd) ? 0 : vid);
>  
>      if (bd->bdplus) {
>          BD_DEBUG(DBG_BLURAY,"libbdplus initialized\n");

COND ?: X is gcc(?) extension and shoundn't be there... But 0 is wrong value:
COND ?: X  equals to  (r=COND) ? r : XXX

So, previous chunk should be something like

-    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, _libaacs_get_vid(bd) ?: vid);
+    const char *libaacs_vid = _libaacs_get_vid(bd);
+    bd->bdplus = bd->bdplus_init(bd->device_path, keyfile_path, libaacs_vid ? libaacs_vid : vid);


- Petri




More information about the libbluray-devel mailing list