comparison libmpdvdkit2/libdvdcss.c @ 20417:cef706926f20

Sync warning fixes from upstream libdvdcss.
author diego
date Tue, 24 Oct 2006 17:47:03 +0000
parents 8e6981e8f50a
children 5b26bde0cd10
comparison
equal deleted inserted replaced
20416:c7f0452a93c0 20417:cef706926f20
385 { 385 {
386 char *psz_tag = "Signature: 8a477f597d28d172789f06886806bc55\r\n" 386 char *psz_tag = "Signature: 8a477f597d28d172789f06886806bc55\r\n"
387 "# This file is a cache directory tag created by libdvdcss.\r\n" 387 "# This file is a cache directory tag created by libdvdcss.\r\n"
388 "# For information about cache directory tags, see:\r\n" 388 "# For information about cache directory tags, see:\r\n"
389 "# http://www.brynosaurus.com/cachedir/\r\n"; 389 "# http://www.brynosaurus.com/cachedir/\r\n";
390 unsigned char psz_tagfile[PATH_MAX+1+12+1]; 390 char psz_tagfile[PATH_MAX + 1 + 12 + 1];
391 int i_fd; 391 int i_fd;
392 392
393 sprintf( psz_tagfile, "%s/CACHEDIR.TAG", psz_cache ); 393 sprintf( psz_tagfile, "%s/CACHEDIR.TAG", psz_cache );
394 i_fd = open( psz_tagfile, O_RDWR|O_CREAT, 0644 ); 394 i_fd = open( psz_tagfile, O_RDWR|O_CREAT, 0644 );
395 if( i_fd >= 0 ) 395 if( i_fd >= 0 )
401 401
402 /* If the cache is enabled, extract a unique disc ID */ 402 /* If the cache is enabled, extract a unique disc ID */
403 if( psz_cache ) 403 if( psz_cache )
404 { 404 {
405 uint8_t p_sector[DVDCSS_BLOCK_SIZE]; 405 uint8_t p_sector[DVDCSS_BLOCK_SIZE];
406 unsigned char psz_debug[PATH_MAX+30]; 406 char psz_debug[PATH_MAX + 30];
407 unsigned char psz_key[1 + KEY_SIZE * 2 + 1]; 407 char psz_key[1 + KEY_SIZE * 2 + 1];
408 unsigned char * psz_title, * psz_serial; 408 char *psz_title, *psz_serial;
409 int i; 409 int i;
410 410
411 /* We read sector 0. If it starts with 0x000001ba (BE), we are 411 /* We read sector 0. If it starts with 0x000001ba (BE), we are
412 * reading a VOB file, and we should not cache anything. */ 412 * reading a VOB file, and we should not cache anything. */
413 413
444 { 444 {
445 goto nocache; 445 goto nocache;
446 } 446 }
447 447
448 /* Get the disc title */ 448 /* Get the disc title */
449 psz_title = p_sector + 40; 449 psz_title = (char *)p_sector + 40;
450 psz_title[32] = '\0'; 450 psz_title[32] = '\0';
451 451
452 for( i = 0 ; i < 32 ; i++ ) 452 for( i = 0 ; i < 32 ; i++ )
453 { 453 {
454 if( psz_title[i] <= ' ' ) 454 if( psz_title[i] <= ' ' )
461 psz_title[i] = '-'; 461 psz_title[i] = '-';
462 } 462 }
463 } 463 }
464 464
465 /* Get the date + serial */ 465 /* Get the date + serial */
466 psz_serial = p_sector + 813; 466 psz_serial = (char *)p_sector + 813;
467 psz_serial[16] = '\0'; 467 psz_serial[16] = '\0';
468 468
469 /* Check that all characters are digits, otherwise convert. */ 469 /* Check that all characters are digits, otherwise convert. */
470 for( i = 0 ; i < 16 ; i++ ) 470 for( i = 0 ; i < 16 ; i++ )
471 { 471 {