From ed9f210568082dd6d1d8a0c92c693d574d87d545 Mon Sep 17 00:00:00 2001 From: Alex Sakhartchouk Date: Tue, 9 Nov 2010 17:00:54 -0800 Subject: Code cleanup to make formatting consistent across all the renderscript files. Change-Id: Idf5fcc60877e44c8f074f7176e37f70b3b895a3c --- libs/rs/rsScript.cpp | 49 +++++++++++++++++-------------------------------- 1 file changed, 17 insertions(+), 32 deletions(-) (limited to 'libs/rs/rsScript.cpp') diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index ef380d26b9a6..4ffdbfdcf60b 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -19,35 +19,33 @@ using namespace android; using namespace android::renderscript; -Script::Script(Context *rsc) : ObjectBase(rsc) -{ +Script::Script(Context *rsc) : ObjectBase(rsc) { memset(&mEnviroment, 0, sizeof(mEnviroment)); mSlots = NULL; mTypes = NULL; } -Script::~Script() -{ - if(mSlots) { +Script::~Script() { + if (mSlots) { delete [] mSlots; mSlots = NULL; } - if(mTypes) { + if (mTypes) { delete [] mTypes; mTypes = NULL; } } void Script::initSlots() { - if(mEnviroment.mFieldCount > 0) { + if (mEnviroment.mFieldCount > 0) { mSlots = new ObjectBaseRef[mEnviroment.mFieldCount]; mTypes = new ObjectBaseRef[mEnviroment.mFieldCount]; } } void Script::setSlot(uint32_t slot, Allocation *a) { - if(slot >= mEnviroment.mFieldCount) { + if (slot >= mEnviroment.mFieldCount) { LOGE("Script::setSlot unable to set allocation, invalid slot index"); return; } @@ -55,8 +53,7 @@ void Script::setSlot(uint32_t slot, Allocation *a) { mSlots[slot].set(a); } -void Script::setVar(uint32_t slot, const void *val, uint32_t len) -{ +void Script::setVar(uint32_t slot, const void *val, uint32_t len) { int32_t *destPtr = ((int32_t **)mEnviroment.mFieldAddress)[slot]; if (destPtr) { //LOGE("setVar f1 %f", ((const float *)destPtr)[0]); @@ -73,72 +70,60 @@ void Script::setVar(uint32_t slot, const void *val, uint32_t len) namespace android { namespace renderscript { - -void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint32_t slot) -{ +void rsi_ScriptBindAllocation(Context * rsc, RsScript vs, RsAllocation va, uint32_t slot) { Script *s = static_cast