wok-next annotate cdparanoia-III/stuff/patches/cdparanoia-III-10.2-gcc_fixes-1.patch @ rev 20653

Add grub2-efi-modules (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri May 04 11:41:20 2018 +0200 (2018-05-04)
parents
children
rev   line source
al@19804 1 Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
al@19804 2 Date: 2008-12-03
al@19804 3 Initial Package Version: III-10.2
al@19804 4 Upstream Status: unknown
al@19804 5 Origin: gentoo, who describe it as a gcc-4.3 patch
al@19804 6 Description: Renames a variable from 'private' to 'private_data'. This is
al@19804 7 apparently intended to allow the package to be compiled with gcc-4.3 and later.
al@19804 8 The header file cdda_interface.h is used by c++ code in kdemultimedia-4.1.2
al@19804 9 which barfs on the use of private _even_in_g++-4.2.2_.
al@19804 10
al@19804 11 diff -urp cdparanoia-III-10.2.orig/interface/cdda_interface.h cdparanoia-III-10.2/interface/cdda_interface.h
al@19804 12 --- cdparanoia-III-10.2.orig/interface/cdda_interface.h 2008-09-11 11:43:52.000000000 +0100
al@19804 13 +++ cdparanoia-III-10.2/interface/cdda_interface.h 2008-09-25 00:18:02.000000000 +0100
al@19804 14 @@ -84,7 +84,7 @@ typedef struct cdrom_drive{
al@19804 15 int is_atapi;
al@19804 16 int is_mmc;
al@19804 17
al@19804 18 - cdda_private_data_t *private;
al@19804 19 + cdda_private_data_t *private_data;
al@19804 20 void *reserved;
al@19804 21 unsigned char inqbytes[4];
al@19804 22
al@19804 23 diff -urp cdparanoia-III-10.2.orig/interface/cooked_interface.c cdparanoia-III-10.2/interface/cooked_interface.c
al@19804 24 --- cdparanoia-III-10.2.orig/interface/cooked_interface.c 2008-08-26 10:55:22.000000000 +0100
al@19804 25 +++ cdparanoia-III-10.2/interface/cooked_interface.c 2008-09-25 00:19:21.000000000 +0100
al@19804 26 @@ -13,13 +13,13 @@
al@19804 27 static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){
al@19804 28 struct timespec tv1;
al@19804 29 struct timespec tv2;
al@19804 30 - int ret1=clock_gettime(d->private->clock,&tv1);
al@19804 31 + int ret1=clock_gettime(d->private_data->clock,&tv1);
al@19804 32 int ret2=ioctl(fd, command,arg);
al@19804 33 - int ret3=clock_gettime(d->private->clock,&tv2);
al@19804 34 + int ret3=clock_gettime(d->private_data->clock,&tv2);
al@19804 35 if(ret1<0 || ret3<0){
al@19804 36 - d->private->last_milliseconds=-1;
al@19804 37 + d->private_data->last_milliseconds=-1;
al@19804 38 }else{
al@19804 39 - d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
al@19804 40 + d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
al@19804 41 }
al@19804 42 return ret2;
al@19804 43 }
al@19804 44 diff -urp cdparanoia-III-10.2.orig/interface/interface.c cdparanoia-III-10.2/interface/interface.c
al@19804 45 --- cdparanoia-III-10.2.orig/interface/interface.c 2008-09-11 11:43:52.000000000 +0100
al@19804 46 +++ cdparanoia-III-10.2/interface/interface.c 2008-09-25 00:19:47.000000000 +0100
al@19804 47 @@ -39,9 +39,9 @@ int cdda_close(cdrom_drive *d){
al@19804 48 if(d->drive_model)free(d->drive_model);
al@19804 49 if(d->cdda_fd!=-1)close(d->cdda_fd);
al@19804 50 if(d->ioctl_fd!=-1 && d->ioctl_fd!=d->cdda_fd)close(d->ioctl_fd);
al@19804 51 - if(d->private){
al@19804 52 - if(d->private->sg_hd)free(d->private->sg_hd);
al@19804 53 - free(d->private);
al@19804 54 + if(d->private_data){
al@19804 55 + if(d->private_data->sg_hd)free(d->private_data->sg_hd);
al@19804 56 + free(d->private_data);
al@19804 57 }
al@19804 58
al@19804 59 free(d);
al@19804 60 @@ -127,7 +127,7 @@ long cdda_read_timed(cdrom_drive *d, voi
al@19804 61 }
al@19804 62 }
al@19804 63 }
al@19804 64 - if(ms)*ms=d->private->last_milliseconds;
al@19804 65 + if(ms)*ms=d->private_data->last_milliseconds;
al@19804 66 return(sectors);
al@19804 67 }
al@19804 68
al@19804 69 diff -urp cdparanoia-III-10.2.orig/interface/scan_devices.c cdparanoia-III-10.2/interface/scan_devices.c
al@19804 70 --- cdparanoia-III-10.2.orig/interface/scan_devices.c 2008-08-26 10:55:22.000000000 +0100
al@19804 71 +++ cdparanoia-III-10.2/interface/scan_devices.c 2008-09-25 00:20:35.000000000 +0100
al@19804 72 @@ -264,11 +264,11 @@ cdrom_drive *cdda_identify_cooked(const
al@19804 73 d->interface=COOKED_IOCTL;
al@19804 74 d->bigendianp=-1; /* We don't know yet... */
al@19804 75 d->nsectors=-1;
al@19804 76 - d->private=calloc(1,sizeof(*d->private));
al@19804 77 + d->private_data=calloc(1,sizeof(*d->private_data));
al@19804 78 {
al@19804 79 /* goddamnit */
al@19804 80 struct timespec tv;
al@19804 81 - d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
al@19804 82 + d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
al@19804 83 }
al@19804 84 idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",description);
al@19804 85 return(d);
al@19804 86 @@ -674,15 +674,15 @@ cdrom_drive *cdda_identify_scsi(const ch
al@19804 87 d->bigendianp=-1; /* We don't know yet... */
al@19804 88 d->nsectors=-1;
al@19804 89 d->messagedest = messagedest;
al@19804 90 - d->private=calloc(1,sizeof(*d->private));
al@19804 91 + d->private_data=calloc(1,sizeof(*d->private_data));
al@19804 92 {
al@19804 93 /* goddamnit */
al@19804 94 struct timespec tv;
al@19804 95 - d->private->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
al@19804 96 + d->private_data->clock=(clock_gettime(CLOCK_MONOTONIC,&tv)<0?CLOCK_REALTIME:CLOCK_MONOTONIC);
al@19804 97 }
al@19804 98 if(use_sgio){
al@19804 99 d->interface=SGIO_SCSI;
al@19804 100 - d->private->sg_buffer=(unsigned char *)(d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE));
al@19804 101 + d->private_data->sg_buffer=(unsigned char *)(d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE));
al@19804 102 g_fd=d->cdda_fd=dup(d->ioctl_fd);
al@19804 103 }else{
al@19804 104 version=verify_SG_version(d,messagedest,messages);
al@19804 105 @@ -696,8 +696,8 @@ cdrom_drive *cdda_identify_scsi(const ch
al@19804 106 }
al@19804 107
al@19804 108 /* malloc our big buffer for scsi commands */
al@19804 109 - d->private->sg_hd=malloc(MAX_BIG_BUFF_SIZE);
al@19804 110 - d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;
al@19804 111 + d->private_data->sg_hd=malloc(MAX_BIG_BUFF_SIZE);
al@19804 112 + d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF;
al@19804 113 }
al@19804 114
al@19804 115 {
al@19804 116 @@ -772,9 +772,9 @@ cdda_identify_scsi_fail:
al@19804 117 if(i_fd!=-1)close(i_fd);
al@19804 118 if(g_fd!=-1)close(g_fd);
al@19804 119 if(d){
al@19804 120 - if(d->private){
al@19804 121 - if(d->private->sg_hd)free(d->private->sg_hd);
al@19804 122 - free(d->private);
al@19804 123 + if(d->private_data){
al@19804 124 + if(d->private_data->sg_hd)free(d->private_data->sg_hd);
al@19804 125 + free(d->private_data);
al@19804 126 }
al@19804 127 free(d);
al@19804 128 }
al@19804 129 @@ -821,7 +821,7 @@ cdrom_drive *cdda_identify_test(const ch
al@19804 130 d->interface=TEST_INTERFACE;
al@19804 131 d->bigendianp=-1; /* We don't know yet... */
al@19804 132 d->nsectors=-1;
al@19804 133 - d->private=calloc(1,sizeof(*d->private));
al@19804 134 + d->private_data=calloc(1,sizeof(*d->private_data));
al@19804 135 d->drive_model=copystring("File based test interface");
al@19804 136 idmessage(messagedest,messages,"\t\tCDROM sensed: %s\n",d->drive_model);
al@19804 137
al@19804 138 diff -urp cdparanoia-III-10.2.orig/interface/scsi_interface.c cdparanoia-III-10.2/interface/scsi_interface.c
al@19804 139 --- cdparanoia-III-10.2.orig/interface/scsi_interface.c 2008-09-11 21:33:30.000000000 +0100
al@19804 140 +++ cdparanoia-III-10.2/interface/scsi_interface.c 2008-09-25 00:22:40.000000000 +0100
al@19804 141 @@ -15,13 +15,13 @@
al@19804 142 static int timed_ioctl(cdrom_drive *d, int fd, int command, void *arg){
al@19804 143 struct timespec tv1;
al@19804 144 struct timespec tv2;
al@19804 145 - int ret1=clock_gettime(d->private->clock,&tv1);
al@19804 146 + int ret1=clock_gettime(d->private_data->clock,&tv1);
al@19804 147 int ret2=ioctl(fd, command,arg);
al@19804 148 - int ret3=clock_gettime(d->private->clock,&tv2);
al@19804 149 + int ret3=clock_gettime(d->private_data->clock,&tv2);
al@19804 150 if(ret1<0 || ret3<0){
al@19804 151 - d->private->last_milliseconds=-1;
al@19804 152 + d->private_data->last_milliseconds=-1;
al@19804 153 }else{
al@19804 154 - d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
al@19804 155 + d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000. + (tv2.tv_nsec-tv1.tv_nsec)/1000000.;
al@19804 156 }
al@19804 157 return ret2;
al@19804 158 }
al@19804 159 @@ -96,7 +96,7 @@ static void tweak_SG_buffer(cdrom_drive
al@19804 160 static void clear_garbage(cdrom_drive *d){
al@19804 161 fd_set fdset;
al@19804 162 struct timeval tv;
al@19804 163 - struct sg_header *sg_hd=d->private->sg_hd;
al@19804 164 + struct sg_header *sg_hd=d->private_data->sg_hd;
al@19804 165 int flag=0;
al@19804 166
al@19804 167 /* clear out any possibly preexisting garbage */
al@19804 168 @@ -185,7 +185,7 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 169 struct timespec tv2;
al@19804 170 int tret1,tret2;
al@19804 171 int status = 0;
al@19804 172 - struct sg_header *sg_hd=d->private->sg_hd;
al@19804 173 + struct sg_header *sg_hd=d->private_data->sg_hd;
al@19804 174 long writebytes=SG_OFF+cmd_len+in_size;
al@19804 175
al@19804 176 /* generic scsi device services */
al@19804 177 @@ -195,7 +195,7 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 178
al@19804 179 memset(sg_hd,0,sizeof(sg_hd));
al@19804 180 memset(sense_buffer,0,SG_MAX_SENSE);
al@19804 181 - memcpy(d->private->sg_buffer,cmd,cmd_len+in_size);
al@19804 182 + memcpy(d->private_data->sg_buffer,cmd,cmd_len+in_size);
al@19804 183 sg_hd->twelve_byte = cmd_len == 12;
al@19804 184 sg_hd->result = 0;
al@19804 185 sg_hd->reply_len = SG_OFF + out_size;
al@19804 186 @@ -209,7 +209,7 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 187 tell if the command failed. Scared yet? */
al@19804 188
al@19804 189 if(bytecheck && out_size>in_size){
al@19804 190 - memset(d->private->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);
al@19804 191 + memset(d->private_data->sg_buffer+cmd_len+in_size,bytefill,out_size-in_size);
al@19804 192 /* the size does not remove cmd_len due to the way the kernel
al@19804 193 driver copies buffers */
al@19804 194 writebytes+=(out_size-in_size);
al@19804 195 @@ -243,7 +243,7 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 196 }
al@19804 197
al@19804 198 sigprocmask (SIG_BLOCK, &(d->sigset), NULL );
al@19804 199 - tret1=clock_gettime(d->private->clock,&tv1);
al@19804 200 + tret1=clock_gettime(d->private_data->clock,&tv1);
al@19804 201 errno=0;
al@19804 202 status = write(d->cdda_fd, sg_hd, writebytes );
al@19804 203
al@19804 204 @@ -289,7 +289,7 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 205 }
al@19804 206 }
al@19804 207
al@19804 208 - tret2=clock_gettime(d->private->clock,&tv2);
al@19804 209 + tret2=clock_gettime(d->private_data->clock,&tv2);
al@19804 210 errno=0;
al@19804 211 status = read(d->cdda_fd, sg_hd, SG_OFF + out_size);
al@19804 212 sigprocmask ( SIG_UNBLOCK, &(d->sigset), NULL );
al@19804 213 @@ -313,7 +313,7 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 214 if(bytecheck && in_size+cmd_len<out_size){
al@19804 215 long i,flag=0;
al@19804 216 for(i=in_size;i<out_size;i++)
al@19804 217 - if(d->private->sg_buffer[i]!=bytefill){
al@19804 218 + if(d->private_data->sg_buffer[i]!=bytefill){
al@19804 219 flag=1;
al@19804 220 break;
al@19804 221 }
al@19804 222 @@ -326,9 +326,9 @@ static int sg2_handle_scsi_cmd(cdrom_dri
al@19804 223
al@19804 224 errno=0;
al@19804 225 if(tret1<0 || tret2<0){
al@19804 226 - d->private->last_milliseconds=-1;
al@19804 227 + d->private_data->last_milliseconds=-1;
al@19804 228 }else{
al@19804 229 - d->private->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;
al@19804 230 + d->private_data->last_milliseconds = (tv2.tv_sec-tv1.tv_sec)*1000 + (tv2.tv_nsec-tv1.tv_nsec)/1000000;
al@19804 231 }
al@19804 232 return(0);
al@19804 233 }
al@19804 234 @@ -347,7 +347,7 @@ static int sgio_handle_scsi_cmd(cdrom_dr
al@19804 235
al@19804 236 memset(&hdr,0,sizeof(hdr));
al@19804 237 memset(sense,0,sizeof(sense));
al@19804 238 - memcpy(d->private->sg_buffer,cmd+cmd_len,in_size);
al@19804 239 + memcpy(d->private_data->sg_buffer,cmd+cmd_len,in_size);
al@19804 240
al@19804 241 hdr.cmdp = cmd;
al@19804 242 hdr.cmd_len = cmd_len;
al@19804 243 @@ -355,7 +355,7 @@ static int sgio_handle_scsi_cmd(cdrom_dr
al@19804 244 hdr.mx_sb_len = SG_MAX_SENSE;
al@19804 245 hdr.timeout = 50000;
al@19804 246 hdr.interface_id = 'S';
al@19804 247 - hdr.dxferp = d->private->sg_buffer;
al@19804 248 + hdr.dxferp = d->private_data->sg_buffer;
al@19804 249 hdr.flags = SG_FLAG_DIRECT_IO; /* direct IO if we can get it */
al@19804 250
al@19804 251 /* scary buffer fill hack */
al@19804 252 @@ -400,7 +400,7 @@ static int sgio_handle_scsi_cmd(cdrom_dr
al@19804 253 if(bytecheck && in_size<out_size){
al@19804 254 long i,flag=0;
al@19804 255 for(i=in_size;i<out_size;i++)
al@19804 256 - if(d->private->sg_buffer[i]!=bytefill){
al@19804 257 + if(d->private_data->sg_buffer[i]!=bytefill){
al@19804 258 flag=1;
al@19804 259 break;
al@19804 260 }
al@19804 261 @@ -412,7 +412,7 @@ static int sgio_handle_scsi_cmd(cdrom_dr
al@19804 262 }
al@19804 263
al@19804 264 /* Can't rely on .duration because we can't be certain kernel has HZ set to something useful */
al@19804 265 - /* d->private->last_milliseconds = hdr.duration; */
al@19804 266 + /* d->private_data->last_milliseconds = hdr.duration; */
al@19804 267
al@19804 268 errno = 0;
al@19804 269 return 0;
al@19804 270 @@ -445,9 +445,9 @@ static int test_unit_ready(cdrom_drive *
al@19804 271
al@19804 272 handle_scsi_cmd(d, cmd, 6, 0, 56, 0,0, sense);
al@19804 273
al@19804 274 - key = d->private->sg_buffer[2] & 0xf;
al@19804 275 - ASC = d->private->sg_buffer[12];
al@19804 276 - ASCQ = d->private->sg_buffer[13];
al@19804 277 + key = d->private_data->sg_buffer[2] & 0xf;
al@19804 278 + ASC = d->private_data->sg_buffer[12];
al@19804 279 + ASCQ = d->private_data->sg_buffer[13];
al@19804 280
al@19804 281 if(key == 2 && ASC == 4 && ASCQ == 1) return 0;
al@19804 282 return 1;
al@19804 283 @@ -492,7 +492,7 @@ static int mode_sense_atapi(cdrom_drive
al@19804 284 if (handle_scsi_cmd (d, cmd, 10, 0, size+4,'\377',1,sense)) return(1);
al@19804 285
al@19804 286 {
al@19804 287 - unsigned char *b=d->private->sg_buffer;
al@19804 288 + unsigned char *b=d->private_data->sg_buffer;
al@19804 289 if(b[0])return(1); /* Handles only up to 256 bytes */
al@19804 290 if(b[6])return(1); /* Handles only up to 256 bytes */
al@19804 291
al@19804 292 @@ -604,8 +604,8 @@ static int mode_select(cdrom_drive *d,in
al@19804 293 static unsigned int get_orig_sectorsize(cdrom_drive *d){
al@19804 294 if(mode_sense(d,12,0x01))return(-1);
al@19804 295
al@19804 296 - d->orgdens = d->private->sg_buffer[4];
al@19804 297 - return(d->orgsize = ((int)(d->private->sg_buffer[10])<<8)+d->private->sg_buffer[11]);
al@19804 298 + d->orgdens = d->private_data->sg_buffer[4];
al@19804 299 + return(d->orgsize = ((int)(d->private_data->sg_buffer[10])<<8)+d->private_data->sg_buffer[11]);
al@19804 300 }
al@19804 301
al@19804 302 /* switch CDROM scsi drives to given sector size */
al@19804 303 @@ -664,8 +664,8 @@ static int scsi_read_toc (cdrom_drive *d
al@19804 304 return(-4);
al@19804 305 }
al@19804 306
al@19804 307 - first=d->private->sg_buffer[2];
al@19804 308 - last=d->private->sg_buffer[3];
al@19804 309 + first=d->private_data->sg_buffer[2];
al@19804 310 + last=d->private_data->sg_buffer[3];
al@19804 311 tracks=last-first+1;
al@19804 312
al@19804 313 if (last > MAXTRK || first > MAXTRK || last<0 || first<0) {
al@19804 314 @@ -683,7 +683,7 @@ static int scsi_read_toc (cdrom_drive *d
al@19804 315 return(-5);
al@19804 316 }
al@19804 317 {
al@19804 318 - scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4);
al@19804 319 + scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4);
al@19804 320
al@19804 321 d->disc_toc[i-first].bFlags=toc->bFlags;
al@19804 322 d->disc_toc[i-first].bTrack=i;
al@19804 323 @@ -704,7 +704,7 @@ static int scsi_read_toc (cdrom_drive *d
al@19804 324 return(-2);
al@19804 325 }
al@19804 326 {
al@19804 327 - scsi_TOC *toc=(scsi_TOC *)(d->private->sg_buffer+4);
al@19804 328 + scsi_TOC *toc=(scsi_TOC *)(d->private_data->sg_buffer+4);
al@19804 329
al@19804 330 d->disc_toc[i-first].bFlags=toc->bFlags;
al@19804 331 d->disc_toc[i-first].bTrack=0xAA;
al@19804 332 @@ -738,7 +738,7 @@ static int scsi_read_toc2 (cdrom_drive *
al@19804 333 }
al@19804 334
al@19804 335 /* copy to our structure and convert start sector */
al@19804 336 - tracks = d->private->sg_buffer[1];
al@19804 337 + tracks = d->private_data->sg_buffer[1];
al@19804 338 if (tracks > MAXTRK) {
al@19804 339 cderror(d,"003: CDROM reporting illegal number of tracks\n");
al@19804 340 return(-3);
al@19804 341 @@ -754,33 +754,33 @@ static int scsi_read_toc2 (cdrom_drive *
al@19804 342 return(-5);
al@19804 343 }
al@19804 344
al@19804 345 - d->disc_toc[i].bFlags = d->private->sg_buffer[10];
al@19804 346 + d->disc_toc[i].bFlags = d->private_data->sg_buffer[10];
al@19804 347 d->disc_toc[i].bTrack = i + 1;
al@19804 348
al@19804 349 d->disc_toc[i].dwStartSector= d->adjust_ssize *
al@19804 350 - (((signed char)(d->private->sg_buffer[2])<<24) |
al@19804 351 - (d->private->sg_buffer[3]<<16)|
al@19804 352 - (d->private->sg_buffer[4]<<8)|
al@19804 353 - (d->private->sg_buffer[5]));
al@19804 354 + (((signed char)(d->private_data->sg_buffer[2])<<24) |
al@19804 355 + (d->private_data->sg_buffer[3]<<16)|
al@19804 356 + (d->private_data->sg_buffer[4]<<8)|
al@19804 357 + (d->private_data->sg_buffer[5]));
al@19804 358 }
al@19804 359
al@19804 360 d->disc_toc[i].bFlags = 0;
al@19804 361 d->disc_toc[i].bTrack = i + 1;
al@19804 362 - memcpy (&foo, d->private->sg_buffer+2, 4);
al@19804 363 - memcpy (&bar, d->private->sg_buffer+6, 4);
al@19804 364 + memcpy (&foo, d->private_data->sg_buffer+2, 4);
al@19804 365 + memcpy (&bar, d->private_data->sg_buffer+6, 4);
al@19804 366 d->disc_toc[i].dwStartSector = d->adjust_ssize * (be32_to_cpu(foo) +
al@19804 367 be32_to_cpu(bar));
al@19804 368
al@19804 369 d->disc_toc[i].dwStartSector= d->adjust_ssize *
al@19804 370 - ((((signed char)(d->private->sg_buffer[2])<<24) |
al@19804 371 - (d->private->sg_buffer[3]<<16)|
al@19804 372 - (d->private->sg_buffer[4]<<8)|
al@19804 373 - (d->private->sg_buffer[5]))+
al@19804 374 + ((((signed char)(d->private_data->sg_buffer[2])<<24) |
al@19804 375 + (d->private_data->sg_buffer[3]<<16)|
al@19804 376 + (d->private_data->sg_buffer[4]<<8)|
al@19804 377 + (d->private_data->sg_buffer[5]))+
al@19804 378
al@19804 379 - ((((signed char)(d->private->sg_buffer[6])<<24) |
al@19804 380 - (d->private->sg_buffer[7]<<16)|
al@19804 381 - (d->private->sg_buffer[8]<<8)|
al@19804 382 - (d->private->sg_buffer[9]))));
al@19804 383 + ((((signed char)(d->private_data->sg_buffer[6])<<24) |
al@19804 384 + (d->private_data->sg_buffer[7]<<16)|
al@19804 385 + (d->private_data->sg_buffer[8]<<8)|
al@19804 386 + (d->private_data->sg_buffer[9]))));
al@19804 387
al@19804 388
al@19804 389 d->cd_extra = FixupTOC(d,tracks+1);
al@19804 390 @@ -817,7 +817,7 @@ static int i_read_28 (cdrom_drive *d, vo
al@19804 391 cmd[8] = sectors;
al@19804 392 if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 393 return(ret);
al@19804 394 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 395 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 396 return(0);
al@19804 397 }
al@19804 398
al@19804 399 @@ -836,7 +836,7 @@ static int i_read_A8 (cdrom_drive *d, vo
al@19804 400 cmd[9] = sectors;
al@19804 401 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 402 return(ret);
al@19804 403 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 404 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 405 return(0);
al@19804 406 }
al@19804 407
al@19804 408 @@ -854,7 +854,7 @@ static int i_read_D4_10 (cdrom_drive *d,
al@19804 409 cmd[8] = sectors;
al@19804 410 if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 411 return(ret);
al@19804 412 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 413 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 414 return(0);
al@19804 415 }
al@19804 416
al@19804 417 @@ -872,7 +872,7 @@ static int i_read_D4_12 (cdrom_drive *d,
al@19804 418 cmd[9] = sectors;
al@19804 419 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 420 return(ret);
al@19804 421 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 422 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 423 return(0);
al@19804 424 }
al@19804 425
al@19804 426 @@ -890,7 +890,7 @@ static int i_read_D5 (cdrom_drive *d, vo
al@19804 427 cmd[8] = sectors;
al@19804 428 if((ret=handle_scsi_cmd(d,cmd,10,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 429 return(ret);
al@19804 430 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 431 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 432 return(0);
al@19804 433 }
al@19804 434
al@19804 435 @@ -908,7 +908,7 @@ static int i_read_D8 (cdrom_drive *d, vo
al@19804 436 cmd[9] = sectors;
al@19804 437 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 438 return(ret);
al@19804 439 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 440 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 441 return(0);
al@19804 442 }
al@19804 443
al@19804 444 @@ -922,7 +922,7 @@ static int i_read_mmc (cdrom_drive *d, v
al@19804 445 cmd[8] = sectors;
al@19804 446 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 447 return(ret);
al@19804 448 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 449 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 450 return(0);
al@19804 451 }
al@19804 452
al@19804 453 @@ -936,7 +936,7 @@ static int i_read_mmcB (cdrom_drive *d,
al@19804 454 cmd[8] = sectors;
al@19804 455 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 456 return(ret);
al@19804 457 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 458 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 459 return(0);
al@19804 460 }
al@19804 461
al@19804 462 @@ -950,7 +950,7 @@ static int i_read_mmc2 (cdrom_drive *d,
al@19804 463 cmd[8] = sectors;
al@19804 464 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 465 return(ret);
al@19804 466 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 467 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 468 return(0);
al@19804 469 }
al@19804 470
al@19804 471 @@ -964,7 +964,7 @@ static int i_read_mmc2B (cdrom_drive *d,
al@19804 472 cmd[8] = sectors;
al@19804 473 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 474 return(ret);
al@19804 475 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 476 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 477 return(0);
al@19804 478 }
al@19804 479
al@19804 480 @@ -978,7 +978,7 @@ static int i_read_mmc3 (cdrom_drive *d,
al@19804 481 cmd[8] = sectors;
al@19804 482 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 483 return(ret);
al@19804 484 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 485 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 486 return(0);
al@19804 487 }
al@19804 488
al@19804 489 @@ -992,7 +992,7 @@ static int i_read_mmc3B (cdrom_drive *d,
al@19804 490 cmd[8] = sectors;
al@19804 491 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 492 return(ret);
al@19804 493 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 494 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 495 return(0);
al@19804 496 }
al@19804 497
al@19804 498 @@ -1026,7 +1026,7 @@ static int i_read_msf (cdrom_drive *d, v
al@19804 499
al@19804 500 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 501 return(ret);
al@19804 502 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 503 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 504 return(0);
al@19804 505 }
al@19804 506
al@19804 507 @@ -1039,7 +1039,7 @@ static int i_read_msf2 (cdrom_drive *d,
al@19804 508
al@19804 509 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 510 return(ret);
al@19804 511 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 512 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 513 return(0);
al@19804 514 }
al@19804 515
al@19804 516 @@ -1052,7 +1052,7 @@ static int i_read_msf3 (cdrom_drive *d,
al@19804 517
al@19804 518 if((ret=handle_scsi_cmd(d,cmd,12,0,sectors * CD_FRAMESIZE_RAW,'\177',1,sense)))
al@19804 519 return(ret);
al@19804 520 - if(p)memcpy(p,d->private->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 521 + if(p)memcpy(p,d->private_data->sg_buffer,sectors*CD_FRAMESIZE_RAW);
al@19804 522 return(0);
al@19804 523 }
al@19804 524
al@19804 525 @@ -1275,7 +1275,7 @@ long scsi_read_msf3 (cdrom_drive *d, voi
al@19804 526 static int count_2352_bytes(cdrom_drive *d){
al@19804 527 long i;
al@19804 528 for(i=2351;i>=0;i--)
al@19804 529 - if(d->private->sg_buffer[i]!=(unsigned char)'\177')
al@19804 530 + if(d->private_data->sg_buffer[i]!=(unsigned char)'\177')
al@19804 531 return(((i+3)>>2)<<2);
al@19804 532
al@19804 533 return(0);
al@19804 534 @@ -1284,7 +1284,7 @@ static int count_2352_bytes(cdrom_drive
al@19804 535 static int verify_nonzero(cdrom_drive *d){
al@19804 536 long i,flag=0;
al@19804 537 for(i=0;i<2352;i++)
al@19804 538 - if(d->private->sg_buffer[i]!=0){
al@19804 539 + if(d->private_data->sg_buffer[i]!=0){
al@19804 540 flag=1;
al@19804 541 break;
al@19804 542 }
al@19804 543 @@ -1625,7 +1625,7 @@ static int check_mmc(cdrom_drive *d){
al@19804 544 d->is_mmc=0;
al@19804 545 if(mode_sense(d,22,0x2A)==0){
al@19804 546
al@19804 547 - b=d->private->sg_buffer;
al@19804 548 + b=d->private_data->sg_buffer;
al@19804 549 b+=b[3]+4;
al@19804 550
al@19804 551 if((b[0]&0x3F)==0x2A){
al@19804 552 @@ -1673,7 +1673,7 @@ unsigned char *scsi_inquiry(cdrom_drive
al@19804 553 cderror(d,"008: Unable to identify CDROM model\n");
al@19804 554 return(NULL);
al@19804 555 }
al@19804 556 - return (d->private->sg_buffer);
al@19804 557 + return (d->private_data->sg_buffer);
al@19804 558 }
al@19804 559
al@19804 560 int scsi_init_drive(cdrom_drive *d){
al@19804 561 @@ -1742,8 +1742,8 @@ int scsi_init_drive(cdrom_drive *d){
al@19804 562 check_cache(d);
al@19804 563
al@19804 564 d->error_retry=1;
al@19804 565 - d->private->sg_hd=realloc(d->private->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);
al@19804 566 - d->private->sg_buffer=((unsigned char *)d->private->sg_hd)+SG_OFF;
al@19804 567 + d->private_data->sg_hd=realloc(d->private_data->sg_hd,d->nsectors*CD_FRAMESIZE_RAW + SG_OFF + 128);
al@19804 568 + d->private_data->sg_buffer=((unsigned char *)d->private_data->sg_hd)+SG_OFF;
al@19804 569 d->report_all=1;
al@19804 570 return(0);
al@19804 571 }
al@19804 572 diff -urp cdparanoia-III-10.2.orig/interface/test_interface.c cdparanoia-III-10.2/interface/test_interface.c
al@19804 573 --- cdparanoia-III-10.2.orig/interface/test_interface.c 2008-09-11 21:33:30.000000000 +0100
al@19804 574 +++ cdparanoia-III-10.2/interface/test_interface.c 2008-09-25 00:22:46.000000000 +0100
al@19804 575 @@ -66,9 +66,9 @@ static long test_read(cdrom_drive *d, vo
al@19804 576 if(!fd)fd=fdopen(d->cdda_fd,"r");
al@19804 577
al@19804 578 if(begin<lastread)
al@19804 579 - d->private->last_milliseconds=20;
al@19804 580 + d->private_data->last_milliseconds=20;
al@19804 581 else
al@19804 582 - d->private->last_milliseconds=sectors;
al@19804 583 + d->private_data->last_milliseconds=sectors;
al@19804 584
al@19804 585 #ifdef CDDA_TEST_UNDERRUN
al@19804 586 sectors-=1;