From 6d78936c43741b74f1226af9c096d7253f8fb266 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 24 Jan 2015 01:59:09 +1100 Subject: cleanup: style --- source/blender/compositor/intern/COM_MemoryBuffer.cpp | 19 ++++++++++--------- source/blender/compositor/intern/COM_MemoryBuffer.h | 10 +++++----- source/blender/compositor/intern/COM_OpenCLDevice.cpp | 6 ++++-- source/blender/compositor/intern/COM_OpenCLDevice.h | 2 +- 4 files changed, 20 insertions(+), 17 deletions(-) (limited to 'source/blender/compositor/intern') diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp index 58767960cc8..37035c50d2c 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp @@ -27,15 +27,16 @@ using std::min; using std::max; -static unsigned int determine_num_channels(DataType datatype) { +static unsigned int determine_num_channels(DataType datatype) +{ switch (datatype) { - case COM_DT_VALUE: - return COM_NUM_CHANNELS_VALUE; - case COM_DT_VECTOR: - return COM_NUM_CHANNELS_VECTOR; - case COM_DT_COLOR: - default: - return COM_NUM_CHANNELS_COLOR; + case COM_DT_VALUE: + return COM_NUM_CHANNELS_VALUE; + case COM_DT_VECTOR: + return COM_NUM_CHANNELS_VECTOR; + case COM_DT_COLOR: + default: + return COM_NUM_CHANNELS_COLOR; } } @@ -226,7 +227,7 @@ static void read_ewa_pixel_sampled(void *userdata, int x, int y, float result[4] void MemoryBuffer::readEWA(float *result, const float uv[2], const float derivatives[2][2], PixelSampler sampler) { - BLI_assert(this->m_datatype==COM_DT_COLOR); + BLI_assert(this->m_datatype == COM_DT_COLOR); ReadEWAData data; data.buffer = this; data.sampler = sampler; diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 320de3d67cd..e0c542108a1 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -215,7 +215,7 @@ public: bool clip_y = (extend_y == COM_MB_CLIP && (y < m_rect.ymin || y >= m_rect.ymax)); if (clip_x || clip_y) { /* clip result outside rect is zero */ - memset(result, 0, this->m_num_channels*sizeof(float)); + memset(result, 0, this->m_num_channels * sizeof(float)); } else { int u = x; @@ -223,7 +223,7 @@ public: this->wrap_pixel(u, v, extend_x, extend_y); const int offset = (this->m_width * y + x) * this->m_num_channels; float* buffer = &this->m_buffer[offset]; - memcpy(result, buffer, sizeof(float)*this->m_num_channels); + memcpy(result, buffer, sizeof(float) * this->m_num_channels); } } @@ -240,14 +240,14 @@ public: BLI_assert(offset >= 0); BLI_assert(offset < this->determineBufferSize() * this->m_num_channels); BLI_assert(!(extend_x == COM_MB_CLIP && (u < m_rect.xmin || u >= m_rect.xmax)) && - !(extend_y == COM_MB_CLIP && (v < m_rect.ymin || v >= m_rect.ymax))); + !(extend_y == COM_MB_CLIP && (v < m_rect.ymin || v >= m_rect.ymax))); #if 0 /* always true */ BLI_assert((int)(MEM_allocN_len(this->m_buffer) / sizeof(*this->m_buffer)) == (int)(this->determineBufferSize() * COM_NUMBER_OF_CHANNELS)); #endif - float* buffer = &this->m_buffer[offset]; - memcpy(result, buffer, sizeof(float)*this->m_num_channels); + float *buffer = &this->m_buffer[offset]; + memcpy(result, buffer, sizeof(float) * this->m_num_channels); } void writePixel(int x, int y, const float color[4]); diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cpp b/source/blender/compositor/intern/COM_OpenCLDevice.cpp index 7fc4fd38abd..5960082c2fd 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.cpp +++ b/source/blender/compositor/intern/COM_OpenCLDevice.cpp @@ -90,9 +90,11 @@ const cl_image_format* OpenCLDevice::determineImageFormat(MemoryBuffer *memoryBu int num_channels = memoryBuffer->get_num_channels(); if (num_channels == 1) { imageFormat = &IMAGE_FORMAT_VALUE; - } else if (num_channels == 3) { + } + else if (num_channels == 3) { imageFormat = &IMAGE_FORMAT_VECTOR; - } else { + } + else { imageFormat = &IMAGE_FORMAT_COLOR; } diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.h b/source/blender/compositor/intern/COM_OpenCLDevice.h index f8a8841ef47..a513954ee0d 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.h +++ b/source/blender/compositor/intern/COM_OpenCLDevice.h @@ -98,7 +98,7 @@ public: * @brief determine an image format * @param memorybuffer */ - static const cl_image_format* determineImageFormat(MemoryBuffer *memoryBuffer); + static const cl_image_format *determineImageFormat(MemoryBuffer *memoryBuffer); cl_context getContext() { return this->m_context; } -- cgit v1.2.3