aboutsummaryrefslogtreecommitdiffstats
path: root/examples/altonegen.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-09-12 03:14:01 -0700
committerChris Robinson <[email protected]>2019-09-12 03:22:34 -0700
commit4c76f32ddac5145231609b1cb4f28028abed814b (patch)
tree139ec9836d367b014e17c6afc614d71338c15ff0 /examples/altonegen.c
parent474d478854ef2ec46bf7b0cb6148c91b7fb8cc2c (diff)
Avoid implicit conversions with the examples and utils
Diffstat (limited to 'examples/altonegen.c')
-rw-r--r--examples/altonegen.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/altonegen.c b/examples/altonegen.c
index 628e695d..aacc3496 100644
--- a/examples/altonegen.c
+++ b/examples/altonegen.c
@@ -91,7 +91,7 @@ static void ApplySin(ALfloat *data, ALdouble g, ALuint srate, ALuint freq)
static ALuint CreateWave(enum WaveType type, ALuint freq, ALuint srate)
{
ALuint seed = 22222;
- ALint data_size;
+ ALuint data_size;
ALfloat *data;
ALuint buffer;
ALenum err;
@@ -142,7 +142,7 @@ static ALuint CreateWave(enum WaveType type, ALuint freq, ALuint srate)
/* Buffer the audio data into a new buffer object. */
buffer = 0;
alGenBuffers(1, &buffer);
- alBufferData(buffer, AL_FORMAT_MONO_FLOAT32, data, data_size, srate);
+ alBufferData(buffer, AL_FORMAT_MONO_FLOAT32, data, (ALsizei)data_size, (ALsizei)srate);
free(data);
/* Check if an error occured, and clean up if so. */
@@ -257,7 +257,7 @@ int main(int argc, char *argv[])
srate = dev_rate;
/* Load the sound into a buffer. */
- buffer = CreateWave(wavetype, tone_freq, srate);
+ buffer = CreateWave(wavetype, (ALuint)tone_freq, (ALuint)srate);
if(!buffer)
{
CloseAL();
@@ -271,7 +271,7 @@ int main(int argc, char *argv[])
/* Create the source to play the sound with. */
source = 0;
alGenSources(1, &source);
- alSourcei(source, AL_BUFFER, buffer);
+ alSourcei(source, AL_BUFFER, (ALint)buffer);
assert(alGetError()==AL_NO_ERROR && "Failed to setup sound source");
/* Play the sound for a while. */