diff options
author | Glenn Kasten <gkasten@google.com> | 2012-02-20 12:16:30 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-07-17 11:35:16 -0700 |
commit | a189a6883ee55cf62da1d7bf5bf5a8ab501938a4 (patch) | |
tree | 7ab4133c0ce507e289baacf76d745de27f9e8136 /media/libeffects/testlibs | |
parent | 28b76b334f92a15a2be3cc9e2f7d229a3275d1ac (diff) | |
download | frameworks_av-a189a6883ee55cf62da1d7bf5bf5a8ab501938a4.zip frameworks_av-a189a6883ee55cf62da1d7bf5bf5a8ab501938a4.tar.gz frameworks_av-a189a6883ee55cf62da1d7bf5bf5a8ab501938a4.tar.bz2 |
Use struct assignment instead of explicit memcpy
for POD structs effect_descriptor_t and effect_config_t
Change-Id: Ib2fc47f85fb65ed91b0abb1f87217c49b5eb571d
Diffstat (limited to 'media/libeffects/testlibs')
-rw-r--r-- | media/libeffects/testlibs/EffectEqualizer.cpp | 10 | ||||
-rw-r--r-- | media/libeffects/testlibs/EffectReverb.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/media/libeffects/testlibs/EffectEqualizer.cpp b/media/libeffects/testlibs/EffectEqualizer.cpp index 35a4a61..90ebe1f 100644 --- a/media/libeffects/testlibs/EffectEqualizer.cpp +++ b/media/libeffects/testlibs/EffectEqualizer.cpp @@ -136,7 +136,7 @@ extern "C" int EffectQueryEffect(uint32_t index, if (index > 0) { return -EINVAL; } - memcpy(pDescriptor, &gEqualizerDescriptor, sizeof(effect_descriptor_t)); + *pDescriptor = gEqualizerDescriptor; return 0; } /* end EffectQueryNext */ @@ -204,7 +204,7 @@ extern "C" int EffectGetDescriptor(const effect_uuid_t *uuid, } if (memcmp(uuid, &gEqualizerDescriptor.uuid, sizeof(effect_uuid_t)) == 0) { - memcpy(pDescriptor, &gEqualizerDescriptor, sizeof(effect_descriptor_t)); + *pDescriptor = gEqualizerDescriptor; return 0; } @@ -262,7 +262,7 @@ int Equalizer_setConfig(EqualizerContext *pContext, effect_config_t *pConfig) } CHECK_ARG(channelCount <= AudioBiquadFilter::MAX_CHANNELS); - memcpy(&pContext->config, pConfig, sizeof(effect_config_t)); + pContext->config = *pConfig; pContext->pEqualizer->configure(channelCount, pConfig->inputCfg.samplingRate); @@ -290,7 +290,7 @@ int Equalizer_setConfig(EqualizerContext *pContext, effect_config_t *pConfig) void Equalizer_getConfig(EqualizerContext *pContext, effect_config_t *pConfig) { - memcpy(pConfig, &pContext->config, sizeof(effect_config_t)); + *pConfig = pContext->config; } // end Equalizer_getConfig @@ -752,7 +752,7 @@ extern "C" int Equalizer_getDescriptor(effect_handle_t self, return -EINVAL; } - memcpy(pDescriptor, &android::gEqualizerDescriptor, sizeof(effect_descriptor_t)); + *pDescriptor = android::gEqualizerDescriptor; return 0; } diff --git a/media/libeffects/testlibs/EffectReverb.c b/media/libeffects/testlibs/EffectReverb.c index 8351712..a87a834 100644 --- a/media/libeffects/testlibs/EffectReverb.c +++ b/media/libeffects/testlibs/EffectReverb.c @@ -194,7 +194,7 @@ int EffectGetDescriptor(const effect_uuid_t *uuid, for (i = 0; i < length; i++) { if (memcmp(uuid, &gDescriptors[i]->uuid, sizeof(effect_uuid_t)) == 0) { - memcpy(pDescriptor, gDescriptors[i], sizeof(effect_descriptor_t)); + *pDescriptor = *gDescriptors[i]; ALOGV("EffectGetDescriptor - UUID matched Reverb type %d, UUID = %x", i, gDescriptors[i]->uuid.timeLow); return 0; @@ -440,7 +440,7 @@ int Reverb_GetDescriptor(effect_handle_t self, } } - memcpy(pDescriptor, desc, sizeof(effect_descriptor_t)); + *pDescriptor = *desc; return 0; } /* end Reverb_getDescriptor */ @@ -546,7 +546,7 @@ int Reverb_setConfig(reverb_module_t *pRvbModule, effect_config_t *pConfig, return -EINVAL; } - memcpy(&pRvbModule->config, pConfig, sizeof(effect_config_t)); + pRvbModule->config = *pConfig; pReverb->m_nSamplingRate = pRvbModule->config.outputCfg.samplingRate; @@ -644,7 +644,7 @@ int Reverb_setConfig(reverb_module_t *pRvbModule, effect_config_t *pConfig, void Reverb_getConfig(reverb_module_t *pRvbModule, effect_config_t *pConfig) { - memcpy(pConfig, &pRvbModule->config, sizeof(effect_config_t)); + *pConfig = pRvbModule->config; } /*---------------------------------------------------------------------------- |