Ticket #54654: 03-gcc4.3.patch
File 03-gcc4.3.patch, 18.3 KB (added by RJVB (René Bertin), 7 years ago) |
---|
-
interface/cdda_interface.h
Author: Monty <paranoia@xiph.org> Description: Changeset 15338: Commit fix for 'private' becoming a reserved keyword as of GCC 4.3+ (Closes: #499676).
a b 84 84 int is_atapi; 85 85 int is_mmc; 86 86 87 cdda_private_data_t *private ;87 cdda_private_data_t *private_data; 88 88 void *reserved; 89 89 unsigned char inqbytes[4]; 90 90 -
interface/cooked_interface.c
a b 13 13 static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){ 14 14 struct timespec tv1; 15 15 struct timespec tv2; 16 int ret1=clock_gettime(d->private ->clock,&tv1);16 int ret1=clock_gettime(d->private_data->clock,&tv1); 17 17 int ret2=ioctl(fd, command,arg); 18 int ret3=clock_gettime(d->private ->clock,&tv2);18 int ret3=clock_gettime(d->private_data->clock,&tv2); 19 19 if(ret1<0 || ret3<0){ 20 d->private ->last_milliseconds=-1;20 d->private_data->last_milliseconds=-1; 21 21 }else{ 22 d->private ->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;22 d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.; 23 23 } 24 24 return ret2; 25 25 } -
interface/interface.c
a b 39 39 if(d->drive_model)free(d->drive_model); 40 40 if(d->cdda_fd!=-1)close(d->cdda_fd); 41 41 if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd); 42 if(d->private ){43 if(d->private ->sg_hd)free(d->private->sg_hd);44 free(d->private );42 if(d->private_data){ 43 if(d->private_data->sg_hd)free(d->private_data->sg_hd); 44 free(d->private_data); 45 45 } 46 46 47 47 free(d); … … 127 127 } 128 128 } 129 129 } 130 if(ms)*ms=d->private ->last_milliseconds;130 if(ms)*ms=d->private_data->last_milliseconds; 131 131 return(sectors); 132 132 } 133 133 -
interface/scan_devices.c
a b 270 270 d->interface=COOKED_IOCTL; 271 271 d->bigendianp=-1; /* We don't know yet... */ 272 272 d->nsectors=-1; 273 d->private =calloc(1,sizeof(*d->private));273 d->private_data=calloc(1,sizeof(*d->private_data)); 274 274 { 275 275 /* goddamnit */ 276 276 struct timespec tv; 277 d->private ->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);277 d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); 278 278 } 279 279 idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description); 280 280 return(d); … … 680 680 d->bigendianp=-1; /* We don't know yet... */ 681 681 d->nsectors=-1; 682 682 d->messagedest = messagedest; 683 d->private =calloc(1,sizeof(*d->private));683 d->private_data=calloc(1,sizeof(*d->private_data)); 684 684 { 685 685 /* goddamnit */ 686 686 struct timespec tv; 687 d->private ->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);687 d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC); 688 688 } 689 689 if(use_sgio){ 690 690 d->interface=SGIO_SCSI; 691 d->private ->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE));691 d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE)); 692 692 g_fd=d->cdda_fd=dup(d->ioctl_fd); 693 693 }else{ 694 694 version=verify_SG_version(d,messagedest,messages); … … 702 702 } 703 703 704 704 /* malloc our big buffer for scsi commands */ 705 d->private ->sg_hd=malloc(MAX_BIG_BUFF_SIZE);706 d->private ->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;705 d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE); 706 d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; 707 707 } 708 708 709 709 { … … 778 778 if(i_fd!=-1)close(i_fd); 779 779 if(g_fd!=-1)close(g_fd); 780 780 if(d){ 781 if(d->private ){782 if(d->private ->sg_hd)free(d->private->sg_hd);783 free(d->private );781 if(d->private_data){ 782 if(d->private_data->sg_hd)free(d->private_data->sg_hd); 783 free(d->private_data); 784 784 } 785 785 free(d); 786 786 } … … 827 827 d->interface=TEST_INTERFACE; 828 828 d->bigendianp=-1; /* We don't know yet... */ 829 829 d->nsectors=-1; 830 d->private =calloc(1,sizeof(*d->private));830 d->private_data=calloc(1,sizeof(*d->private_data)); 831 831 d->drive_model=copystring("File based test interface"); 832 832 idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model); 833 833 -
interface/scsi_interface.c
a b 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 } … … 96 96 static void clear_garbage(cdrom_drive *d){ 97 97 fd_set fdset; 98 98 struct timeval tv; 99 struct sg_header *sg_hd=d->private ->sg_hd;99 struct sg_header *sg_hd=d->private_data->sg_hd; 100 100 int flag=0; 101 101 102 102 /* clear out any possibly preexisting garbage */ … … 185 185 struct timespec tv2; 186 186 int tret1,tret2; 187 187 int status = 0; 188 struct sg_header *sg_hd=d->private ->sg_hd;188 struct sg_header *sg_hd=d->private_data->sg_hd; 189 189 long writebytes=SG_OFF+cmd_len+in_size; 190 190 191 191 /* generic scsi device services */ … … 195 195 196 196 memset(sg_hd,0,sizeof(sg_hd)); 197 197 memset(sense_buffer,0,SG_MAX_SENSE); 198 memcpy(d->private ->sg_buffer,cmd,cmd_len+in_size);198 memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size); 199 199 sg_hd->twelve_byte = cmd_len == 12; 200 200 sg_hd->result = 0; 201 201 sg_hd->reply_len = SG_OFF + out_size; … … 209 209 tell if the command failed. Scared yet? */ 210 210 211 211 if(bytecheck && out_size>in_size){ 212 memset(d->private ->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);212 memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size); 213 213 /* the size does not remove cmd_len due to the way the kernel 214 214 driver copies buffers */ 215 215 writebytes+=(out_size-in_size); … … 243 243 } 244 244 245 245 sigprocmask (SIG_BLOCK, &(d->sigset), NULL ); 246 tret1=clock_gettime(d->private ->clock,&tv1);246 tret1=clock_gettime(d->private_data->clock,&tv1); 247 247 errno=0; 248 248 status = write(d->cdda_fd, sg_hd, writebytes ); 249 249 … … 289 289 } 290 290 } 291 291 292 tret2=clock_gettime(d->private ->clock,&tv2);292 tret2=clock_gettime(d->private_data->clock,&tv2); 293 293 errno=0; 294 294 status = read(d->cdda_fd, sg_hd, SG_OFF + out_size); 295 295 sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL ); … … 313 313 if(bytecheck && in_size+cmd_len<out_size){ 314 314 long i,flag=0; 315 315 for(i=in_size;i<out_size;i++) 316 if(d->private ->sg_buffer[i]!=bytefill){316 if(d->private_data->sg_buffer[i]!=bytefill){ 317 317 flag=1; 318 318 break; 319 319 } … … 326 326 327 327 errno=0; 328 328 if(tret1<0 || tret2<0){ 329 d->private ->last_milliseconds=-1;329 d->private_data->last_milliseconds=-1; 330 330 }else{ 331 d->private ->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;331 d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000; 332 332 } 333 333 return(0); 334 334 } … … 347 347 348 348 memset(&hdr,0,sizeof(hdr)); 349 349 memset(sense,0,sizeof(sense)); 350 memcpy(d->private ->sg_buffer,cmd+cmd_len,in_size);350 memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size); 351 351 352 352 hdr.cmdp = cmd; 353 353 hdr.cmd_len = cmd_len; … … 355 355 hdr.mx_sb_len = SG_MAX_SENSE; 356 356 hdr.timeout = 50000; 357 357 hdr.interface_id = 'S'; 358 hdr.dxferp = d->private ->sg_buffer;358 hdr.dxferp = d->private_data->sg_buffer; 359 359 hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */ 360 360 361 361 /* scary buffer fill hack */ … … 400 400 if(bytecheck && in_size<out_size){ 401 401 long i,flag=0; 402 402 for(i=in_size;i<out_size;i++) 403 if(d->private ->sg_buffer[i]!=bytefill){403 if(d->private_data->sg_buffer[i]!=bytefill){ 404 404 flag=1; 405 405 break; 406 406 } … … 412 412 } 413 413 414 414 /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */ 415 /* d->private ->last_milliseconds = hdr.duration; */415 /* d->private_data->last_milliseconds = hdr.duration; */ 416 416 417 417 errno = 0; 418 418 return 0; … … 445 445 446 446 handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense); 447 447 448 key = d->private ->sg_buffer[2] & 0xf;449 ASC = d->private ->sg_buffer[12];450 ASCQ = d->private ->sg_buffer[13];448 key = d->private_data->sg_buffer[2] & 0xf; 449 ASC = d->private_data->sg_buffer[12]; 450 ASCQ = d->private_data->sg_buffer[13]; 451 451 452 452 if(key == 2 && ASC == 4 && ASCQ == 1) return 0; 453 453 return 1; … … 492 492 if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1); 493 493 494 494 { 495 unsigned char *b=d->private ->sg_buffer;495 unsigned char *b=d->private_data->sg_buffer; 496 496 if(b[0])return(1); /* Handles only up to 256 bytes */ 497 497 if(b[6])return(1); /* Handles only up to 256 bytes */ 498 498 … … 604 604 static unsigned int get_orig_sectorsize(cdrom_drive *d){ 605 605 if(mode_sense(d,12,0x01))return(-1); 606 606 607 d->orgdens = d->private ->sg_buffer[4];608 return(d->orgsize = ((int)(d->private ->sg_buffer[10])<<8)+d->private->sg_buffer[11]);607 d->orgdens = d->private_data->sg_buffer[4]; 608 return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]); 609 609 } 610 610 611 611 /* switch CDROM scsi drives to given sector size */ … … 664 664 return(-4); 665 665 } 666 666 667 first=d->private ->sg_buffer[2];668 last=d->private ->sg_buffer[3];667 first=d->private_data->sg_buffer[2]; 668 last=d->private_data->sg_buffer[3]; 669 669 tracks=last-first+1; 670 670 671 671 if (last > MAXTRK || first > MAXTRK || last<0 || first<0) { … … 683 683 return(-5); 684 684 } 685 685 { 686 scsi_TOC *toc=(scsi_TOC *)(d->private ->sg_buffer+4);686 scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); 687 687 688 688 d->disc_toc[i-first].bFlags=toc->bFlags; 689 689 d->disc_toc[i-first].bTrack=i; … … 704 704 return(-2); 705 705 } 706 706 { 707 scsi_TOC *toc=(scsi_TOC *)(d->private ->sg_buffer+4);707 scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4); 708 708 709 709 d->disc_toc[i-first].bFlags=toc->bFlags; 710 710 d->disc_toc[i-first].bTrack=0xAA; … … 738 738 } 739 739 740 740 /* copy to our structure and convert start sector */ 741 tracks = d->private ->sg_buffer[1];741 tracks = d->private_data->sg_buffer[1]; 742 742 if (tracks > MAXTRK) { 743 743 cderror(d,"003: CDROM reporting illegal number of tracks\n"); 744 744 return(-3); … … 754 754 return(-5); 755 755 } 756 756 757 d->disc_toc[i].bFlags = d->private ->sg_buffer[10];757 d->disc_toc[i].bFlags = d->private_data->sg_buffer[10]; 758 758 d->disc_toc[i].bTrack = i + 1; 759 759 760 760 d->disc_toc[i].dwStartSector= d->adjust_ssize * 761 (((signed char)(d->private ->sg_buffer[2])<<24) |762 (d->private ->sg_buffer[3]<<16)|763 (d->private ->sg_buffer[4]<<8)|764 (d->private ->sg_buffer[5]));761 (((signed char)(d->private_data->sg_buffer[2])<<24) | 762 (d->private_data->sg_buffer[3]<<16)| 763 (d->private_data->sg_buffer[4]<<8)| 764 (d->private_data->sg_buffer[5])); 765 765 } 766 766 767 767 d->disc_toc[i].bFlags = 0; 768 768 d->disc_toc[i].bTrack = i + 1; 769 memcpy (&foo, d->private ->sg_buffer+2, 4);770 memcpy (&bar, d->private ->sg_buffer+6, 4);769 memcpy (&foo, d->private_data->sg_buffer+2, 4); 770 memcpy (&bar, d->private_data->sg_buffer+6, 4); 771 771 d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) + 772 772 be32_to_cpu(bar)); 773 773 774 774 d->disc_toc[i].dwStartSector= d->adjust_ssize * 775 ((((signed char)(d->private ->sg_buffer[2])<<24) |776 (d->private ->sg_buffer[3]<<16)|777 (d->private ->sg_buffer[4]<<8)|778 (d->private ->sg_buffer[5]))+775 ((((signed char)(d->private_data->sg_buffer[2])<<24) | 776 (d->private_data->sg_buffer[3]<<16)| 777 (d->private_data->sg_buffer[4]<<8)| 778 (d->private_data->sg_buffer[5]))+ 779 779 780 ((((signed char)(d->private ->sg_buffer[6])<<24) |781 (d->private ->sg_buffer[7]<<16)|782 (d->private ->sg_buffer[8]<<8)|783 (d->private ->sg_buffer[9]))));780 ((((signed char)(d->private_data->sg_buffer[6])<<24) | 781 (d->private_data->sg_buffer[7]<<16)| 782 (d->private_data->sg_buffer[8]<<8)| 783 (d->private_data->sg_buffer[9])))); 784 784 785 785 786 786 d->cd_extra = FixupTOC(d,tracks+1); … … 817 817 cmd[8] = sectors; 818 818 if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 819 819 return(ret); 820 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);820 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 821 821 return(0); 822 822 } 823 823 … … 836 836 cmd[9] = sectors; 837 837 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 838 838 return(ret); 839 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);839 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 840 840 return(0); 841 841 } 842 842 … … 854 854 cmd[8] = sectors; 855 855 if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 856 856 return(ret); 857 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);857 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 858 858 return(0); 859 859 } 860 860 … … 872 872 cmd[9] = sectors; 873 873 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 874 874 return(ret); 875 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);875 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 876 876 return(0); 877 877 } 878 878 … … 890 890 cmd[8] = sectors; 891 891 if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 892 892 return(ret); 893 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);893 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 894 894 return(0); 895 895 } 896 896 … … 908 908 cmd[9] = sectors; 909 909 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 910 910 return(ret); 911 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);911 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 912 912 return(0); 913 913 } 914 914 … … 922 922 cmd[8] = sectors; 923 923 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 924 924 return(ret); 925 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);925 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 926 926 return(0); 927 927 } 928 928 … … 936 936 cmd[8] = sectors; 937 937 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 938 938 return(ret); 939 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);939 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 940 940 return(0); 941 941 } 942 942 … … 950 950 cmd[8] = sectors; 951 951 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 952 952 return(ret); 953 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);953 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 954 954 return(0); 955 955 } 956 956 … … 964 964 cmd[8] = sectors; 965 965 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 966 966 return(ret); 967 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);967 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 968 968 return(0); 969 969 } 970 970 … … 978 978 cmd[8] = sectors; 979 979 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 980 980 return(ret); 981 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);981 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 982 982 return(0); 983 983 } 984 984 … … 992 992 cmd[8] = sectors; 993 993 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 994 994 return(ret); 995 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);995 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 996 996 return(0); 997 997 } 998 998 … … 1026 1026 1027 1027 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 1028 1028 return(ret); 1029 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);1029 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 1030 1030 return(0); 1031 1031 } 1032 1032 … … 1039 1039 1040 1040 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 1041 1041 return(ret); 1042 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);1042 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 1043 1043 return(0); 1044 1044 } 1045 1045 … … 1052 1052 1053 1053 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense))) 1054 1054 return(ret); 1055 if(p)memcpy(p,d->private ->sg_buffer,sectors*CD_FRAMESIZE_RAW);1055 if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW); 1056 1056 return(0); 1057 1057 } 1058 1058 … … 1275 1275 static int count_2352_bytes(cdrom_drive *d){ 1276 1276 long i; 1277 1277 for(i=2351;i>=0;i--) 1278 if(d->private ->sg_buffer[i]!=(unsigned char)'\177')1278 if(d->private_data->sg_buffer[i]!=(unsigned char)'\177') 1279 1279 return(((i+3)>>2)<<2); 1280 1280 1281 1281 return(0); … … 1284 1284 static int verify_nonzero(cdrom_drive *d){ 1285 1285 long i,flag=0; 1286 1286 for(i=0;i<2352;i++) 1287 if(d->private ->sg_buffer[i]!=0){1287 if(d->private_data->sg_buffer[i]!=0){ 1288 1288 flag=1; 1289 1289 break; 1290 1290 } … … 1625 1625 d->is_mmc=0; 1626 1626 if(mode_sense(d,22,0x2A)==0){ 1627 1627 1628 b=d->private ->sg_buffer;1628 b=d->private_data->sg_buffer; 1629 1629 b+=b[3]+4; 1630 1630 1631 1631 if((b[0]&0x3F)==0x2A){ … … 1673 1673 cderror(d,"008: Unable to identify CDROM model\n"); 1674 1674 return(NULL); 1675 1675 } 1676 return (d->private ->sg_buffer);1676 return (d->private_data->sg_buffer); 1677 1677 } 1678 1678 1679 1679 int scsi_init_drive(cdrom_drive *d){ … … 1742 1742 check_cache(d); 1743 1743 1744 1744 d->error_retry=1; 1745 d->private ->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);1746 d->private ->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;1745 d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128); 1746 d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF; 1747 1747 d->report_all=1; 1748 1748 return(0); 1749 1749 } -
interface/test_interface.c
a b 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;