Ticket #11353: patch-x86

File patch-x86, 2.2 KB (added by drs@…, 16 years ago)

patch file which resolves this issue for me

Line 
1*** cd-discid.c.orig    2003-12-15 18:55:00.000000000 -0500
2--- cd-discid.c 2008-06-13 23:31:58.000000000 -0400
3***************
4*** 86,91 ****
5--- 86,98 ----
6  #define        cdrom_tocentry  CDTrackInfo
7  #define              cdte_track_address trackStartAddress
8 
9+ #if defined (__i386__) || defined(__x86_64__)
10+ #define SWAP ntohl
11+ #define RESWAP htonl
12+ #else
13+ #define SWAP
14+ #define RESWAP
15+ #endif
16  #else
17  # error "Your OS isn't supported yet."
18  #endif        /* os selection */
19***************
20*** 194,200 ****
21         * TocEntry[last-1].lastRecordedAddress + 1, so we compute the start
22         * of leadout from the start+length of the last track instead
23         */
24!       TocEntry[last].cdte_track_address = TocEntry[last-1].trackSize + TocEntry[last-1].trackStartAddress;
25  #else /* FreeBSD, Linux, Solaris */
26        for (i=0; i < last; i++) {
27                /* tracks start with 1, but I must start with 0 on OpenBSD */
28--- 201,207 ----
29         * TocEntry[last-1].lastRecordedAddress + 1, so we compute the start
30         * of leadout from the start+length of the last track instead
31         */
32!       TocEntry[last].cdte_track_address = RESWAP(SWAP(TocEntry[last-1].trackSize) + SWAP(TocEntry[last-1].trackStartAddress));
33  #else /* FreeBSD, Linux, Solaris */
34        for (i=0; i < last; i++) {
35                /* tracks start with 1, but I must start with 0 on OpenBSD */
36***************
37*** 214,225 ****
38        }
39  #endif
40 
41! #if defined(__FreeBSD__)
42        TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
43  #endif       
44 
45        for (i=0; i < last; i++) {
46! #if defined(__FreeBSD__)
47                TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
48  #endif
49                cksum += cddb_sum((TocEntry[i].cdte_track_address + CD_MSF_OFFSET) / CD_FRAMES);
50--- 221,232 ----
51        }
52  #endif
53 
54! #if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))
55        TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
56  #endif       
57 
58        for (i=0; i < last; i++) {
59! #if defined(__FreeBSD__) || (defined(__APPLE__) && (defined (__i386__) || defined(__x86_64__)))
60                TocEntry[i].cdte_track_address = ntohl(TocEntry[i].cdte_track_address);
61  #endif
62                cksum += cddb_sum((TocEntry[i].cdte_track_address + CD_MSF_OFFSET) / CD_FRAMES);