comparison minijss/jssmix.c @ 1167:848a88ce7a57

Use dmMemset().
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 05 Mar 2015 07:37:35 +0200
parents aa3738b121d1
children 4b22da2a309f
comparison
equal deleted inserted replaced
1166:f29fa5b6b748 1167:848a88ce7a57
2 * miniJSS - Mixing device and channel handling 2 * miniJSS - Mixing device and channel handling
3 * Programmed and designed by Matti 'ccr' Hamalainen 3 * Programmed and designed by Matti 'ccr' Hamalainen
4 * (C) Copyright 2006-2015 Tecnic Software productions (TNSP) 4 * (C) Copyright 2006-2015 Tecnic Software productions (TNSP)
5 */ 5 */
6 #include "jssmix.h" 6 #include "jssmix.h"
7 #include <string.h>
8 7
9 8
10 #ifdef DM_USE_C 9 #ifdef DM_USE_C
11 #define JMIXER_HEADER 10 #define JMIXER_HEADER
12 #include "jmix_c_in.c" 11 #include "jmix_c_in.c"
177 #ifdef JSS_SUP_THREADS 176 #ifdef JSS_SUP_THREADS
178 dmDestroyMutex(mixer->mutex); 177 dmDestroyMutex(mixer->mutex);
179 #endif 178 #endif
180 dmFree(mixer->addBuffer); 179 dmFree(mixer->addBuffer);
181 180
182 memset(mixer, 0, sizeof(JSSMixer)); 181 dmMemset(mixer, 0, sizeof(JSSMixer));
183 dmFree(mixer); 182 dmFree(mixer);
184 183
185 return DMERR_OK; 184 return DMERR_OK;
186 } 185 }
187 186
383 assert(mixBuffer != NULL); 382 assert(mixBuffer != NULL);
384 assert(mixLength > 0); 383 assert(mixLength > 0);
385 assert(mixLength * mixer->outChannels <= mixer->addBufSize); 384 assert(mixLength * mixer->outChannels <= mixer->addBufSize);
386 385
387 // Clear mixer->addBuffer 386 // Clear mixer->addBuffer
388 memset(mixer->addBuffer, 0, mixLength * mixer->outChannels * sizeof(JMIXER_ADDBUF_TYPE)); 387 dmMemset(mixer->addBuffer, 0, mixLength * mixer->outChannels * sizeof(JMIXER_ADDBUF_TYPE));
389 388
390 ab = mixer->addBuffer; 389 ab = mixer->addBuffer;
391 mixLeft = mixLength; 390 mixLeft = mixLength;
392 while (mixLeft > 0) 391 while (mixLeft > 0)
393 { 392 {
693 692
694 693
695 void jvmClear(JSSMixer * mixer, const int channel) 694 void jvmClear(JSSMixer * mixer, const int channel)
696 { 695 {
697 JSS_LOCK(mixer); 696 JSS_LOCK(mixer);
698 memset(&mixer->channels[channel], 0, sizeof(JSSChannel)); 697 dmMemset(&mixer->channels[channel], 0, sizeof(JSSChannel));
699 JSS_UNLOCK(mixer); 698 JSS_UNLOCK(mixer);
700 } 699 }
701 700
702 701
703 void jvmSetGlobalVol(JSSMixer * mixer, const int volume) 702 void jvmSetGlobalVol(JSSMixer * mixer, const int volume)