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/rsStream.h | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'libs/rs/rsStream.h') diff --git a/libs/rs/rsStream.h b/libs/rs/rsStream.h index d401cd1..62bcf94 100644 --- a/libs/rs/rsStream.h +++ b/libs/rs/rsStream.h @@ -24,8 +24,7 @@ namespace android { namespace renderscript { -class IStream -{ +class IStream { public: IStream(const uint8_t *, bool use64); @@ -70,7 +69,7 @@ public: void reset() { mPos = 0; } - + const uint8_t * getPtr() const { return mData; } @@ -80,26 +79,25 @@ protected: bool mUse64; }; -class OStream -{ +class OStream { public: OStream(uint64_t length, bool use64); ~OStream(); - + void align(uint32_t bytes) { mPos = (mPos + (bytes - 1)) & (~(bytes - 1)); - if(mPos >= mLength) { + if (mPos >= mLength) { growSize(); } } - + void addF(float v) { uint32_t uintV = *reinterpret_cast (&v); addU32(uintV); } void addI32(int32_t v) { mPos = (mPos + 3) & (~3); - if(mPos + sizeof(v) >= mLength) { + if (mPos + sizeof(v) >= mLength) { growSize(); } mData[mPos++] = (uint8_t)(v & 0xff); @@ -109,7 +107,7 @@ public: } void addU32(uint32_t v) { mPos = (mPos + 3) & (~3); - if(mPos + sizeof(v) >= mLength) { + if (mPos + sizeof(v) >= mLength) { growSize(); } mData[mPos++] = (uint8_t)(v & 0xff); @@ -119,14 +117,14 @@ public: } void addU16(uint16_t v) { mPos = (mPos + 1) & (~1); - if(mPos + sizeof(v) >= mLength) { + if (mPos + sizeof(v) >= mLength) { growSize(); } mData[mPos++] = (uint8_t)(v & 0xff); mData[mPos++] = (uint8_t)(v >> 8); } inline void addU8(uint8_t v) { - if(mPos + 1 >= mLength) { + if (mPos + 1 >= mLength) { growSize(); } reinterpret_cast(&mData[mPos])[0] = v; @@ -154,7 +152,7 @@ protected: uint64_t mPos; bool mUse64; }; - + } // renderscript } // android -- cgit v1.1