Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 259107 Details for
Bug 95966
wavplay needs ~amd64 KEYWORDS
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to make wavplay work on amd64
wavplay-1.4_amd64.patch (text/plain), 6.86 KB, created by
gmalecha
on 2011-01-07 01:51:15 UTC
(
hide
)
Description:
Patch to make wavplay work on amd64
Filename:
MIME Type:
Creator:
gmalecha
Created:
2011-01-07 01:51:15 UTC
Size:
6.86 KB
patch
obsolete
>diff -uN wavplay-1.4/file.c wavplay-1.4-new/file.c >--- wavplay-1.4/file.c 2011-01-06 20:24:44.000000000 -0500 >+++ wavplay-1.4-new/file.c 2011-01-06 20:37:57.000000000 -0500 >@@ -151,10 +151,10 @@ > UInt32 dbytes; /* Data byte count */ > /* wavfile.c values : */ > int channels; /* Channels recorded in this wav file */ >- u_long samplerate; /* Sampling rate */ >+ uint32_t samplerate; /* Sampling rate */ > int sample_bits; /* data bit size (8/12/16) */ >- u_long samples; /* The number of samples in this file */ >- u_long datastart; /* The offset to the wav data */ >+ uint32_t samples; /* The number of samples in this file */ >+ uint32_t datastart; /* The offset to the wav data */ > > v_erf = erf; /* Set error reporting function */ > >@@ -299,10 +299,10 @@ > WavClose(WAVFILE *wfile,ErrFunc erf) { > int e = 0; /* Returned error code */ > int channels; /* Channels recorded in this wav file */ >- u_long samplerate; /* Sampling rate */ >+ uint32_t samplerate; /* Sampling rate */ > int sample_bits; /* data bit size (8/12/16) */ >- u_long samples; /* The number of samples in this file */ >- u_long datastart; /* The offset to the wav data */ >+ uint32_t samples; /* The number of samples in this file */ >+ uint32_t datastart; /* The offset to the wav data */ > long fpos; /* File position in bytes */ > > v_erf = erf; /* Set error reporting function */ >diff -uN wavplay-1.4/wavfile.c wavplay-1.4-new/wavfile.c >--- wavplay-1.4/wavfile.c 2011-01-06 20:24:44.000000000 -0500 >+++ wavplay-1.4-new/wavfile.c 2011-01-06 20:37:57.000000000 -0500 >@@ -51,29 +51,29 @@ > #define FALSE 0 > > typedef struct >-{ u_long dwSize ; >- u_short wFormatTag ; >- u_short wChannels ; >- u_long dwSamplesPerSec ; >- u_long dwAvgBytesPerSec ; >- u_short wBlockAlign ; >- u_short wBitsPerSample ; >+{ uint32_t dwSize ; >+ uint16_t wFormatTag ; >+ uint16_t wChannels ; >+ uint32_t dwSamplesPerSec ; >+ uint32_t dwAvgBytesPerSec ; >+ uint16_t wBlockAlign ; >+ uint16_t wBitsPerSample ; > } WAVEFORMAT ; > > typedef struct > { char RiffID [4] ; >- u_long RiffSize ; >+ uint32_t RiffSize ; > char WaveID [4] ; > char FmtID [4] ; >- u_long FmtSize ; >- u_short wFormatTag ; >- u_short nChannels ; >- u_long nSamplesPerSec ; >- u_long nAvgBytesPerSec ; >- u_short nBlockAlign ; >- u_short wBitsPerSample ; >+ uint32_t FmtSize ; >+ uint16_t wFormatTag ; >+ uint16_t nChannels ; >+ uint32_t nSamplesPerSec ; >+ uint32_t nAvgBytesPerSec ; >+ uint16_t nBlockAlign ; >+ uint16_t wBitsPerSample ; > char DataID [4] ; >- u_long nDataBytes ; >+ uint32_t nDataBytes ; > } WAVE_HEADER ; > > /*=================================================================================================*/ >@@ -115,9 +115,9 @@ > va_end(ap); > } > >-int WaveWriteHeader (int wavefile, int channels, u_long samplerate, int sampbits, u_long samples, ErrFunc erf) >-{ u_long databytes ; >- u_short blockalign ; >+int WaveWriteHeader (int wavefile, int channels, uint32_t samplerate, int sampbits, uint32_t samples, ErrFunc erf) >+{ uint32_t databytes ; >+ uint16_t blockalign ; > > v_erf = erf; /* wwg: Set error reporting function */ > >@@ -129,13 +129,13 @@ > sampbits = (sampbits == 16) ? 16 : 8 ; > > blockalign = ((sampbits == 16) ? 2 : 1) * channels ; >- databytes = samples * (u_long) blockalign ; >+ databytes = samples * (uint32_t) blockalign ; > > waveheader.RiffSize = sizeof (WAVE_HEADER) + databytes - 8 ; > waveheader.wFormatTag = PCM_WAVE_FORMAT ; > waveheader.nChannels = channels ; > waveheader.nSamplesPerSec = samplerate ; >- waveheader.nAvgBytesPerSec = samplerate * (u_long) blockalign ; >+ waveheader.nAvgBytesPerSec = samplerate * (uint32_t) blockalign ; > waveheader.nBlockAlign = blockalign ; > waveheader.wBitsPerSample = sampbits ; > waveheader.nDataBytes = databytes; >@@ -148,11 +148,11 @@ > return 0 ; > } ; /* WaveWriteHeader*/ > >-int WaveReadHeader (int wavefile, int* channels, u_long* samplerate, int* samplebits, u_long* samples, u_long* datastart,ErrFunc erf) >+int WaveReadHeader (int wavefile, int* channels, uint32_t* samplerate, int* samplebits, uint32_t* samples, uint32_t* datastart,ErrFunc erf) > { static WAVEFORMAT waveformat ; > static char buffer [ BUFFERSIZE ] ; /* Function is not reentrant.*/ > char* ptr ; >- u_long databytes ; >+ uint32_t databytes ; > > v_erf = erf; /* wwg: Set error reporting function */ > >@@ -183,7 +183,7 @@ > ptr += 4 ; /* Move past "fmt ".*/ > memcpy (&waveformat, ptr, sizeof (WAVEFORMAT)) ; > >- if (waveformat.dwSize < (sizeof (WAVEFORMAT) - sizeof (u_long))) { >+ if (waveformat.dwSize < (sizeof (WAVEFORMAT) - sizeof (uint32_t))) { > err("Bad format: Bad fmt size"); /* wwg: report error */ > return WR_BADFORMATSIZE ; > } >@@ -201,7 +201,7 @@ > } > > ptr += 4 ; /* Move past "data".*/ >- memcpy (&databytes, ptr, sizeof (u_long)) ; >+ memcpy (&databytes, ptr, sizeof (uint32_t)) ; > > /* Everything is now cool, so fill in output data.*/ > >@@ -210,7 +210,7 @@ > *samplebits = waveformat.wBitsPerSample ; > *samples = databytes / waveformat.wBlockAlign ; > >- *datastart = ((u_long) (ptr + 4)) - ((u_long) (&(buffer[0]))) ; >+ *datastart = ((uint32_t) (ptr + 4)) - ((uint32_t) (&(buffer[0]))) ; > > if (waveformat.dwSamplesPerSec != waveformat.dwAvgBytesPerSec / waveformat.wBlockAlign) { > err("Bad file format"); /* wwg: report error */ >diff -uN wavplay-1.4/wavfile.h wavplay-1.4-new/wavfile.h >--- wavplay-1.4/wavfile.h 1999-12-03 19:06:42.000000000 -0500 >+++ wavplay-1.4-new/wavfile.h 2011-01-06 20:38:56.000000000 -0500 >@@ -27,6 +27,8 @@ > #ifndef _wavfile_h > #define _wavfile_h "@(#)wavfile.h $Revision: 1.1.1.1 $" > >+#include <stdint.h> >+ > #define WW_BADOUTPUTFILE 1 > #define WW_BADWRITEHEADER 2 > >@@ -41,8 +43,8 @@ > #define WR_NODATACHUNK 10 > #define WR_BADFORMATDATA 11 > >-extern int WaveWriteHeader(int wavefile,int channels,u_long samplerate,int sampbits,u_long samples,ErrFunc erf); >-extern int WaveReadHeader(int wavefile,int *channels,u_long *samplerate,int *samplebits,u_long *samples,u_long *datastart,ErrFunc erf); >+extern int WaveWriteHeader(int wavefile,int channels,uint32_t samplerate,int sampbits,uint32_t samples,ErrFunc erf); >+extern int WaveReadHeader(int wavefile,int *channels,uint32_t *samplerate,int *samplebits,uint32_t *samples,uint32_t *datastart,ErrFunc erf); > > #if 0 > extern char *WaveFileError(int error); >diff -uN wavplay-1.4/xltwavplay.c wavplay-1.4-new/xltwavplay.c >--- wavplay-1.4/xltwavplay.c 1999-12-03 19:06:42.000000000 -0500 >+++ wavplay-1.4-new/xltwavplay.c 2011-01-06 20:37:57.000000000 -0500 >@@ -387,7 +387,7 @@ > char *pText = XmTextGetString(wRecRate); /* Get contents */ > unsigned long ul; > >- if ( sscanf(pText,"%lu",&ul) != 1 ) { /* Convert to u_long */ >+ if ( sscanf(pText,"%lu",&ul) != 1 ) { /* Convert to uint32_t */ > if ( !*pText ) > ReportErrorf("No sampling rate has been specified."); > else ReportErrorf("Record sampling rate '%s' must be an integer.",pText);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 95966
: 259107 |
259109