summaryrefslogtreecommitdiffstats
path: root/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-02-20 12:16:30 -0800
committerGlenn Kasten <gkasten@google.com>2012-07-17 11:35:16 -0700
commita189a6883ee55cf62da1d7bf5bf5a8ab501938a4 (patch)
tree7ab4133c0ce507e289baacf76d745de27f9e8136 /media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
parent28b76b334f92a15a2be3cc9e2f7d229a3275d1ac (diff)
downloadframeworks_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/lvm/wrapper/Bundle/EffectBundle.cpp')
-rw-r--r--media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
index 40dffd4..1a45e35 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
@@ -180,16 +180,16 @@ extern "C" int EffectQueryEffect(uint32_t index, effect_descriptor_t *pDescripto
}
if(index == LVM_BASS_BOOST){
ALOGV("\tEffectQueryEffect processing LVM_BASS_BOOST");
- memcpy(pDescriptor, &gBassBoostDescriptor, sizeof(effect_descriptor_t));
+ *pDescriptor = gBassBoostDescriptor;
}else if(index == LVM_VIRTUALIZER){
ALOGV("\tEffectQueryEffect processing LVM_VIRTUALIZER");
- memcpy(pDescriptor, &gVirtualizerDescriptor, sizeof(effect_descriptor_t));
+ *pDescriptor = gVirtualizerDescriptor;
} else if(index == LVM_EQUALIZER){
ALOGV("\tEffectQueryEffect processing LVM_EQUALIZER");
- memcpy(pDescriptor, &gEqualizerDescriptor, sizeof(effect_descriptor_t));
+ *pDescriptor = gEqualizerDescriptor;
} else if(index == LVM_VOLUME){
ALOGV("\tEffectQueryEffect processing LVM_VOLUME");
- memcpy(pDescriptor, &gVolumeDescriptor, sizeof(effect_descriptor_t));
+ *pDescriptor = gVolumeDescriptor;
}
ALOGV("\tEffectQueryEffect end\n");
return 0;
@@ -494,7 +494,7 @@ extern "C" int EffectGetDescriptor(const effect_uuid_t *uuid,
return -EINVAL;
}
- memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+ *pDescriptor = *desc;
return 0;
} /* end EffectGetDescriptor */
@@ -965,7 +965,7 @@ int Effect_setConfig(EffectContext *pContext, effect_config_t *pConfig){
|| pConfig->outputCfg.accessMode == EFFECT_BUFFER_ACCESS_ACCUMULATE);
CHECK_ARG(pConfig->inputCfg.format == AUDIO_FORMAT_PCM_16_BIT);
- memcpy(&pContext->config, pConfig, sizeof(effect_config_t));
+ pContext->config = *pConfig;
switch (pConfig->inputCfg.samplingRate) {
case 8000:
@@ -1041,7 +1041,7 @@ int Effect_setConfig(EffectContext *pContext, effect_config_t *pConfig){
void Effect_getConfig(EffectContext *pContext, effect_config_t *pConfig)
{
- memcpy(pConfig, &pContext->config, sizeof(effect_config_t));
+ *pConfig = pContext->config;
} /* end Effect_getConfig */
//----------------------------------------------------------------------------
@@ -3272,7 +3272,7 @@ int Effect_getDescriptor(effect_handle_t self,
return -EINVAL;
}
- memcpy(pDescriptor, desc, sizeof(effect_descriptor_t));
+ *pDescriptor = *desc;
return 0;
} /* end Effect_getDescriptor */