Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed some things to use SDL C runtime functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Oct 7, 2006
1 parent 3a747ee commit 037bb61
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/audio/baudio/SDL_beaudio.cc
Expand Up @@ -117,7 +117,7 @@ BEAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
}

/* Parse the audio format and fill the Be raw audio format */
memset(&format, '\0', sizeof(media_raw_audio_format));
SDL_memset(&format, '\0', sizeof(media_raw_audio_format));
format.byte_order = B_MEDIA_LITTLE_ENDIAN;
format.frame_rate = (float) this->spec.freq;
format.channel_count = this->spec.channels; /* !!! FIXME: support > 2? */
Expand Down
8 changes: 4 additions & 4 deletions src/audio/macosx/SDL_coreaudio.c
Expand Up @@ -333,7 +333,7 @@ COREAUDIO_CloseDevice(_THIS)
result = AudioOutputUnitStop(this->hidden->audioUnit);

/* Remove the input callback */
memset(&callback, '\0', sizeof (AURenderCallbackStruct));
SDL_memset(&callback, '\0', sizeof (AURenderCallbackStruct));
result = AudioUnitSetProperty(this->hidden->audioUnit,
kAudioUnitProperty_SetRenderCallback,
scope, bus, &callback, sizeof (callback));
Expand Down Expand Up @@ -425,7 +425,7 @@ prepare_audiounit(_THIS, const char *devname, int iscapture,
return 0;
}

memset(&desc, '\0', sizeof(ComponentDescription));
SDL_memset(&desc, '\0', sizeof(ComponentDescription));
desc.componentType = kAudioUnitType_Output;
desc.componentSubType = kAudioUnitSubType_HALOutput;
desc.componentManufacturer = kAudioUnitManufacturer_Apple;
Expand Down Expand Up @@ -470,7 +470,7 @@ prepare_audiounit(_THIS, const char *devname, int iscapture,
CHECK_RESULT("AudioUnitSetProperty (kAudioUnitProperty_StreamFormat)");

/* Set the audio callback */
memset(&callback, '\0', sizeof (AURenderCallbackStruct));
SDL_memset(&callback, '\0', sizeof (AURenderCallbackStruct));
callback.inputProc = ((iscapture) ? inputCallback : outputCallback);
callback.inputProcRefCon = this;
result = AudioUnitSetProperty(this->hidden->audioUnit,
Expand Down Expand Up @@ -514,7 +514,7 @@ COREAUDIO_OpenDevice(_THIS, const char *devname, int iscapture)
SDL_memset(this->hidden, 0, (sizeof *this->hidden));

/* Setup a AudioStreamBasicDescription with the requested format */
memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
SDL_memset(&strdesc, '\0', sizeof(AudioStreamBasicDescription));
strdesc.mFormatID = kAudioFormatLinearPCM;
strdesc.mFormatFlags = kLinearPCMFormatFlagIsPacked;
strdesc.mChannelsPerFrame = this->spec.channels;
Expand Down
8 changes: 4 additions & 4 deletions src/audio/macrom/SDL_romaudio.c
Expand Up @@ -145,7 +145,7 @@ callBackProc(SndChannel * chan, SndCommand * cmd_passed)
cmd.param2 = (long) &header;
SndDoCommand(chan, &cmd, 0);

memset(buffer[fill_me], 0, audio->spec.size);
SDL_memset(buffer[fill_me], 0, audio->spec.size);

/*
* if audio device isn't locked, mix the next buffer to be queued in
Expand Down Expand Up @@ -203,7 +203,7 @@ SNDMGR_OpenDevice(_THIS, const char *devname, int iscapture)
SDL_CalculateAudioSpec(&this->spec);

/* initialize bufferCmd header */
memset(&header, 0, sizeof(header));
SDL_memset(&header, 0, sizeof(header));
callback = (SndCallBackUPP) NewSndCallBackUPP(callBackProc);
sample_bits = spec->size / spec->samples / spec->channels * 8;

Expand Down Expand Up @@ -236,13 +236,13 @@ SNDMGR_OpenDevice(_THIS, const char *devname, int iscapture)

/* allocate 2 buffers */
for (i = 0; i < 2; i++) {
buffer[i] = (UInt8 *) malloc(sizeof(UInt8) * spec->size);
buffer[i] = (UInt8 *) SDL_malloc(sizeof(UInt8) * spec->size);
if (buffer[i] == NULL) {
SNDMGR_CloseDevice(this);
SDL_OutOfMemory();
return 0;
}
memset(buffer[i], 0, spec->size);
SDL_memset(buffer[i], 0, spec->size);
}

/* Create the sound manager channel */
Expand Down
2 changes: 1 addition & 1 deletion src/audio/mme/SDL_mmeaudio.c
Expand Up @@ -84,7 +84,7 @@ MME_OpenDevice(_THIS, const char *devname, int iscapture)
return 0;
}

memset(this->hidden->shm, '\0', sizeof (*this->hidden->shm));
SDL_memset(this->hidden->shm, '\0', sizeof (*this->hidden->shm));
this->hidden->shm->sound = 0;
this->hidden->shm->wFmt.wf.wFormatTag = WAVE_FORMAT_PCM;

Expand Down

0 comments on commit 037bb61

Please sign in to comment.