Author: Monty <paranoia@xiph.org>
Description:
Changeset 15338: Commit fix for 'private' becoming a reserved keyword as of
GCC 4.3+ (Closes: #499676).
diff -u -r cdparanoia-III-10.2/interface/cdda_interface.h cdparanoia-III-10.2-patched/interface/cdda_interface.h
old
|
new
|
|
90 | 90 | int is_atapi; |
91 | 91 | int is_mmc; |
92 | 92 | |
93 | | cdda_private_data_t *private; |
| 93 | cdda_private_data_t *private_data; |
94 | 94 | void *reserved; |
95 | 95 | unsigned char inqbytes[4]; |
96 | 96 | |
Only in cdparanoia-III-10.2-patched/interface: cdda_interface.h.orig
diff -u -r cdparanoia-III-10.2/interface/cooked_interface.c cdparanoia-III-10.2-patched/interface/cooked_interface.c
old
|
new
|
|
15 | 15 | static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ |
16 | 16 | struct timespec tv1; |
17 | 17 | struct timespec tv2; |
18 | | int ret1=clock_gettime(d->private->clock,&tv1); |
| 18 | int ret1=clock_gettime(d->private_data->clock,&tv1); |
19 | 19 | int ret2=ioctl(fd, command,arg); |
20 | | int ret3=clock_gettime(d->private->clock,&tv2); |
| 20 | int ret3=clock_gettime(d->private_data->clock,&tv2); |
21 | 21 | if(ret1<0 || ret3<0){ |
22 | | d->private->last_milliseconds=-1; |
| 22 | d->private_data->last_milliseconds=-1; |
23 | 23 | }else{ |
24 | | d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; |
| 24 | d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; |
25 | 25 | } |
26 | 26 | return ret2; |
27 | 27 | } |
Only in cdparanoia-III-10.2-patched/interface: cooked_interface.c.orig
diff -u -r cdparanoia-III-10.2/interface/interface.c cdparanoia-III-10.2-patched/interface/interface.c
old
|
new
|
|
42 | 42 | if(d->cdda_fd!=-1)close(d->cdda_fd); |
43 | 43 | if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); |
44 | 44 | #ifndef __APPLE__ |
45 | | if(d->private){ |
46 | | if(d->private->sg_hd)free(d->private->sg_hd); |
47 | | free(d->private); |
| 45 | if(d->private_data){ |
| 46 | if(d->private_data->sg_hd)free(d->private_data->sg_hd); |
| 47 | free(d->private_data); |
48 | 48 | } |
49 | 49 | #endif |
50 | 50 | |
… |
… |
|
139 | 139 | } |
140 | 140 | } |
141 | 141 | #ifndef __APPLE__ |
142 | | if(ms)*ms=d->private->last_milliseconds; |
| 142 | if(ms)*ms=d->private_data->last_milliseconds; |
143 | 143 | #endif |
144 | 144 | return(sectors); |
145 | 145 | } |
Only in cdparanoia-III-10.2-patched/interface: interface.c.orig
diff -u -r cdparanoia-III-10.2/interface/scan_devices.c cdparanoia-III-10.2-patched/interface/scan_devices.c
old
|
new
|
|
276 | 276 | d->interface=COOKED_IOCTL; |
277 | 277 | d->bigendianp=-1; /* We don't know yet... */ |
278 | 278 | d->nsectors=-1; |
279 | | d->private=calloc(1,sizeof(*d->private)); |
| 279 | d->private_data=calloc(1,sizeof(*d->private_data)); |
280 | 280 | { |
281 | 281 | /* goddamnit */ |
282 | 282 | struct timespec tv; |
283 | | d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); |
| 283 | d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); |
284 | 284 | } |
285 | 285 | idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); |
286 | 286 | return(d); |
… |
… |
|
686 | 686 | d->bigendianp=-1; /* We don't know yet... */ |
687 | 687 | d->nsectors=-1; |
688 | 688 | d->messagedest = messagedest; |
689 | | d->private=calloc(1,sizeof(*d->private)); |
| 689 | d->private_data=calloc(1,sizeof(*d->private_data)); |
690 | 690 | { |
691 | 691 | /* goddamnit */ |
692 | 692 | struct timespec tv; |
693 | | d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); |
| 693 | d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); |
694 | 694 | } |
695 | 695 | if(use_sgio){ |
696 | 696 | d->interface=SGIO_SCSI; |
697 | | d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); |
| 697 | d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); |
698 | 698 | g_fd=d->cdda_fd=dup(d->ioctl_fd); |
699 | 699 | }else{ |
700 | 700 | version=verify_SG_version(d,messagedest,messages); |
… |
… |
|
708 | 708 | } |
709 | 709 | |
710 | 710 | /* malloc our big buffer for scsi commands */ |
711 | | d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE); |
712 | | d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; |
| 711 | d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE); |
| 712 | d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; |
713 | 713 | } |
714 | 714 | |
715 | 715 | { |
… |
… |
|
784 | 784 | if(i_fd!=-1)close(i_fd); |
785 | 785 | if(g_fd!=-1)close(g_fd); |
786 | 786 | if(d){ |
787 | | if(d->private){ |
788 | | if(d->private->sg_hd)free(d->private->sg_hd); |
789 | | free(d->private); |
| 787 | if(d->private_data){ |
| 788 | if(d->private_data->sg_hd)free(d->private_data->sg_hd); |
| 789 | free(d->private_data); |
790 | 790 | } |
791 | 791 | free(d); |
792 | 792 | } |
… |
… |
|
835 | 835 | d->interface=TEST_INTERFACE; |
836 | 836 | d->bigendianp=-1; /* We don't know yet... */ |
837 | 837 | d->nsectors=-1; |
838 | | d->private=calloc(1,sizeof(*d->private)); |
| 838 | d->private_data=calloc(1,sizeof(*d->private_data)); |
839 | 839 | d->drive_model=copystring("File based test interface"); |
840 | 840 | idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model); |
841 | 841 | |
Only in cdparanoia-III-10.2-patched/interface: scan_devices.c.orig
diff -u -r cdparanoia-III-10.2/interface/scsi_interface.c cdparanoia-III-10.2-patched/interface/scsi_interface.c
old
|
new
|
|
17 | 17 | static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ |
18 | 18 | struct timespec tv1; |
19 | 19 | struct timespec tv2; |
20 | | int ret1=clock_gettime(d->private->clock,&tv1); |
| 20 | int ret1=clock_gettime(d->private_data->clock,&tv1); |
21 | 21 | int ret2=ioctl(fd, command,arg); |
22 | | int ret3=clock_gettime(d->private->clock,&tv2); |
| 22 | int ret3=clock_gettime(d->private_data->clock,&tv2); |
23 | 23 | if(ret1<0 || ret3<0){ |
24 | | d->private->last_milliseconds=-1; |
| 24 | d->private_data->last_milliseconds=-1; |
25 | 25 | }else{ |
26 | | d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; |
| 26 | d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; |
27 | 27 | } |
28 | 28 | return ret2; |
29 | 29 | } |
… |
… |
|
98 | 98 | static void clear_garbage(cdrom_drive *d){ |
99 | 99 | fd_set fdset; |
100 | 100 | struct timeval tv; |
101 | | struct sg_header *sg_hd=d->private->sg_hd; |
| 101 | struct sg_header *sg_hd=d->private_data->sg_hd; |
102 | 102 | int flag=0; |
103 | 103 | |
104 | 104 | /* clear out any possibly preexisting garbage */ |
… |
… |
|
187 | 187 | struct timespec tv2; |
188 | 188 | int tret1,tret2; |
189 | 189 | int status = 0; |
190 | | struct sg_header *sg_hd=d->private->sg_hd; |
| 190 | struct sg_header *sg_hd=d->private_data->sg_hd; |
191 | 191 | long writebytes=SG_OFF+cmd_len+in_size; |
192 | 192 | |
193 | 193 | /* generic scsi device services */ |
… |
… |
|
197 | 197 | |
198 | 198 | memset(sg_hd,0,sizeof(sg_hd)); |
199 | 199 | memset(sense_buffer,0,SG_MAX_SENSE); |
200 | | memcpy(d->private->sg_buffer,cmd,cmd_len+in_size); |
| 200 | memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size); |
201 | 201 | sg_hd->twelve_byte = cmd_len == 12; |
202 | 202 | sg_hd->result = 0; |
203 | 203 | sg_hd->reply_len = SG_OFF + out_size; |
… |
… |
|
211 | 211 | tell if the command failed. Scared yet? */ |
212 | 212 | |
213 | 213 | if(bytecheck && out_size>in_size){ |
214 | | memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); |
| 214 | memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); |
215 | 215 | /* the size does not remove cmd_len due to the way the kernel |
216 | 216 | driver copies buffers */ |
217 | 217 | writebytes+=(out_size-in_size); |
… |
… |
|
245 | 245 | } |
246 | 246 | |
247 | 247 | sigprocmask (SIG_BLOCK, &(d->sigset), NULL ); |
248 | | tret1=clock_gettime(d->private->clock,&tv1); |
| 248 | tret1=clock_gettime(d->private_data->clock,&tv1); |
249 | 249 | errno=0; |
250 | 250 | status = write(d->cdda_fd, sg_hd, writebytes ); |
251 | 251 | |
… |
… |
|
291 | 291 | } |
292 | 292 | } |
293 | 293 | |
294 | | tret2=clock_gettime(d->private->clock,&tv2); |
| 294 | tret2=clock_gettime(d->private_data->clock,&tv2); |
295 | 295 | errno=0; |
296 | 296 | status = read(d->cdda_fd, sg_hd, SG_OFF + out_size); |
297 | 297 | sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL ); |
… |
… |
|
315 | 315 | if(bytecheck && in_size+cmd_len<out_size){ |
316 | 316 | long i,flag=0; |
317 | 317 | for(i=in_size;i<out_size;i++) |
318 | | if(d->private->sg_buffer[i]!=bytefill){ |
| 318 | if(d->private_data->sg_buffer[i]!=bytefill){ |
319 | 319 | flag=1; |
320 | 320 | break; |
321 | 321 | } |
… |
… |
|
328 | 328 | |
329 | 329 | errno=0; |
330 | 330 | if(tret1<0 || tret2<0){ |
331 | | d->private->last_milliseconds=-1; |
| 331 | d->private_data->last_milliseconds=-1; |
332 | 332 | }else{ |
333 | | d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; |
| 333 | d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; |
334 | 334 | } |
335 | 335 | return(0); |
336 | 336 | } |
… |
… |
|
349 | 349 | |
350 | 350 | memset(&hdr,0,sizeof(hdr)); |
351 | 351 | memset(sense,0,sizeof(sense)); |
352 | | memcpy(d->private->sg_buffer,cmd+cmd_len,in_size); |
| 352 | memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size); |
353 | 353 | |
354 | 354 | hdr.cmdp = cmd; |
355 | 355 | hdr.cmd_len = cmd_len; |
… |
… |
|
357 | 357 | hdr.mx_sb_len = SG_MAX_SENSE; |
358 | 358 | hdr.timeout = 50000; |
359 | 359 | hdr.interface_id = 'S'; |
360 | | hdr.dxferp = d->private->sg_buffer; |
| 360 | hdr.dxferp = d->private_data->sg_buffer; |
361 | 361 | hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ |
362 | 362 | |
363 | 363 | /* scary buffer fill hack */ |
… |
… |
|
402 | 402 | if(bytecheck && in_size<out_size){ |
403 | 403 | long i,flag=0; |
404 | 404 | for(i=in_size;i<out_size;i++) |
405 | | if(d->private->sg_buffer[i]!=bytefill){ |
| 405 | if(d->private_data->sg_buffer[i]!=bytefill){ |
406 | 406 | flag=1; |
407 | 407 | break; |
408 | 408 | } |
… |
… |
|
414 | 414 | } |
415 | 415 | |
416 | 416 | /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */ |
417 | | /* d->private->last_milliseconds = hdr.duration; */ |
| 417 | /* d->private_data->last_milliseconds = hdr.duration; */ |
418 | 418 | |
419 | 419 | errno = 0; |
420 | 420 | return 0; |
… |
… |
|
447 | 447 | |
448 | 448 | handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense); |
449 | 449 | |
450 | | key = d->private->sg_buffer[2] & 0xf; |
451 | | ASC = d->private->sg_buffer[12]; |
452 | | ASCQ = d->private->sg_buffer[13]; |
| 450 | key = d->private_data->sg_buffer[2] & 0xf; |
| 451 | ASC = d->private_data->sg_buffer[12]; |
| 452 | ASCQ = d->private_data->sg_buffer[13]; |
453 | 453 | |
454 | 454 | if(key == 2 && ASC == 4 && ASCQ == 1) return 0; |
455 | 455 | return 1; |
… |
… |
|
494 | 494 | if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1); |
495 | 495 | |
496 | 496 | { |
497 | | unsigned char *b=d->private->sg_buffer; |
| 497 | unsigned char *b=d->private_data->sg_buffer; |
498 | 498 | if(b[0])return(1); /* Handles only up to 256 bytes */ |
499 | 499 | if(b[6])return(1); /* Handles only up to 256 bytes */ |
500 | 500 | |
… |
… |
|
606 | 606 | static unsigned int get_orig_sectorsize(cdrom_drive *d){ |
607 | 607 | if(mode_sense(d,12,0x01))return(-1); |
608 | 608 | |
609 | | d->orgdens = d->private->sg_buffer[4]; |
610 | | return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]); |
| 609 | d->orgdens = d->private_data->sg_buffer[4]; |
| 610 | return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]); |
611 | 611 | } |
612 | 612 | |
613 | 613 | /* switch CDROM scsi drives to given sector size */ |
… |
… |
|
666 | 666 | return(-4); |
667 | 667 | } |
668 | 668 | |
669 | | first=d->private->sg_buffer[2]; |
670 | | last=d->private->sg_buffer[3]; |
| 669 | first=d->private_data->sg_buffer[2]; |
| 670 | last=d->private_data->sg_buffer[3]; |
671 | 671 | tracks=last-first+1; |
672 | 672 | |
673 | 673 | if (last > MAXTRK || first > MAXTRK || last<0 || first<0) { |
… |
… |
|
685 | 685 | return(-5); |
686 | 686 | } |
687 | 687 | { |
688 | | scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); |
| 688 | scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); |
689 | 689 | |
690 | 690 | d->disc_toc[i-first].bFlags=toc->bFlags; |
691 | 691 | d->disc_toc[i-first].bTrack=i; |
… |
… |
|
706 | 706 | return(-2); |
707 | 707 | } |
708 | 708 | { |
709 | | scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4); |
| 709 | scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); |
710 | 710 | |
711 | 711 | d->disc_toc[i-first].bFlags=toc->bFlags; |
712 | 712 | d->disc_toc[i-first].bTrack=0xAA; |
… |
… |
|
740 | 740 | } |
741 | 741 | |
742 | 742 | /* copy to our structure and convert start sector */ |
743 | | tracks = d->private->sg_buffer[1]; |
| 743 | tracks = d->private_data->sg_buffer[1]; |
744 | 744 | if (tracks > MAXTRK) { |
745 | 745 | cderror(d,"003: CDROM reporting illegal number of tracks\n"); |
746 | 746 | return(-3); |
… |
… |
|
756 | 756 | return(-5); |
757 | 757 | } |
758 | 758 | |
759 | | d->disc_toc[i].bFlags = d->private->sg_buffer[10]; |
| 759 | d->disc_toc[i].bFlags = d->private_data->sg_buffer[10]; |
760 | 760 | d->disc_toc[i].bTrack = i + 1; |
761 | 761 | |
762 | 762 | d->disc_toc[i].dwStartSector= d->adjust_ssize * |
763 | | (((signed char)(d->private->sg_buffer[2])<<24) | |
764 | | (d->private->sg_buffer[3]<<16)| |
765 | | (d->private->sg_buffer[4]<<8)| |
766 | | (d->private->sg_buffer[5])); |
| 763 | (((signed char)(d->private_data->sg_buffer[2])<<24) | |
| 764 | (d->private_data->sg_buffer[3]<<16)| |
| 765 | (d->private_data->sg_buffer[4]<<8)| |
| 766 | (d->private_data->sg_buffer[5])); |
767 | 767 | } |
768 | 768 | |
769 | 769 | d->disc_toc[i].bFlags = 0; |
770 | 770 | d->disc_toc[i].bTrack = i + 1; |
771 | | memcpy (&foo, d->private->sg_buffer+2, 4); |
772 | | memcpy (&bar, d->private->sg_buffer+6, 4); |
| 771 | memcpy (&foo, d->private_data->sg_buffer+2, 4); |
| 772 | memcpy (&bar, d->private_data->sg_buffer+6, 4); |
773 | 773 | d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) + |
774 | 774 | be32_to_cpu(bar)); |
775 | 775 | |
776 | 776 | d->disc_toc[i].dwStartSector= d->adjust_ssize * |
777 | | ((((signed char)(d->private->sg_buffer[2])<<24) | |
778 | | (d->private->sg_buffer[3]<<16)| |
779 | | (d->private->sg_buffer[4]<<8)| |
780 | | (d->private->sg_buffer[5]))+ |
| 777 | ((((signed char)(d->private_data->sg_buffer[2])<<24) | |
| 778 | (d->private_data->sg_buffer[3]<<16)| |
| 779 | (d->private_data->sg_buffer[4]<<8)| |
| 780 | (d->private_data->sg_buffer[5]))+ |
781 | 781 | |
782 | | ((((signed char)(d->private->sg_buffer[6])<<24) | |
783 | | (d->private->sg_buffer[7]<<16)| |
784 | | (d->private->sg_buffer[8]<<8)| |
785 | | (d->private->sg_buffer[9])))); |
| 782 | ((((signed char)(d->private_data->sg_buffer[6])<<24) | |
| 783 | (d->private_data->sg_buffer[7]<<16)| |
| 784 | (d->private_data->sg_buffer[8]<<8)| |
| 785 | (d->private_data->sg_buffer[9])))); |
786 | 786 | |
787 | 787 | |
788 | 788 | d->cd_extra = FixupTOC(d,tracks+1); |
… |
… |
|
819 | 819 | cmd[8] = sectors; |
820 | 820 | if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
821 | 821 | return(ret); |
822 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 822 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
823 | 823 | return(0); |
824 | 824 | } |
825 | 825 | |
… |
… |
|
838 | 838 | cmd[9] = sectors; |
839 | 839 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
840 | 840 | return(ret); |
841 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 841 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
842 | 842 | return(0); |
843 | 843 | } |
844 | 844 | |
… |
… |
|
856 | 856 | cmd[8] = sectors; |
857 | 857 | if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
858 | 858 | return(ret); |
859 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 859 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
860 | 860 | return(0); |
861 | 861 | } |
862 | 862 | |
… |
… |
|
874 | 874 | cmd[9] = sectors; |
875 | 875 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
876 | 876 | return(ret); |
877 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 877 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
878 | 878 | return(0); |
879 | 879 | } |
880 | 880 | |
… |
… |
|
892 | 892 | cmd[8] = sectors; |
893 | 893 | if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
894 | 894 | return(ret); |
895 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 895 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
896 | 896 | return(0); |
897 | 897 | } |
898 | 898 | |
… |
… |
|
910 | 910 | cmd[9] = sectors; |
911 | 911 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
912 | 912 | return(ret); |
913 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 913 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
914 | 914 | return(0); |
915 | 915 | } |
916 | 916 | |
… |
… |
|
924 | 924 | cmd[8] = sectors; |
925 | 925 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
926 | 926 | return(ret); |
927 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 927 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
928 | 928 | return(0); |
929 | 929 | } |
930 | 930 | |
… |
… |
|
938 | 938 | cmd[8] = sectors; |
939 | 939 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
940 | 940 | return(ret); |
941 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 941 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
942 | 942 | return(0); |
943 | 943 | } |
944 | 944 | |
… |
… |
|
952 | 952 | cmd[8] = sectors; |
953 | 953 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
954 | 954 | return(ret); |
955 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 955 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
956 | 956 | return(0); |
957 | 957 | } |
958 | 958 | |
… |
… |
|
966 | 966 | cmd[8] = sectors; |
967 | 967 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
968 | 968 | return(ret); |
969 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 969 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
970 | 970 | return(0); |
971 | 971 | } |
972 | 972 | |
… |
… |
|
980 | 980 | cmd[8] = sectors; |
981 | 981 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
982 | 982 | return(ret); |
983 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 983 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
984 | 984 | return(0); |
985 | 985 | } |
986 | 986 | |
… |
… |
|
994 | 994 | cmd[8] = sectors; |
995 | 995 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
996 | 996 | return(ret); |
997 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 997 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
998 | 998 | return(0); |
999 | 999 | } |
1000 | 1000 | |
… |
… |
|
1028 | 1028 | |
1029 | 1029 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
1030 | 1030 | return(ret); |
1031 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 1031 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
1032 | 1032 | return(0); |
1033 | 1033 | } |
1034 | 1034 | |
… |
… |
|
1041 | 1041 | |
1042 | 1042 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
1043 | 1043 | return(ret); |
1044 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 1044 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
1045 | 1045 | return(0); |
1046 | 1046 | } |
1047 | 1047 | |
… |
… |
|
1054 | 1054 | |
1055 | 1055 | if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) |
1056 | 1056 | return(ret); |
1057 | | if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
| 1057 | if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); |
1058 | 1058 | return(0); |
1059 | 1059 | } |
1060 | 1060 | |
… |
… |
|
1277 | 1277 | static int count_2352_bytes(cdrom_drive *d){ |
1278 | 1278 | long i; |
1279 | 1279 | for(i=2351;i>=0;i--) |
1280 | | if(d->private->sg_buffer[i]!=(unsigned char)'\177') |
| 1280 | if(d->private_data->sg_buffer[i]!=(unsigned char)'\177') |
1281 | 1281 | return(((i+3)>>2)<<2); |
1282 | 1282 | |
1283 | 1283 | return(0); |
… |
… |
|
1286 | 1286 | static int verify_nonzero(cdrom_drive *d){ |
1287 | 1287 | long i,flag=0; |
1288 | 1288 | for(i=0;i<2352;i++) |
1289 | | if(d->private->sg_buffer[i]!=0){ |
| 1289 | if(d->private_data->sg_buffer[i]!=0){ |
1290 | 1290 | flag=1; |
1291 | 1291 | break; |
1292 | 1292 | } |
… |
… |
|
1627 | 1627 | d->is_mmc=0; |
1628 | 1628 | if(mode_sense(d,22,0x2A)==0){ |
1629 | 1629 | |
1630 | | b=d->private->sg_buffer; |
| 1630 | b=d->private_data->sg_buffer; |
1631 | 1631 | b+=b[3]+4; |
1632 | 1632 | |
1633 | 1633 | if((b[0]&0x3F)==0x2A){ |
… |
… |
|
1675 | 1675 | cderror(d,"008: Unable to identify CDROM model\n"); |
1676 | 1676 | return(NULL); |
1677 | 1677 | } |
1678 | | return (d->private->sg_buffer); |
| 1678 | return (d->private_data->sg_buffer); |
1679 | 1679 | } |
1680 | 1680 | |
1681 | 1681 | int scsi_init_drive(cdrom_drive *d){ |
… |
… |
|
1744 | 1744 | check_cache(d); |
1745 | 1745 | |
1746 | 1746 | d->error_retry=1; |
1747 | | d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); |
1748 | | d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF; |
| 1747 | d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); |
| 1748 | d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; |
1749 | 1749 | d->report_all=1; |
1750 | 1750 | return(0); |
1751 | 1751 | } |
Only in cdparanoia-III-10.2-patched/interface: scsi_interface.c.orig
diff -u -r cdparanoia-III-10.2/interface/test_interface.c cdparanoia-III-10.2-patched/interface/test_interface.c
old
|
new
|
|
66 | 66 | if(!fd)fd=fdopen(d->cdda_fd,"r"); |
67 | 67 | |
68 | 68 | if(begin<lastread) |
69 | | d->private->last_milliseconds=20; |
| 69 | d->private_data->last_milliseconds=20; |
70 | 70 | else |
71 | | d->private->last_milliseconds=sectors; |
| 71 | d->private_data->last_milliseconds=sectors; |
72 | 72 | |
73 | 73 | #ifdef CDDA_TEST_UNDERRUN |
74 | 74 | sectors-=1; |