From d4cfdc69ef95728a39f085283ba812cec856d757 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 26 Jun 2012 07:32:24 +0000 Subject: [PATCH] quiet all -Wshadow warnings in the compositor. --- .../compositor/intern/COM_Converter.cpp | 166 +++++++++--------- .../blender/compositor/intern/COM_Converter.h | 2 +- .../compositor/intern/COM_ExecutionGroup.cpp | 3 +- .../compositor/intern/COM_ExecutionSystem.cpp | 2 - .../intern/COM_ExecutionSystemHelper.cpp | 14 +- .../intern/COM_ExecutionSystemHelper.h | 2 +- source/blender/compositor/intern/COM_Node.h | 2 +- .../compositor/intern/COM_WorkScheduler.cpp | 128 +++++++------- .../compositor/nodes/COM_DilateErodeNode.cpp | 6 +- .../COM_AlphaOverMixedOperation.cpp | 4 +- .../operations/COM_AlphaOverMixedOperation.h | 8 +- .../operations/COM_OutputFileOperation.cpp | 6 +- 12 files changed, 170 insertions(+), 173 deletions(-) diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp index 0a8862e4017..38c514d8e99 100644 --- a/source/blender/compositor/intern/COM_Converter.cpp +++ b/source/blender/compositor/intern/COM_Converter.cpp @@ -117,253 +117,253 @@ #include "COM_ViewerNode.h" #include "COM_ZCombineNode.h" -Node *Converter::convert(bNode *bNode) +Node *Converter::convert(bNode *b_node) { Node *node; - if (bNode->flag & NODE_MUTED) { - node = new MuteNode(bNode); + if (b_node->flag & NODE_MUTED) { + node = new MuteNode(b_node); return node; } - switch (bNode->type) { + switch (b_node->type) { case CMP_NODE_COMPOSITE: - node = new CompositorNode(bNode); + node = new CompositorNode(b_node); break; case CMP_NODE_R_LAYERS: - node = new RenderLayersNode(bNode); + node = new RenderLayersNode(b_node); break; case CMP_NODE_TEXTURE: - node = new TextureNode(bNode); + node = new TextureNode(b_node); break; case CMP_NODE_RGBTOBW: - node = new ColourToBWNode(bNode); + node = new ColourToBWNode(b_node); break; case CMP_NODE_MIX_RGB: - node = new MixNode(bNode); + node = new MixNode(b_node); break; case CMP_NODE_TRANSLATE: - node = new TranslateNode(bNode); + node = new TranslateNode(b_node); break; case CMP_NODE_SCALE: - node = new ScaleNode(bNode); + node = new ScaleNode(b_node); break; case CMP_NODE_ROTATE: - node = new RotateNode(bNode); + node = new RotateNode(b_node); break; case CMP_NODE_FLIP: - node = new FlipNode(bNode); + node = new FlipNode(b_node); break; case CMP_NODE_FILTER: - node = new FilterNode(bNode); + node = new FilterNode(b_node); break; case CMP_NODE_ID_MASK: - node = new IDMaskNode(bNode); + node = new IDMaskNode(b_node); break; case CMP_NODE_BRIGHTCONTRAST: - node = new BrightnessNode(bNode); + node = new BrightnessNode(b_node); break; case CMP_NODE_SEPRGBA: - node = new SeparateRGBANode(bNode); + node = new SeparateRGBANode(b_node); break; case CMP_NODE_COMBRGBA: - node = new CombineRGBANode(bNode); + node = new CombineRGBANode(b_node); break; case CMP_NODE_SEPHSVA: - node = new SeparateHSVANode(bNode); + node = new SeparateHSVANode(b_node); break; case CMP_NODE_COMBHSVA: - node = new CombineHSVANode(bNode); + node = new CombineHSVANode(b_node); break; case CMP_NODE_SEPYUVA: - node = new SeparateYUVANode(bNode); + node = new SeparateYUVANode(b_node); break; case CMP_NODE_COMBYUVA: - node = new CombineYUVANode(bNode); + node = new CombineYUVANode(b_node); break; case CMP_NODE_SEPYCCA: - node = new SeparateYCCANode(bNode); + node = new SeparateYCCANode(b_node); break; case CMP_NODE_COMBYCCA: - node = new CombineYCCANode(bNode); + node = new CombineYCCANode(b_node); break; case CMP_NODE_ALPHAOVER: - node = new AlphaOverNode(bNode); + node = new AlphaOverNode(b_node); break; case CMP_NODE_COLORBALANCE: - node = new ColorBalanceNode(bNode); + node = new ColorBalanceNode(b_node); break; case CMP_NODE_VIEWER: - node = new ViewerNode(bNode); + node = new ViewerNode(b_node); break; case CMP_NODE_SPLITVIEWER: - node = new SplitViewerNode(bNode); + node = new SplitViewerNode(b_node); break; case CMP_NODE_INVERT: - node = new InvertNode(bNode); + node = new InvertNode(b_node); break; case NODE_GROUP: - node = new GroupNode(bNode); + node = new GroupNode(b_node); break; case CMP_NODE_NORMAL: - node = new NormalNode(bNode); + node = new NormalNode(b_node); break; case CMP_NODE_NORMALIZE: - node = new NormalizeNode(bNode); + node = new NormalizeNode(b_node); break; case CMP_NODE_IMAGE: - node = new ImageNode(bNode); + node = new ImageNode(b_node); break; case CMP_NODE_SETALPHA: - node = new SetAlphaNode(bNode); + node = new SetAlphaNode(b_node); break; case CMP_NODE_PREMULKEY: - node = new ConvertAlphaNode(bNode); + node = new ConvertAlphaNode(b_node); break; case CMP_NODE_MATH: - node = new MathNode(bNode); + node = new MathNode(b_node); break; case CMP_NODE_HUE_SAT: - node = new HueSaturationValueNode(bNode); + node = new HueSaturationValueNode(b_node); break; case CMP_NODE_COLORCORRECTION: - node = new ColorCorrectionNode(bNode); + node = new ColorCorrectionNode(b_node); break; case CMP_NODE_MASK_BOX: - node = new BoxMaskNode(bNode); + node = new BoxMaskNode(b_node); break; case CMP_NODE_MASK_ELLIPSE: - node = new EllipseMaskNode(bNode); + node = new EllipseMaskNode(b_node); break; case CMP_NODE_GAMMA: - node = new GammaNode(bNode); + node = new GammaNode(b_node); break; case CMP_NODE_CURVE_RGB: - node = new ColorCurveNode(bNode); + node = new ColorCurveNode(b_node); break; case CMP_NODE_CURVE_VEC: - node = new VectorCurveNode(bNode); + node = new VectorCurveNode(b_node); break; case CMP_NODE_HUECORRECT: - node = new HueSaturationValueCorrectNode(bNode); + node = new HueSaturationValueCorrectNode(b_node); break; case CMP_NODE_MAP_UV: - node = new MapUVNode(bNode); + node = new MapUVNode(b_node); break; case CMP_NODE_DISPLACE: - node = new DisplaceNode(bNode); + node = new DisplaceNode(b_node); break; case CMP_NODE_VALTORGB: - node = new ColorRampNode(bNode); + node = new ColorRampNode(b_node); break; case CMP_NODE_DIFF_MATTE: - node = new DifferenceMatteNode(bNode); + node = new DifferenceMatteNode(b_node); break; case CMP_NODE_LUMA_MATTE: - node = new LuminanceMatteNode(bNode); + node = new LuminanceMatteNode(b_node); break; case CMP_NODE_DIST_MATTE: - node = new DistanceMatteNode(bNode); + node = new DistanceMatteNode(b_node); break; case CMP_NODE_CHROMA_MATTE: - node = new ChromaMatteNode(bNode); + node = new ChromaMatteNode(b_node); break; case CMP_NODE_COLOR_MATTE: - node = new ColorMatteNode(bNode); + node = new ColorMatteNode(b_node); break; case CMP_NODE_CHANNEL_MATTE: - node = new ChannelMatteNode(bNode); + node = new ChannelMatteNode(b_node); break; case CMP_NODE_BLUR: - node = new BlurNode(bNode); + node = new BlurNode(b_node); break; case CMP_NODE_BOKEHIMAGE: - node = new BokehImageNode(bNode); + node = new BokehImageNode(b_node); break; case CMP_NODE_BOKEHBLUR: - node = new BokehBlurNode(bNode); + node = new BokehBlurNode(b_node); break; case CMP_NODE_DILATEERODE: - node = new DilateErodeNode(bNode); + node = new DilateErodeNode(b_node); break; case CMP_NODE_LENSDIST: - node = new LensDistortionNode(bNode); + node = new LensDistortionNode(b_node); break; case CMP_NODE_RGB: - node = new ColorNode(bNode); + node = new ColorNode(b_node); break; case CMP_NODE_VALUE: - node = new ValueNode(bNode); + node = new ValueNode(b_node); break; case CMP_NODE_TIME: - node = new TimeNode(bNode); + node = new TimeNode(b_node); break; case CMP_NODE_DBLUR: - node = new DirectionalBlurNode(bNode); + node = new DirectionalBlurNode(b_node); break; case CMP_NODE_ZCOMBINE: - node = new ZCombineNode(bNode); + node = new ZCombineNode(b_node); break; case CMP_NODE_TONEMAP: - node = new TonemapNode(bNode); + node = new TonemapNode(b_node); break; case CMP_NODE_SWITCH: - node = new SwitchNode(bNode); + node = new SwitchNode(b_node); break; case CMP_NODE_GLARE: - node = new GlareNode(bNode); + node = new GlareNode(b_node); break; case CMP_NODE_MOVIECLIP: - node = new MovieClipNode(bNode); + node = new MovieClipNode(b_node); break; case CMP_NODE_COLOR_SPILL: - node = new ColorSpillNode(bNode); + node = new ColorSpillNode(b_node); break; case CMP_NODE_OUTPUT_FILE: - node = new OutputFileNode(bNode); + node = new OutputFileNode(b_node); break; case CMP_NODE_MAP_VALUE: - node = new MapValueNode(bNode); + node = new MapValueNode(b_node); break; case CMP_NODE_TRANSFORM: - node = new TransformNode(bNode); + node = new TransformNode(b_node); break; case CMP_NODE_STABILIZE2D: - node = new Stabilize2dNode(bNode); + node = new Stabilize2dNode(b_node); break; case CMP_NODE_BILATERALBLUR: - node = new BilateralBlurNode(bNode); + node = new BilateralBlurNode(b_node); break; case CMP_NODE_VECBLUR: - node = new VectorBlurNode(bNode); + node = new VectorBlurNode(b_node); break; case CMP_NODE_MOVIEDISTORTION: - node = new MovieDistortionNode(bNode); + node = new MovieDistortionNode(b_node); break; case CMP_NODE_VIEW_LEVELS: - node = new ViewLevelsNode(bNode); + node = new ViewLevelsNode(b_node); break; case CMP_NODE_DEFOCUS: - node = new DefocusNode(bNode); + node = new DefocusNode(b_node); break; case CMP_NODE_DOUBLEEDGEMASK: - node = new DoubleEdgeMaskNode(bNode); + node = new DoubleEdgeMaskNode(b_node); break; case CMP_NODE_CROP: - node = new CropNode(bNode); + node = new CropNode(b_node); break; case CMP_NODE_MASK: - node = new MaskNode(bNode); + node = new MaskNode(b_node); break; case CMP_NODE_KEYINGSCREEN: - node = new KeyingScreenNode(bNode); + node = new KeyingScreenNode(b_node); break; case CMP_NODE_KEYING: - node = new KeyingNode(bNode); + node = new KeyingNode(b_node); break; /* not inplemented yet */ default: - node = new MuteNode(bNode); + node = new MuteNode(b_node); break; } return node; diff --git a/source/blender/compositor/intern/COM_Converter.h b/source/blender/compositor/intern/COM_Converter.h index d129898ab3f..6cf22a1e2a4 100644 --- a/source/blender/compositor/intern/COM_Converter.h +++ b/source/blender/compositor/intern/COM_Converter.h @@ -42,7 +42,7 @@ public: * @see Node * @see MuteNode */ - static Node *convert(bNode *bNode); + static Node *convert(bNode *b_node); /** * @brief This method will add a datetype conversion rule when the to-socket does not support the from-socket actual data type. diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cpp b/source/blender/compositor/intern/COM_ExecutionGroup.cpp index 5aa9ff21070..1a0bd95b7d6 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cpp +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cpp @@ -333,13 +333,12 @@ void ExecutionGroup::execute(ExecutionSystem *graph) const int maxNumberEvaluated = BLI_system_thread_count() * 2; while (!finished && !breaked) { - unsigned int index; bool startEvaluated = false; finished = true; int numberEvaluated = 0; for (index = startIndex; index < this->m_numberOfChunks && numberEvaluated < maxNumberEvaluated; index++) { - int chunkNumber = chunkOrder[index]; + chunkNumber = chunkOrder[index]; int yChunk = chunkNumber / this->m_numberOfXChunks; int xChunk = chunkNumber - (yChunk * this->m_numberOfXChunks); const ChunkExecutionState state = this->m_chunkExecutionStates[chunkNumber]; diff --git a/source/blender/compositor/intern/COM_ExecutionSystem.cpp b/source/blender/compositor/intern/COM_ExecutionSystem.cpp index d5477cc1414..23e243187d5 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystem.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystem.cpp @@ -23,7 +23,6 @@ #include "COM_ExecutionSystem.h" #include -#include #include "PIL_time.h" #include "BKE_node.h" @@ -209,7 +208,6 @@ void ExecutionSystem::addReadWriteBufferOperations(NodeOperation *operation) */ OutputSocket *outputsocket = operation->getOutputSocket(); if (outputsocket->isConnected()) { - int index; WriteBufferOperation *writeOperation; writeOperation = new WriteBufferOperation(); writeOperation->setbNodeTree(this->getContext().getbNodeTree()); diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp index e5376567077..0f6ba1f4ac9 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp +++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.cpp @@ -77,11 +77,11 @@ void ExecutionSystemHelper::addNode(vector& nodes, Node *node) nodes.push_back(node); } -Node *ExecutionSystemHelper::addNode(vector& nodes, bNode *bNode, bool inActiveGroup) +Node *ExecutionSystemHelper::addNode(vector& nodes, bNode *b_node, bool inActiveGroup) { Converter converter; Node *node; - node = converter.convert(bNode); + node = converter.convert(b_node); node->setIsInActiveGroup(inActiveGroup); if (node != NULL) { addNode(nodes, node); @@ -153,17 +153,17 @@ static OutputSocket *find_output(NodeRange &node_range, bNode *bnode, bNodeSocke } return NULL; } -SocketConnection *ExecutionSystemHelper::addNodeLink(NodeRange &node_range, vector& links, bNodeLink *bNodeLink) +SocketConnection *ExecutionSystemHelper::addNodeLink(NodeRange &node_range, vector& links, bNodeLink *b_nodelink) { /// @note: cyclic lines will be ignored. This has been copied from node.c - if (bNodeLink->tonode != 0 && bNodeLink->fromnode != 0) { - if (!(bNodeLink->fromnode->level >= bNodeLink->tonode->level && bNodeLink->tonode->level != 0xFFF)) { // only add non cyclic lines! so execution will procede + if (b_nodelink->tonode != 0 && b_nodelink->fromnode != 0) { + if (!(b_nodelink->fromnode->level >= b_nodelink->tonode->level && b_nodelink->tonode->level != 0xFFF)) { // only add non cyclic lines! so execution will procede return NULL; } } - InputSocket *inputSocket = find_input(node_range, bNodeLink->tonode, bNodeLink->tosock); - OutputSocket *outputSocket = find_output(node_range, bNodeLink->fromnode, bNodeLink->fromsock); + InputSocket *inputSocket = find_input(node_range, b_nodelink->tonode, b_nodelink->tosock); + OutputSocket *outputSocket = find_output(node_range, b_nodelink->fromnode, b_nodelink->fromsock); if (inputSocket == NULL || outputSocket == NULL) { return NULL; } diff --git a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h index 31ff97614da..4b65ed15577 100644 --- a/source/blender/compositor/intern/COM_ExecutionSystemHelper.h +++ b/source/blender/compositor/intern/COM_ExecutionSystemHelper.h @@ -58,7 +58,7 @@ public: * @param bNode node to add * @return Node that represents the bNode or null when not able to convert. */ - static Node *addNode(vector& nodes, bNode *bNode, bool isInActiveGroup); + static Node *addNode(vector& nodes, bNode *b_node, bool isInActiveGroup); /** * @brief Add a Node to a list diff --git a/source/blender/compositor/intern/COM_Node.h b/source/blender/compositor/intern/COM_Node.h index 39309b442d1..5d6d232f37a 100644 --- a/source/blender/compositor/intern/COM_Node.h +++ b/source/blender/compositor/intern/COM_Node.h @@ -70,7 +70,7 @@ public: * @brief Is this node in the active group (the group that is being edited) * @param isInActiveGroup */ - void setIsInActiveGroup(bool isInActiveGroup) { this->m_inActiveGroup = isInActiveGroup; } + void setIsInActiveGroup(bool value) { this->m_inActiveGroup = value; } /** * @brief Is this node part of the active group diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index 73c60d29ed6..c49ac24e018 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -43,24 +43,24 @@ /// @brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is created -static vector cpudevices; +static vector g_cpudevices; #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE /// @brief list of all thread for every CPUDevice in cpudevices a thread exists -static ListBase cputhreads; +static ListBase g_cputhreads; /// @brief all scheduled work for the cpu -static ThreadQueue *cpuqueue; -static ThreadQueue *gpuqueue; +static ThreadQueue *g_cpuqueue; +static ThreadQueue *g_gpuqueue; #ifdef COM_OPENCL_ENABLED -static cl_context context; -static cl_program program; +static cl_context g_context; +static cl_program g_program; /// @brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice is created -static vector gpudevices; +static vector g_gpudevices; /// @brief list of all thread for every GPUDevice in cpudevices a thread exists -static ListBase gputhreads; +static ListBase g_gputhreads; /// @brief all scheduled work for the gpu #ifdef COM_OPENCL_ENABLED -static bool openclActive = false; +static bool g_openclActive = false; #endif #endif #endif @@ -72,7 +72,7 @@ void *WorkScheduler::thread_execute_cpu(void *data) Device *device = (Device *)data; WorkPackage *work; - while ((work = (WorkPackage *)BLI_thread_queue_pop(cpuqueue))) { + while ((work = (WorkPackage *)BLI_thread_queue_pop(g_cpuqueue))) { device->execute(work); delete work; } @@ -85,7 +85,7 @@ void *WorkScheduler::thread_execute_gpu(void *data) Device *device = (Device *)data; WorkPackage *work; - while ((work = (WorkPackage *)BLI_thread_queue_pop(gpuqueue))) { + while ((work = (WorkPackage *)BLI_thread_queue_pop(g_gpuqueue))) { device->execute(work); delete work; } @@ -105,11 +105,11 @@ void WorkScheduler::schedule(ExecutionGroup *group, int chunkNumber) delete package; #elif COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE #ifdef COM_OPENCL_ENABLED - if (group->isOpenCL() && openclActive) { - BLI_thread_queue_push(gpuqueue, package); + if (group->isOpenCL() && g_openclActive) { + BLI_thread_queue_push(g_gpuqueue, package); } else { - BLI_thread_queue_push(cpuqueue, package); + BLI_thread_queue_push(g_cpuqueue, package); } #else BLI_thread_queue_push(cpuqueue, package); @@ -121,24 +121,24 @@ void WorkScheduler::start(CompositorContext &context) { #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE unsigned int index; - cpuqueue = BLI_thread_queue_init(); - BLI_init_threads(&cputhreads, thread_execute_cpu, cpudevices.size()); - for (index = 0; index < cpudevices.size(); index++) { - Device *device = cpudevices[index]; - BLI_insert_thread(&cputhreads, device); + g_cpuqueue = BLI_thread_queue_init(); + BLI_init_threads(&g_cputhreads, thread_execute_cpu, g_cpudevices.size()); + for (index = 0; index < g_cpudevices.size(); index++) { + Device *device = g_cpudevices[index]; + BLI_insert_thread(&g_cputhreads, device); } #ifdef COM_OPENCL_ENABLED if (context.getHasActiveOpenCLDevices()) { - gpuqueue = BLI_thread_queue_init(); - BLI_init_threads(&gputhreads, thread_execute_gpu, gpudevices.size()); - for (index = 0; index < gpudevices.size(); index++) { - Device *device = gpudevices[index]; - BLI_insert_thread(&gputhreads, device); + g_gpuqueue = BLI_thread_queue_init(); + BLI_init_threads(&g_gputhreads, thread_execute_gpu, g_gpudevices.size()); + for (index = 0; index < g_gpudevices.size(); index++) { + Device *device = g_gpudevices[index]; + BLI_insert_thread(&g_gputhreads, device); } - openclActive = true; + g_openclActive = true; } else { - openclActive = false; + g_openclActive = false; } #endif #endif @@ -147,12 +147,12 @@ void WorkScheduler::finish() { #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE #ifdef COM_OPENCL_ENABLED - if (openclActive) { - BLI_thread_queue_wait_finish(gpuqueue); - BLI_thread_queue_wait_finish(cpuqueue); + if (g_openclActive) { + BLI_thread_queue_wait_finish(g_gpuqueue); + BLI_thread_queue_wait_finish(g_cpuqueue); } else { - BLI_thread_queue_wait_finish(cpuqueue); + BLI_thread_queue_wait_finish(g_cpuqueue); } #else BLI_thread_queue_wait_finish(cpuqueue); @@ -162,16 +162,16 @@ void WorkScheduler::finish() void WorkScheduler::stop() { #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE - BLI_thread_queue_nowait(cpuqueue); - BLI_end_threads(&cputhreads); - BLI_thread_queue_free(cpuqueue); - cpuqueue = NULL; + BLI_thread_queue_nowait(g_cpuqueue); + BLI_end_threads(&g_cputhreads); + BLI_thread_queue_free(g_cpuqueue); + g_cpuqueue = NULL; #ifdef COM_OPENCL_ENABLED - if (openclActive) { - BLI_thread_queue_nowait(gpuqueue); - BLI_end_threads(&gputhreads); - BLI_thread_queue_free(gpuqueue); - gpuqueue = NULL; + if (g_openclActive) { + BLI_thread_queue_nowait(g_gpuqueue); + BLI_end_threads(&g_gputhreads); + BLI_thread_queue_free(g_gpuqueue); + g_gpuqueue = NULL; } #endif #endif @@ -181,7 +181,7 @@ bool WorkScheduler::hasGPUDevices() { #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE #ifdef COM_OPENCL_ENABLED - return gpudevices.size() > 0; + return g_gpudevices.size() > 0; #else return 0; #endif @@ -203,11 +203,11 @@ void WorkScheduler::initialize() for (int index = 0; index < numberOfCPUThreads; index++) { CPUDevice *device = new CPUDevice(); device->initialize(); - cpudevices.push_back(device); + g_cpudevices.push_back(device); } #ifdef COM_OPENCL_ENABLED - context = NULL; - program = NULL; + g_context = NULL; + g_program = NULL; if (clCreateContextFromType) { cl_uint numberOfPlatforms = 0; cl_int error; @@ -225,18 +225,18 @@ void WorkScheduler::initialize() cl_device_id *cldevices = new cl_device_id[numberOfDevices]; clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices, 0); - context = clCreateContext(NULL, numberOfDevices, cldevices, clContextError, NULL, &error); + g_context = clCreateContext(NULL, numberOfDevices, cldevices, clContextError, NULL, &error); if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - program = clCreateProgramWithSource(context, 1, &clkernelstoh_COM_OpenCLKernels_cl, 0, &error); - error = clBuildProgram(program, numberOfDevices, cldevices, 0, 0, 0); + g_program = clCreateProgramWithSource(g_context, 1, &clkernelstoh_COM_OpenCLKernels_cl, 0, &error); + error = clBuildProgram(g_program, numberOfDevices, cldevices, 0, 0, 0); if (error != CL_SUCCESS) { cl_int error2; size_t ret_val_size = 0; printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); - error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size); + error2 = clGetProgramBuildInfo(g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size); if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } char *build_log = new char[ret_val_size + 1]; - error2 = clGetProgramBuildInfo(program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL); + error2 = clGetProgramBuildInfo(g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL); if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } build_log[ret_val_size] = '\0'; printf("%s", build_log); @@ -247,11 +247,11 @@ void WorkScheduler::initialize() for (indexDevices = 0; indexDevices < numberOfDevices; indexDevices++) { cl_device_id device = cldevices[indexDevices]; cl_int vendorID = 0; - cl_int error = clGetDeviceInfo(device, CL_DEVICE_VENDOR_ID, sizeof(cl_int), &vendorID, NULL); - if (error!= CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); } - OpenCLDevice *clDevice = new OpenCLDevice(context, device, program, vendorID); + cl_int error2 = clGetDeviceInfo(device, CL_DEVICE_VENDOR_ID, sizeof(cl_int), &vendorID, NULL); + if (error2 != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error2, clewErrorString(error2)); } + OpenCLDevice *clDevice = new OpenCLDevice(g_context, device, g_program, vendorID); clDevice->initialize(); - gpudevices.push_back(clDevice); + g_gpudevices.push_back(clDevice); } } delete[] cldevices; @@ -267,26 +267,26 @@ void WorkScheduler::deinitialize() { #if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE Device *device; - while (cpudevices.size() > 0) { - device = cpudevices.back(); - cpudevices.pop_back(); + while (g_cpudevices.size() > 0) { + device = g_cpudevices.back(); + g_cpudevices.pop_back(); device->deinitialize(); delete device; } #ifdef COM_OPENCL_ENABLED - while (gpudevices.size() > 0) { - device = gpudevices.back(); - gpudevices.pop_back(); + while (g_gpudevices.size() > 0) { + device = g_gpudevices.back(); + g_gpudevices.pop_back(); device->deinitialize(); delete device; } - if (program) { - clReleaseProgram(program); - program = NULL; + if (g_program) { + clReleaseProgram(g_program); + g_program = NULL; } - if (context) { - clReleaseContext(context); - context = NULL; + if (g_context) { + clReleaseContext(g_context); + g_context = NULL; } #endif #endif diff --git a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp index 6a11f086b95..3f4e3736bbe 100644 --- a/source/blender/compositor/nodes/COM_DilateErodeNode.cpp +++ b/source/blender/compositor/nodes/COM_DilateErodeNode.cpp @@ -119,9 +119,9 @@ void DilateErodeNode::convertToOperations(ExecutionSystem *graph, CompositorCont operationy->setSubtract(editorNode->custom2 < 0); if (editorNode->storage) { - NodeDilateErode *data = (NodeDilateErode *)editorNode->storage; - operationx->setFalloff(data->falloff); - operationy->setFalloff(data->falloff); + NodeDilateErode *data_storage = (NodeDilateErode *)editorNode->storage; + operationx->setFalloff(data_storage->falloff); + operationy->setFalloff(data_storage->falloff); } } else { diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp index b521a2a5415..e56fb9151f2 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.cpp @@ -24,7 +24,7 @@ AlphaOverMixedOperation::AlphaOverMixedOperation() : MixBaseOperation() { - this->x = 0.0f; + this->m_x = 0.0f; } void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float y, PixelSampler sampler, MemoryBuffer *inputBuffers[]) @@ -44,7 +44,7 @@ void AlphaOverMixedOperation::executePixel(float outputValue[4], float x, float copy_v4_v4(outputValue, inputOverColor); } else { - float addfac = 1.0f - this->x + inputOverColor[3] * this->x; + float addfac = 1.0f - this->m_x + inputOverColor[3] * this->m_x; float premul = value[0] * addfac; float mul = 1.0f - value[0] * inputOverColor[3]; diff --git a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h index 2807b3b489a..24a991da17b 100644 --- a/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h +++ b/source/blender/compositor/operations/COM_AlphaOverMixedOperation.h @@ -20,8 +20,8 @@ * Monique Dewanchand */ -#ifndef _COM_AlphaOverMixedOperation_h -#define _COM_AlphaOverMixedOperation_h +#ifndef _COM_AlphaOverMixedOperation_h_ +#define _COM_AlphaOverMixedOperation_h_ #include "COM_MixBaseOperation.h" @@ -31,7 +31,7 @@ */ class AlphaOverMixedOperation : public MixBaseOperation { private: - float x; + float m_x; public: /** * Default constructor @@ -43,6 +43,6 @@ public: */ void executePixel(float *color, float x, float y, PixelSampler sampler, MemoryBuffer * inputBuffers[]); - void setX(float x) { this->x = x; } + void setX(float x) { this->m_x = x; } }; #endif diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp index ecfcdb7c70f..087e7a15e39 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp @@ -150,10 +150,10 @@ void OutputSingleLayerOperation::deinitExecution() } -OutputOpenExrLayer::OutputOpenExrLayer(const char *name, DataType datatype) +OutputOpenExrLayer::OutputOpenExrLayer(const char *name_, DataType datatype_) { - BLI_strncpy(this->name, name, sizeof(this->name)); - this->datatype = datatype; + BLI_strncpy(this->name, name_, sizeof(this->name)); + this->datatype = datatype_; /* these are created in initExecution */ this->outputBuffer = 0; this->imageInput = 0;