From 891949cbb47143420f4324cb60efc05ef5d70b39 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 25 Sep 2022 17:04:52 +1000 Subject: Cleanup: use 'u' prefixed integer types for brevity & cast style To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'. --- source/blender/compositor/intern/COM_CPUDevice.cc | 2 +- source/blender/compositor/intern/COM_ChunkOrder.cc | 2 +- .../compositor/intern/COM_ExecutionGroup.cc | 52 +++--- .../blender/compositor/intern/COM_MemoryBuffer.cc | 4 +- .../blender/compositor/intern/COM_MemoryProxy.cc | 2 +- source/blender/compositor/intern/COM_Node.cc | 4 +- .../blender/compositor/intern/COM_NodeOperation.cc | 12 +- .../blender/compositor/intern/COM_OpenCLDevice.cc | 2 +- .../compositor/intern/COM_TiledExecutionModel.cc | 4 +- .../blender/compositor/intern/COM_WorkScheduler.cc | 4 +- .../operations/COM_AntiAliasOperation.cc | 24 +-- .../operations/COM_CompositorOperation.cc | 2 +- .../operations/COM_DoubleEdgeMaskOperation.cc | 208 +++++++++------------ .../operations/COM_FastGaussianBlurOperation.cc | 13 +- .../operations/COM_GlareFogGlowOperation.cc | 53 +++--- .../operations/COM_GlareStreaksOperation.cc | 2 +- .../compositor/operations/COM_ImageOperation.cc | 2 +- .../operations/COM_KeyingScreenOperation.cc | 2 +- .../compositor/operations/COM_MaskOperation.cc | 6 +- .../operations/COM_MultilayerImageOperation.cc | 9 +- .../operations/COM_OutputFileMultiViewOperation.cc | 24 +-- .../operations/COM_OutputFileOperation.cc | 20 +- .../compositor/operations/COM_PreviewOperation.cc | 13 +- .../compositor/operations/COM_RenderLayersProg.cc | 4 +- .../COM_VariableSizeBokehBlurOperation.cc | 4 +- .../compositor/operations/COM_ViewerOperation.cc | 2 +- .../operations/COM_WriteBufferOperation.cc | 8 +- .../realtime_compositor/intern/shader_operation.cc | 2 +- 28 files changed, 228 insertions(+), 258 deletions(-) (limited to 'source/blender/compositor') diff --git a/source/blender/compositor/intern/COM_CPUDevice.cc b/source/blender/compositor/intern/COM_CPUDevice.cc index 93c0b233752..916c7e1a411 100644 --- a/source/blender/compositor/intern/COM_CPUDevice.cc +++ b/source/blender/compositor/intern/COM_CPUDevice.cc @@ -16,7 +16,7 @@ void CPUDevice::execute(WorkPackage *work_package) { switch (work_package->type) { case eWorkPackageType::Tile: { - const unsigned int chunk_number = work_package->chunk_number; + const uint chunk_number = work_package->chunk_number; ExecutionGroup *execution_group = work_package->execution_group; execution_group->get_output_operation()->execute_region(&work_package->rect, chunk_number); diff --git a/source/blender/compositor/intern/COM_ChunkOrder.cc b/source/blender/compositor/intern/COM_ChunkOrder.cc index 38298840bf0..acc19155049 100644 --- a/source/blender/compositor/intern/COM_ChunkOrder.cc +++ b/source/blender/compositor/intern/COM_ChunkOrder.cc @@ -7,7 +7,7 @@ namespace blender::compositor { -void ChunkOrder::update_distance(ChunkOrderHotspot *hotspots, unsigned int len_hotspots) +void ChunkOrder::update_distance(ChunkOrderHotspot *hotspots, uint len_hotspots) { double new_distance = DBL_MAX; for (int index = 0; index < len_hotspots; index++) { diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cc b/source/blender/compositor/intern/COM_ExecutionGroup.cc index 6f2d4faffb1..9b4c46654f2 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cc +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cc @@ -126,7 +126,7 @@ void ExecutionGroup::init_work_packages() work_packages_.clear(); if (chunks_len_ != 0) { work_packages_.resize(chunks_len_); - for (unsigned int index = 0; index < chunks_len_; index++) { + for (uint index = 0; index < chunks_len_; index++) { work_packages_[index].type = eWorkPackageType::Tile; work_packages_[index].state = eWorkPackageState::NotScheduled; work_packages_[index].execution_group = this; @@ -138,7 +138,7 @@ void ExecutionGroup::init_work_packages() void ExecutionGroup::init_read_buffer_operations() { - unsigned int max_offset = 0; + uint max_offset = 0; for (NodeOperation *operation : operations_) { if (operation->get_flags().is_read_buffer_operation) { ReadBufferOperation *read_operation = static_cast(operation); @@ -167,7 +167,7 @@ void ExecutionGroup::deinit_execution() bTree_ = nullptr; } -void ExecutionGroup::determine_resolution(unsigned int resolution[2]) +void ExecutionGroup::determine_resolution(uint resolution[2]) { NodeOperation *operation = this->get_output_operation(); resolution[0] = operation->get_width(); @@ -193,9 +193,9 @@ void ExecutionGroup::init_number_of_chunks() } } -blender::Array ExecutionGroup::get_execution_order() const +blender::Array ExecutionGroup::get_execution_order() const { - blender::Array chunk_order(chunks_len_); + blender::Array chunk_order(chunks_len_); for (int chunk_index = 0; chunk_index < chunks_len_; chunk_index++) { chunk_order[chunk_index] = chunk_index; } @@ -218,7 +218,7 @@ blender::Array ExecutionGroup::get_execution_order() const switch (order_type) { case ChunkOrdering::Random: { static blender::RandomNumberGenerator rng; - blender::MutableSpan span = chunk_order.as_mutable_span(); + blender::MutableSpan span = chunk_order.as_mutable_span(); /* Shuffle twice to make it more random. */ rng.shuffle(span); rng.shuffle(span); @@ -243,12 +243,12 @@ blender::Array ExecutionGroup::get_execution_order() const break; } case ChunkOrdering::RuleOfThirds: { - unsigned int tx = border_width / 6; - unsigned int ty = border_height / 6; - unsigned int mx = border_width / 2; - unsigned int my = border_height / 2; - unsigned int bx = mx + 2 * tx; - unsigned int by = my + 2 * ty; + uint tx = border_width / 6; + uint ty = border_height / 6; + uint mx = border_width / 2; + uint my = border_height / 2; + uint bx = mx + 2 * tx; + uint by = my + 2 * ty; float addition = chunks_len_ / COM_RULE_OF_THIRDS_DIVIDER; ChunkOrderHotspot hotspots[9]{ @@ -300,21 +300,21 @@ void ExecutionGroup::execute(ExecutionSystem *graph) if (chunks_len_ == 0) { return; } /** \note Early break out. */ - unsigned int chunk_index; + uint chunk_index; execution_start_time_ = PIL_check_seconds_timer(); chunks_finished_ = 0; bTree_ = bTree; - blender::Array chunk_order = get_execution_order(); + blender::Array chunk_order = get_execution_order(); DebugInfo::execution_group_started(this); DebugInfo::graphviz(graph); bool breaked = false; bool finished = false; - unsigned int start_index = 0; + uint start_index = 0; const int max_number_evaluated = BLI_system_thread_count() * 2; while (!finished && !breaked) { @@ -399,7 +399,7 @@ void ExecutionGroup::finalize_chunk_execution(int chunk_number, MemoryBuffer **m atomic_add_and_fetch_u(&chunks_finished_, 1); if (memory_buffers) { - for (unsigned int index = 0; index < max_read_buffer_offset_; index++) { + for (uint index = 0; index < max_read_buffer_offset_; index++) { MemoryBuffer *buffer = memory_buffers[index]; if (buffer) { if (buffer->is_temporarily()) { @@ -424,8 +424,8 @@ void ExecutionGroup::finalize_chunk_execution(int chunk_number, MemoryBuffer **m } inline void ExecutionGroup::determine_chunk_rect(rcti *r_rect, - const unsigned int x_chunk, - const unsigned int y_chunk) const + const uint x_chunk, + const uint y_chunk) const { const int border_width = BLI_rcti_size_x(&viewer_border_); const int border_height = BLI_rcti_size_y(&viewer_border_); @@ -434,10 +434,10 @@ inline void ExecutionGroup::determine_chunk_rect(rcti *r_rect, BLI_rcti_init(r_rect, viewer_border_.xmin, border_width, viewer_border_.ymin, border_height); } else { - const unsigned int minx = x_chunk * chunk_size_ + viewer_border_.xmin; - const unsigned int miny = y_chunk * chunk_size_ + viewer_border_.ymin; - const unsigned int width = MIN2((unsigned int)viewer_border_.xmax, width_); - const unsigned int height = MIN2((unsigned int)viewer_border_.ymax, height_); + const uint minx = x_chunk * chunk_size_ + viewer_border_.xmin; + const uint miny = y_chunk * chunk_size_ + viewer_border_.ymin; + const uint width = MIN2((uint)viewer_border_.xmax, width_); + const uint height = MIN2((uint)viewer_border_.ymax, height_); BLI_rcti_init(r_rect, MIN2(minx, width_), MIN2(minx + chunk_size_, width), @@ -446,10 +446,10 @@ inline void ExecutionGroup::determine_chunk_rect(rcti *r_rect, } } -void ExecutionGroup::determine_chunk_rect(rcti *r_rect, const unsigned int chunk_number) const +void ExecutionGroup::determine_chunk_rect(rcti *r_rect, const uint chunk_number) const { - const unsigned int y_chunk = chunk_number / x_chunks_len_; - const unsigned int x_chunk = chunk_number - (y_chunk * x_chunks_len_); + const uint y_chunk = chunk_number / x_chunks_len_; + const uint x_chunk = chunk_number - (y_chunk * x_chunks_len_); determine_chunk_rect(r_rect, x_chunk, y_chunk); } @@ -501,7 +501,7 @@ bool ExecutionGroup::schedule_area_when_possible(ExecutionSystem *graph, rcti *a return result; } -bool ExecutionGroup::schedule_chunk(unsigned int chunk_number) +bool ExecutionGroup::schedule_chunk(uint chunk_number) { WorkPackage &work_package = work_packages_[chunk_number]; if (work_package.state == eWorkPackageState::NotScheduled) { diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cc b/source/blender/compositor/intern/COM_MemoryBuffer.cc index ea2a85e8ea9..95bb233ff6c 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cc +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cc @@ -133,8 +133,8 @@ MemoryBuffer *MemoryBuffer::inflate() const float MemoryBuffer::get_max_value() const { float result = buffer_[0]; - const unsigned int size = this->buffer_len(); - unsigned int i; + const uint size = this->buffer_len(); + uint i; const float *fp_src = buffer_; diff --git a/source/blender/compositor/intern/COM_MemoryProxy.cc b/source/blender/compositor/intern/COM_MemoryProxy.cc index 42d0f86843d..723e8b3ab9b 100644 --- a/source/blender/compositor/intern/COM_MemoryProxy.cc +++ b/source/blender/compositor/intern/COM_MemoryProxy.cc @@ -14,7 +14,7 @@ MemoryProxy::MemoryProxy(DataType datatype) datatype_ = datatype; } -void MemoryProxy::allocate(unsigned int width, unsigned int height) +void MemoryProxy::allocate(uint width, uint height) { rcti result; result.xmin = 0; diff --git a/source/blender/compositor/intern/COM_Node.cc b/source/blender/compositor/intern/COM_Node.cc index a71c7868518..471bb29d263 100644 --- a/source/blender/compositor/intern/COM_Node.cc +++ b/source/blender/compositor/intern/COM_Node.cc @@ -81,12 +81,12 @@ void Node::add_output_socket(DataType datatype, bNodeSocket *bSocket) outputs_.append(socket); } -NodeOutput *Node::get_output_socket(unsigned int index) const +NodeOutput *Node::get_output_socket(uint index) const { return outputs_[index]; } -NodeInput *Node::get_input_socket(unsigned int index) const +NodeInput *Node::get_input_socket(uint index) const { return inputs_[index]; } diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index 3867b1d5c10..ab9b5ad1ad6 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -84,12 +84,12 @@ std::optional NodeOperation::generate_hash() return hash; } -NodeOperationOutput *NodeOperation::get_output_socket(unsigned int index) +NodeOperationOutput *NodeOperation::get_output_socket(uint index) { return &outputs_[index]; } -NodeOperationInput *NodeOperation::get_input_socket(unsigned int index) +NodeOperationInput *NodeOperation::get_input_socket(uint index) { return &inputs_[index]; } @@ -106,7 +106,7 @@ void NodeOperation::add_output_socket(DataType datatype) void NodeOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) { - unsigned int used_canvas_index = 0; + uint used_canvas_index = 0; if (canvas_input_index_ == RESOLUTION_INPUT_ANY) { for (NodeOperationInput &input : inputs_) { rcti any_area = COM_AREA_NONE; @@ -130,7 +130,7 @@ void NodeOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) rcti unused_area = COM_AREA_NONE; const rcti &local_preferred_area = r_area; - for (unsigned int index = 0; index < inputs_.size(); index++) { + for (uint index = 0; index < inputs_.size(); index++) { if (index == used_canvas_index) { continue; } @@ -141,7 +141,7 @@ void NodeOperation::determine_canvas(const rcti &preferred_area, rcti &r_area) } } -void NodeOperation::set_canvas_input_index(unsigned int index) +void NodeOperation::set_canvas_input_index(uint index) { this->canvas_input_index_ = index; } @@ -197,7 +197,7 @@ void NodeOperation::unset_canvas() flags_.is_canvas_set = false; } -SocketReader *NodeOperation::get_input_socket_reader(unsigned int index) +SocketReader *NodeOperation::get_input_socket_reader(uint index) { return this->get_input_socket(index)->get_reader(); } diff --git a/source/blender/compositor/intern/COM_OpenCLDevice.cc b/source/blender/compositor/intern/COM_OpenCLDevice.cc index d951ebef172..5d5751944b2 100644 --- a/source/blender/compositor/intern/COM_OpenCLDevice.cc +++ b/source/blender/compositor/intern/COM_OpenCLDevice.cc @@ -56,7 +56,7 @@ OpenCLDevice::~OpenCLDevice() void OpenCLDevice::execute(WorkPackage *work_package) { - const unsigned int chunk_number = work_package->chunk_number; + const uint chunk_number = work_package->chunk_number; ExecutionGroup *execution_group = work_package->execution_group; MemoryBuffer **input_buffers = execution_group->get_input_buffers_opencl(chunk_number); diff --git a/source/blender/compositor/intern/COM_TiledExecutionModel.cc b/source/blender/compositor/intern/COM_TiledExecutionModel.cc index cf8d3e9a084..54e8e8f315a 100644 --- a/source/blender/compositor/intern/COM_TiledExecutionModel.cc +++ b/source/blender/compositor/intern/COM_TiledExecutionModel.cc @@ -23,7 +23,7 @@ TiledExecutionModel::TiledExecutionModel(CompositorContext &context, const bNodeTree *node_tree = context.get_bnodetree(); node_tree->stats_draw(node_tree->sdh, TIP_("Compositing | Determining resolution")); - unsigned int resolution[2]; + uint resolution[2]; for (ExecutionGroup *group : groups_) { resolution[0] = 0; resolution[1] = 0; @@ -45,7 +45,7 @@ TiledExecutionModel::TiledExecutionModel(CompositorContext &context, static void update_read_buffer_offset(Span operations) { - unsigned int order = 0; + uint order = 0; for (NodeOperation *operation : operations) { if (operation->get_flags().is_read_buffer_operation) { ReadBufferOperation *read_operation = (ReadBufferOperation *)operation; diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cc b/source/blender/compositor/intern/COM_WorkScheduler.cc index 1f93a3d9bfa..9414d7d7afa 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cc +++ b/source/blender/compositor/intern/COM_WorkScheduler.cc @@ -185,7 +185,7 @@ static void opencl_initialize(const bool use_opencl) cl_platform_id *platforms = (cl_platform_id *)MEM_mallocN( sizeof(cl_platform_id) * number_of_platforms, __func__); error = clGetPlatformIDs(number_of_platforms, platforms, nullptr); - unsigned int index_platform; + uint index_platform; for (index_platform = 0; index_platform < number_of_platforms; index_platform++) { cl_platform_id platform = platforms[index_platform]; cl_uint number_of_devices = 0; @@ -240,7 +240,7 @@ static void opencl_initialize(const bool use_opencl) MEM_freeN(build_log); } else { - unsigned int index_devices; + uint index_devices; for (index_devices = 0; index_devices < number_of_devices; index_devices++) { cl_device_id device = cldevices[index_devices]; cl_int vendorID = 0; diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.cc b/source/blender/compositor/operations/COM_AntiAliasOperation.cc index 0c297c20eef..de01d0c8bf7 100644 --- a/source/blender/compositor/operations/COM_AntiAliasOperation.cc +++ b/source/blender/compositor/operations/COM_AntiAliasOperation.cc @@ -144,12 +144,12 @@ void AntiAliasOperation::execute_pixel(float output[4], int x, int y, void *data /* Some rounding magic to so make weighting correct with the * original coefficients. */ - unsigned char result = ((3 * ninepix[0] + 5 * ninepix[1] + 3 * ninepix[2] + 5 * ninepix[3] + - 6 * ninepix[4] + 5 * ninepix[5] + 3 * ninepix[6] + 5 * ninepix[7] + - 3 * ninepix[8]) * - 255.0f + - 19.0f) / - 38.0f; + uchar result = ((3 * ninepix[0] + 5 * ninepix[1] + 3 * ninepix[2] + 5 * ninepix[3] + + 6 * ninepix[4] + 5 * ninepix[5] + 3 * ninepix[6] + 5 * ninepix[7] + + 3 * ninepix[8]) * + 255.0f + + 19.0f) / + 38.0f; output[0] = result / 255.0f; } else { @@ -234,12 +234,12 @@ void AntiAliasOperation::update_memory_buffer_partial(MemoryBuffer *output, &row_next[x_offset + input->elem_stride])) { /* Some rounding magic to make weighting correct with the * original coefficients. */ - unsigned char result = ((3 * ninepix[0] + 5 * ninepix[1] + 3 * ninepix[2] + - 5 * ninepix[3] + 6 * ninepix[4] + 5 * ninepix[5] + - 3 * ninepix[6] + 5 * ninepix[7] + 3 * ninepix[8]) * - 255.0f + - 19.0f) / - 38.0f; + uchar result = ((3 * ninepix[0] + 5 * ninepix[1] + 3 * ninepix[2] + 5 * ninepix[3] + + 6 * ninepix[4] + 5 * ninepix[5] + 3 * ninepix[6] + 5 * ninepix[7] + + 3 * ninepix[8]) * + 255.0f + + 19.0f) / + 38.0f; out[0] = result / 255.0f; } else { diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cc b/source/blender/compositor/operations/COM_CompositorOperation.cc index c0cc3fa1ba4..039a2538427 100644 --- a/source/blender/compositor/operations/COM_CompositorOperation.cc +++ b/source/blender/compositor/operations/COM_CompositorOperation.cc @@ -113,7 +113,7 @@ void CompositorOperation::deinit_execution() depth_input_ = nullptr; } -void CompositorOperation::execute_region(rcti *rect, unsigned int /*tile_number*/) +void CompositorOperation::execute_region(rcti *rect, uint /*tile_number*/) { float color[8]; /* 7 is enough. */ float *buffer = output_buffer_; diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc index fed11d59b50..863171f105e 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc @@ -8,18 +8,13 @@ namespace blender::compositor { /* This part has been copied from the double edge mask. */ -static void do_adjacentKeepBorders(unsigned int t, - unsigned int rw, - const unsigned int *limask, - const unsigned int *lomask, - unsigned int *lres, - float *res, - unsigned int *rsize) +static void do_adjacentKeepBorders( + uint t, uint rw, const uint *limask, const uint *lomask, uint *lres, float *res, uint *rsize) { int x; - unsigned int isz = 0; /* Inner edge size. */ - unsigned int osz = 0; /* Outer edge size. */ - unsigned int gsz = 0; /* Gradient fill area size. */ + uint isz = 0; /* Inner edge size. */ + uint osz = 0; /* Outer edge size. */ + uint gsz = 0; /* Gradient fill area size. */ /* Test the four corners */ /* Upper left corner. */ x = t - rw + 1; @@ -178,18 +173,13 @@ static void do_adjacentKeepBorders(unsigned int t, rsize[2] = gsz; } -static void do_adjacentBleedBorders(unsigned int t, - unsigned int rw, - const unsigned int *limask, - const unsigned int *lomask, - unsigned int *lres, - float *res, - unsigned int *rsize) +static void do_adjacentBleedBorders( + uint t, uint rw, const uint *limask, const uint *lomask, uint *lres, float *res, uint *rsize) { int x; - unsigned int isz = 0; /* Inner edge size. */ - unsigned int osz = 0; /* Outer edge size. */ - unsigned int gsz = 0; /* Gradient fill area size. */ + uint isz = 0; /* Inner edge size. */ + uint osz = 0; /* Outer edge size. */ + uint gsz = 0; /* Gradient fill area size. */ /* Test the four corners */ /* Upper left corner. */ x = t - rw + 1; @@ -403,18 +393,13 @@ static void do_adjacentBleedBorders(unsigned int t, rsize[2] = gsz; } -static void do_allKeepBorders(unsigned int t, - unsigned int rw, - const unsigned int *limask, - const unsigned int *lomask, - unsigned int *lres, - float *res, - unsigned int *rsize) +static void do_allKeepBorders( + uint t, uint rw, const uint *limask, const uint *lomask, uint *lres, float *res, uint *rsize) { int x; - unsigned int isz = 0; /* Inner edge size. */ - unsigned int osz = 0; /* Outer edge size. */ - unsigned int gsz = 0; /* Gradient fill area size. */ + uint isz = 0; /* Inner edge size. */ + uint osz = 0; /* Outer edge size. */ + uint gsz = 0; /* Gradient fill area size. */ /* Test the four corners. */ /* Upper left corner. */ x = t - rw + 1; @@ -565,18 +550,13 @@ static void do_allKeepBorders(unsigned int t, rsize[2] = gsz; } -static void do_allBleedBorders(unsigned int t, - unsigned int rw, - const unsigned int *limask, - const unsigned int *lomask, - unsigned int *lres, - float *res, - unsigned int *rsize) +static void do_allBleedBorders( + uint t, uint rw, const uint *limask, const uint *lomask, uint *lres, float *res, uint *rsize) { int x; - unsigned int isz = 0; /* Inner edge size. */ - unsigned int osz = 0; /* Outer edge size. */ - unsigned int gsz = 0; /* Gradient fill area size. */ + uint isz = 0; /* Inner edge size. */ + uint osz = 0; /* Outer edge size. */ + uint gsz = 0; /* Gradient fill area size. */ /* Test the four corners */ /* Upper left corner. */ x = t - rw + 1; @@ -782,16 +762,16 @@ static void do_allBleedBorders(unsigned int t, rsize[2] = gsz; } -static void do_allEdgeDetection(unsigned int t, - unsigned int rw, - const unsigned int *limask, - const unsigned int *lomask, - unsigned int *lres, +static void do_allEdgeDetection(uint t, + uint rw, + const uint *limask, + const uint *lomask, + uint *lres, float *res, - unsigned int *rsize, - unsigned int in_isz, - unsigned int in_osz, - unsigned int in_gsz) + uint *rsize, + uint in_isz, + uint in_osz, + uint in_gsz) { int x; /* Pixel loop counter. */ int a; /* Pixel loop counter. */ @@ -853,16 +833,16 @@ static void do_allEdgeDetection(unsigned int t, rsize[2] = in_gsz; } -static void do_adjacentEdgeDetection(unsigned int t, - unsigned int rw, - const unsigned int *limask, - const unsigned int *lomask, - unsigned int *lres, +static void do_adjacentEdgeDetection(uint t, + uint rw, + const uint *limask, + const uint *lomask, + uint *lres, float *res, - unsigned int *rsize, - unsigned int in_isz, - unsigned int in_osz, - unsigned int in_gsz) + uint *rsize, + uint in_isz, + uint in_osz, + uint in_gsz) { int x; /* Pixel loop counter. */ int a; /* Pixel loop counter. */ @@ -925,30 +905,30 @@ static void do_adjacentEdgeDetection(unsigned int t, rsize[2] = in_gsz; } -static void do_createEdgeLocationBuffer(unsigned int t, - unsigned int rw, - const unsigned int *lres, +static void do_createEdgeLocationBuffer(uint t, + uint rw, + const uint *lres, float *res, - unsigned short *gbuf, - unsigned int *inner_edge_offset, - unsigned int *outer_edge_offset, - unsigned int isz, - unsigned int gsz) + ushort *gbuf, + uint *inner_edge_offset, + uint *outer_edge_offset, + uint isz, + uint gsz) { - int x; /* Pixel loop counter. */ - int a; /* Temporary pixel index buffer loop counter. */ - unsigned int ud; /* Unscaled edge distance. */ - unsigned int dmin; /* Minimum edge distance. */ + int x; /* Pixel loop counter. */ + int a; /* Temporary pixel index buffer loop counter. */ + uint ud; /* Unscaled edge distance. */ + uint dmin; /* Minimum edge distance. */ - unsigned int rsl; /* Long used for finding fast `1.0/sqrt`. */ - unsigned int gradient_fill_offset; + uint rsl; /* Long used for finding fast `1.0/sqrt`. */ + uint gradient_fill_offset; /* For looping inner edge pixel indexes, represents current position from offset. */ - unsigned int inner_accum = 0; + uint inner_accum = 0; /* For looping outer edge pixel indexes, represents current position from offset. */ - unsigned int outer_accum = 0; + uint outer_accum = 0; /* For looping gradient pixel indexes, represents current position from offset. */ - unsigned int gradient_accum = 0; + uint gradient_accum = 0; /* Disable clang-format to prevent line-wrapping. */ /* clang-format off */ @@ -958,12 +938,12 @@ static void do_createEdgeLocationBuffer(unsigned int t, * or outer edge. * * Allocation is done by requesting 4 bytes "sizeof(int)" per pixel, even - * though gbuf[] is declared as (unsigned short *) (2 bytes) because we don't + * though gbuf[] is declared as `(ushort *)` (2 bytes) because we don't * store the pixel indexes, we only store x,y location of pixel in buffer. * * This does make the assumption that x and y can fit in 16 unsigned bits * so if Blender starts doing renders greater than 65536 in either direction - * this will need to allocate gbuf[] as unsigned int *and allocate 8 bytes + * this will need to allocate gbuf[] as uint *and allocate 8 bytes * per flagged pixel. * * In general, the buffer on-screen: @@ -1028,20 +1008,20 @@ static void do_createEdgeLocationBuffer(unsigned int t, for (rsl = 0; rsl < rw; rsl++) { a = x + rsl; if (lres[a] == 2) { /* It is a gradient pixel flagged by 2. */ - ud = gradient_accum << 1; /* Double the index to reach correct unsigned short location. */ + ud = gradient_accum << 1; /* Double the index to reach correct ushort location. */ gbuf[ud] = dmin; /* Insert pixel's row into gradient pixel location buffer. */ gbuf[ud + 1] = rsl; /* Insert pixel's column into gradient pixel location buffer. */ gradient_accum++; /* Increment gradient index buffer pointer. */ } else if (lres[a] == 3) { /* It is an outer edge pixel flagged by 3. */ - ud = outer_accum << 1; /* Double the index to reach correct unsigned short location. */ + ud = outer_accum << 1; /* Double the index to reach correct ushort location. */ gbuf[ud] = dmin; /* Insert pixel's row into outer edge pixel location buffer. */ gbuf[ud + 1] = rsl; /* Insert pixel's column into outer edge pixel location buffer. */ outer_accum++; /* Increment outer edge index buffer pointer. */ res[a] = 0.0f; /* Set output pixel intensity now since it won't change later. */ } else if (lres[a] == 4) { /* It is an inner edge pixel flagged by 4. */ - ud = inner_accum << 1; /* Double int index to reach correct unsigned short location. */ + ud = inner_accum << 1; /* Double int index to reach correct ushort location. */ gbuf[ud] = dmin; /* Insert pixel's row into inner edge pixel location buffer. */ gbuf[ud + 1] = rsl; /* Insert pixel's column into inner edge pixel location buffer. */ inner_accum++; /* Increment inner edge index buffer pointer. */ @@ -1051,30 +1031,30 @@ static void do_createEdgeLocationBuffer(unsigned int t, } } -static void do_fillGradientBuffer(unsigned int rw, +static void do_fillGradientBuffer(uint rw, float *res, - const unsigned short *gbuf, - unsigned int isz, - unsigned int osz, - unsigned int gsz, - unsigned int inner_edge_offset, - unsigned int outer_edge_offset) + const ushort *gbuf, + uint isz, + uint osz, + uint gsz, + uint inner_edge_offset, + uint outer_edge_offset) { int x; /* Pixel loop counter. */ int a; /* Temporary pixel index buffer loop counter. */ int fsz; /* Size of the frame. */ - unsigned int rsl; /* Long used for finding fast `1.0/sqrt`. */ + uint rsl; /* Long used for finding fast `1.0/sqrt`. */ float rsf; /* Float used for finding fast `1.0/sqrt`. */ const float rsopf = 1.5f; /* Constant float used for finding fast `1.0/sqrt`. */ - unsigned int gradient_fill_offset; - unsigned int t; - unsigned int ud; /* Unscaled edge distance. */ - unsigned int dmin; /* Minimum edge distance. */ - float odist; /* Current outer edge distance. */ - float idist; /* Current inner edge distance. */ - int dx; /* X-delta (used for distance proportion calculation) */ - int dy; /* Y-delta (used for distance proportion calculation) */ + uint gradient_fill_offset; + uint t; + uint ud; /* Unscaled edge distance. */ + uint dmin; /* Minimum edge distance. */ + float odist; /* Current outer edge distance. */ + float idist; /* Current inner edge distance. */ + int dx; /* X-delta (used for distance proportion calculation) */ + int dy; /* Y-delta (used for distance proportion calculation) */ /* * The general algorithm used to color each gradient pixel is: @@ -1152,8 +1132,8 @@ static void do_fillGradientBuffer(unsigned int rw, } odist = (float)(dmin); /* Cast outer min to a float. */ rsf = odist * 0.5f; - rsl = *(unsigned int *)&odist; /* Use some peculiar properties of the way bits are stored. */ - rsl = 0x5f3759df - (rsl >> 1); /* In floats vs. unsigned ints to compute an approximate. */ + rsl = *(uint *)&odist; /* Use some peculiar properties of the way bits are stored. */ + rsl = 0x5f3759df - (rsl >> 1); /* In floats vs. uints to compute an approximate. */ odist = *(float *)&rsl; /* Reciprocal square root. */ odist = odist * (rsopf - (rsf * odist * odist)); /* -- This line can be iterated for more accuracy. -- */ @@ -1173,7 +1153,7 @@ static void do_fillGradientBuffer(unsigned int rw, /* Cast inner min to a float. */ idist = (float)(dmin); rsf = idist * 0.5f; - rsl = *(unsigned int *)&idist; + rsl = *(uint *)&idist; /* See notes above. */ rsl = 0x5f3759df - (rsl >> 1); @@ -1195,24 +1175,22 @@ static void do_fillGradientBuffer(unsigned int rw, void DoubleEdgeMaskOperation::do_double_edge_mask(float *imask, float *omask, float *res) { - unsigned int *lres; /* Pointer to output pixel buffer (for bit operations). */ - unsigned int *limask; /* Pointer to inner mask (for bit operations). */ - unsigned int *lomask; /* Pointer to outer mask (for bit operations). */ + uint *lres; /* Pointer to output pixel buffer (for bit operations). */ + uint *limask; /* Pointer to inner mask (for bit operations). */ + uint *lomask; /* Pointer to outer mask (for bit operations). */ int rw; /* Pixel row width. */ int t; /* Total number of pixels in buffer - 1 (used for loop starts). */ int fsz; /* Size of the frame. */ - unsigned int isz = 0; /* Size (in pixels) of inside edge pixel index buffer. */ - unsigned int osz = 0; /* Size (in pixels) of outside edge pixel index buffer. */ - unsigned int gsz = 0; /* Size (in pixels) of gradient pixel index buffer. */ - unsigned int rsize[3]; /* Size storage to pass to helper functions. */ - unsigned int inner_edge_offset = - 0; /* Offset into final buffer where inner edge pixel indexes start. */ - unsigned int outer_edge_offset = - 0; /* Offset into final buffer where outer edge pixel indexes start. */ + uint isz = 0; /* Size (in pixels) of inside edge pixel index buffer. */ + uint osz = 0; /* Size (in pixels) of outside edge pixel index buffer. */ + uint gsz = 0; /* Size (in pixels) of gradient pixel index buffer. */ + uint rsize[3]; /* Size storage to pass to helper functions. */ + uint inner_edge_offset = 0; /* Offset into final buffer where inner edge pixel indexes start. */ + uint outer_edge_offset = 0; /* Offset into final buffer where outer edge pixel indexes start. */ - unsigned short *gbuf; /* Gradient/inner/outer pixel location index buffer. */ + ushort *gbuf; /* Gradient/inner/outer pixel location index buffer. */ if (true) { /* If both input sockets have some data coming in... */ @@ -1223,9 +1201,9 @@ void DoubleEdgeMaskOperation::do_double_edge_mask(float *imask, float *omask, fl sizeof(float) * (t + 1)); /* Clear output buffer (not all pixels will be written later). */ - lres = (unsigned int *)res; /* Pointer to output buffer (for bit level ops).. */ - limask = (unsigned int *)imask; /* Pointer to input mask (for bit level ops).. */ - lomask = (unsigned int *)omask; /* Pointer to output mask (for bit level ops).. */ + lres = (uint *)res; /* Pointer to output buffer (for bit level ops).. */ + limask = (uint *)imask; /* Pointer to input mask (for bit level ops).. */ + lomask = (uint *)omask; /* Pointer to output mask (for bit level ops).. */ /* * The whole buffer is broken up into 4 parts. The four CORNERS, the FIRST and LAST rows, the @@ -1291,7 +1269,7 @@ void DoubleEdgeMaskOperation::do_double_edge_mask(float *imask, float *omask, fl /* Calculate size of pixel index buffer needed. */ fsz = gsz + isz + osz; /* Allocate edge/gradient pixel index buffer. */ - gbuf = (unsigned short *)MEM_callocN(sizeof(unsigned short) * fsz * 2, "DEM"); + gbuf = (ushort *)MEM_callocN(sizeof(ushort) * fsz * 2, "DEM"); do_createEdgeLocationBuffer( t, rw, lres, res, gbuf, &inner_edge_offset, &outer_edge_offset, isz, gsz); diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc index 725751d15af..1d38e4e60a9 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc @@ -102,18 +102,15 @@ void *FastGaussianBlurOperation::initialize_tile_data(rcti *rect) return iirgaus_; } -void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, - float sigma, - unsigned int chan, - unsigned int xy) +void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src, float sigma, uint chan, uint xy) { BLI_assert(!src->is_a_single_elem()); double q, q2, sc, cf[4], tsM[9], tsu[3], tsv[3]; double *X, *Y, *W; - const unsigned int src_width = src->get_width(); - const unsigned int src_height = src->get_height(); - unsigned int x, y, src_dim_max; - unsigned int i; + const uint src_width = src->get_width(); + const uint src_height = src->get_height(); + uint x, y, src_dim_max; + uint i; float *buffer = src->get_buffer(); const uint8_t num_channels = src->get_num_channels(); diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc index ade3f11a8b3..5c4d470bc35 100644 --- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc +++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cc @@ -12,9 +12,9 @@ namespace blender::compositor { using fREAL = float; /* Returns next highest power of 2 of x, as well its log2 in L2. */ -static unsigned int next_pow2(unsigned int x, unsigned int *L2) +static uint next_pow2(uint x, uint *L2) { - unsigned int pw, x_notpow2 = x & (x - 1); + uint pw, x_notpow2 = x & (x - 1); *L2 = 0; while (x >>= 1) { ++(*L2); @@ -31,7 +31,7 @@ static unsigned int next_pow2(unsigned int x, unsigned int *L2) /* From FXT library by Joerg Arndt, faster in order bit-reversal * use: `r = revbin_upd(r, h)` where `h = N>>1`. */ -static unsigned int revbin_upd(unsigned int r, unsigned int h) +static uint revbin_upd(uint r, uint h) { while (!((r ^= h) & h)) { h >>= 1; @@ -39,14 +39,14 @@ static unsigned int revbin_upd(unsigned int r, unsigned int h) return r; } //------------------------------------------------------------------------------ -static void FHT(fREAL *data, unsigned int M, unsigned int inverse) +static void FHT(fREAL *data, uint M, uint inverse) { double tt, fc, dc, fs, ds, a = M_PI; fREAL t1, t2; int n2, bd, bl, istep, k, len = 1 << M, n = 1; int i, j = 0; - unsigned int Nh = len >> 1; + uint Nh = len >> 1; for (i = 1; i < (len - 1); i++) { j = revbin_upd(j, Nh); if (j > i) { @@ -112,10 +112,9 @@ static void FHT(fREAL *data, unsigned int M, unsigned int inverse) /* 2D Fast Hartley Transform, Mx/My -> log2 of width/height, * nzp -> the row where zero pad data starts, * inverse -> see above. */ -static void FHT2D( - fREAL *data, unsigned int Mx, unsigned int My, unsigned int nzp, unsigned int inverse) +static void FHT2D(fREAL *data, uint Mx, uint My, uint nzp, uint inverse) { - unsigned int i, j, Nx, Ny, maxy; + uint i, j, Nx, Ny, maxy; Nx = 1 << Mx; Ny = 1 << My; @@ -130,13 +129,13 @@ static void FHT2D( if (Nx == Ny) { /* Square. */ for (j = 0; j < Ny; j++) { for (i = j + 1; i < Nx; i++) { - unsigned int op = i + (j << Mx), np = j + (i << My); + uint op = i + (j << Mx), np = j + (i << My); SWAP(fREAL, data[op], data[np]); } } } else { /* Rectangular. */ - unsigned int k, Nym = Ny - 1, stm = 1 << (Mx + My); + uint k, Nym = Ny - 1, stm = 1 << (Mx + My); for (i = 0; stm > 0; i++) { #define PRED(k) (((k & Nym) << Mx) + (k >> My)) for (j = PRED(i); j > i; j = PRED(j)) { @@ -153,8 +152,8 @@ static void FHT2D( } } - SWAP(unsigned int, Nx, Ny); - SWAP(unsigned int, Mx, My); + SWAP(uint, Nx, Ny); + SWAP(uint, Mx, My); /* Now columns == transposed rows. */ for (j = 0; j < Ny; j++) { @@ -163,11 +162,11 @@ static void FHT2D( /* Finalize. */ for (j = 0; j <= (Ny >> 1); j++) { - unsigned int jm = (Ny - j) & (Ny - 1); - unsigned int ji = j << Mx; - unsigned int jmi = jm << Mx; + uint jm = (Ny - j) & (Ny - 1); + uint ji = j << Mx; + uint jmi = jm << Mx; for (i = 0; i <= (Nx >> 1); i++) { - unsigned int im = (Nx - i) & (Nx - 1); + uint im = (Nx - i) & (Nx - 1); fREAL A = data[ji + i]; fREAL B = data[jmi + i]; fREAL C = data[ji + im]; @@ -184,13 +183,13 @@ static void FHT2D( //------------------------------------------------------------------------------ /* 2D convolution calc, d1 *= d2, M/N - > log2 of width/height. */ -static void fht_convolve(fREAL *d1, const fREAL *d2, unsigned int M, unsigned int N) +static void fht_convolve(fREAL *d1, const fREAL *d2, uint M, uint N) { fREAL a, b; - unsigned int i, j, k, L, mj, mL; - unsigned int m = 1 << M, n = 1 << N; - unsigned int m2 = 1 << (M - 1), n2 = 1 << (N - 1); - unsigned int mn2 = m << (N - 1); + uint i, j, k, L, mj, mL; + uint m = 1 << M, n = 1 << N; + uint m2 = 1 << (M - 1), n2 = 1 << (N - 1); + uint mn2 = m << (N - 1); d1[0] *= d2[0]; d1[mn2] *= d2[mn2]; @@ -242,15 +241,15 @@ static void fht_convolve(fREAL *d1, const fREAL *d2, unsigned int M, unsigned in static void convolve(float *dst, MemoryBuffer *in1, MemoryBuffer *in2) { fREAL *data1, *data2, *fp; - unsigned int w2, h2, hw, hh, log2_w, log2_h; + uint w2, h2, hw, hh, log2_w, log2_h; fRGB wt, *colp; int x, y, ch; int xbl, ybl, nxb, nyb, xbsz, ybsz; bool in2done = false; - const unsigned int kernel_width = in2->get_width(); - const unsigned int kernel_height = in2->get_height(); - const unsigned int image_width = in1->get_width(); - const unsigned int image_height = in1->get_height(); + const uint kernel_width = in2->get_width(); + const uint kernel_height = in2->get_height(); + const uint image_width = in1->get_width(); + const uint image_height = in1->get_height(); float *kernel_buffer = in2->get_buffer(); float *image_buffer = in1->get_buffer(); @@ -397,7 +396,7 @@ void GlareFogGlowOperation::generate_glare(float *data, float scale, u, v, r, w, d; fRGB fcol; MemoryBuffer *ckrn; - unsigned int sz = 1 << settings->size; + uint sz = 1 << settings->size; const float cs_r = 1.0f, cs_g = 1.0f, cs_b = 1.0f; /* Temp. src image diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.cc b/source/blender/compositor/operations/COM_GlareStreaksOperation.cc index e4f06eb0e50..8c303ab6332 100644 --- a/source/blender/compositor/operations/COM_GlareStreaksOperation.cc +++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.cc @@ -10,7 +10,7 @@ void GlareStreaksOperation::generate_glare(float *data, const NodeGlare *settings) { int x, y, n; - unsigned int nump = 0; + uint nump = 0; float c1[4], c2[4], c3[4], c4[4]; float a, ang = DEG2RADF(360.0f) / (float)settings->streaks; diff --git a/source/blender/compositor/operations/COM_ImageOperation.cc b/source/blender/compositor/operations/COM_ImageOperation.cc index a9ab414670f..0d0b699eefc 100644 --- a/source/blender/compositor/operations/COM_ImageOperation.cc +++ b/source/blender/compositor/operations/COM_ImageOperation.cc @@ -120,7 +120,7 @@ static void sample_image_at_location( } } else { - unsigned char byte_color[4]; + uchar byte_color[4]; switch (sampler) { case PixelSampler::Nearest: nearest_interpolation_color(ibuf, byte_color, nullptr, x, y); diff --git a/source/blender/compositor/operations/COM_KeyingScreenOperation.cc b/source/blender/compositor/operations/COM_KeyingScreenOperation.cc index 0db9b7e6a04..c037a1e0330 100644 --- a/source/blender/compositor/operations/COM_KeyingScreenOperation.cc +++ b/source/blender/compositor/operations/COM_KeyingScreenOperation.cc @@ -150,7 +150,7 @@ KeyingScreenOperation::TriangulationData *KeyingScreenOperation::build_voronoi_t add_v3_v3(site->color, &pattern_ibuf->rect_float[4 * j]); } else { - unsigned char *rrgb = (unsigned char *)pattern_ibuf->rect; + uchar *rrgb = (uchar *)pattern_ibuf->rect; site->color[0] += srgb_to_linearrgb((float)rrgb[4 * j + 0] / 255.0f); site->color[1] += srgb_to_linearrgb((float)rrgb[4 * j + 1] / 255.0f); diff --git a/source/blender/compositor/operations/COM_MaskOperation.cc b/source/blender/compositor/operations/COM_MaskOperation.cc index 29d0c0c2b9c..5517306f1af 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cc +++ b/source/blender/compositor/operations/COM_MaskOperation.cc @@ -52,7 +52,7 @@ void MaskOperation::init_execution() } } - for (unsigned int i = 0; i < raster_mask_handle_tot_; i++) { + for (uint i = 0; i < raster_mask_handle_tot_; i++) { raster_mask_handles_[i] = BKE_maskrasterize_handle_new(); /* re-eval frame info */ @@ -76,7 +76,7 @@ void MaskOperation::init_execution() void MaskOperation::deinit_execution() { - for (unsigned int i = 0; i < raster_mask_handle_tot_; i++) { + for (uint i = 0; i < raster_mask_handle_tot_; i++) { if (raster_mask_handles_[i]) { BKE_maskrasterize_handle_free(raster_mask_handles_[i]); raster_mask_handles_[i] = nullptr; @@ -118,7 +118,7 @@ void MaskOperation::execute_pixel_sampled(float output[4], /* In case loop below fails. */ output[0] = 0.0f; - for (unsigned int i = 0; i < raster_mask_handle_tot_; i++) { + for (uint i = 0; i < raster_mask_handle_tot_; i++) { if (raster_mask_handles_[i]) { output[0] += BKE_maskrasterize_handle_sample(raster_mask_handles_[i], xy); } diff --git a/source/blender/compositor/operations/COM_MultilayerImageOperation.cc b/source/blender/compositor/operations/COM_MultilayerImageOperation.cc index 11f80c16c2f..fec7c1972f3 100644 --- a/source/blender/compositor/operations/COM_MultilayerImageOperation.cc +++ b/source/blender/compositor/operations/COM_MultilayerImageOperation.cc @@ -93,8 +93,7 @@ void MultilayerColorOperation::execute_pixel_sampled(float output[4], else { int yi = y; int xi = x; - if (xi < 0 || yi < 0 || (unsigned int)xi >= this->get_width() || - (unsigned int)yi >= this->get_height()) { + if (xi < 0 || yi < 0 || (uint)xi >= this->get_width() || (uint)yi >= this->get_height()) { zero_v4(output); } else { @@ -116,8 +115,7 @@ void MultilayerValueOperation::execute_pixel_sampled(float output[4], else { int yi = y; int xi = x; - if (xi < 0 || yi < 0 || (unsigned int)xi >= this->get_width() || - (unsigned int)yi >= this->get_height()) { + if (xi < 0 || yi < 0 || (uint)xi >= this->get_width() || (uint)yi >= this->get_height()) { output[0] = 0.0f; } else { @@ -138,8 +136,7 @@ void MultilayerVectorOperation::execute_pixel_sampled(float output[4], else { int yi = y; int xi = x; - if (xi < 0 || yi < 0 || (unsigned int)xi >= this->get_width() || - (unsigned int)yi >= this->get_height()) { + if (xi < 0 || yi < 0 || (uint)xi >= this->get_width() || (uint)yi >= this->get_height()) { output[0] = 0.0f; } else { diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc index 760ed94f882..7650746e3ed 100644 --- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc +++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cc @@ -74,8 +74,8 @@ void *OutputOpenExrSingleLayerMultiViewOperation::get_handle(const char *filenam void OutputOpenExrSingleLayerMultiViewOperation::deinit_execution() { - unsigned int width = this->get_width(); - unsigned int height = this->get_height(); + uint width = this->get_width(); + uint height = this->get_height(); if (width != 0 && height != 0) { void *exrhandle; @@ -132,8 +132,8 @@ OutputOpenExrMultiLayerMultiViewOperation::OutputOpenExrMultiLayerMultiViewOpera void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename) { - unsigned int width = this->get_width(); - unsigned int height = this->get_height(); + uint width = this->get_width(); + uint height = this->get_height(); if (width != 0 && height != 0) { @@ -158,7 +158,7 @@ void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename IMB_exr_add_view(exrhandle, srv->name); - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { add_exr_channels(exrhandle, layers_[i].name, layers_[i].datatype, @@ -189,8 +189,8 @@ void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename void OutputOpenExrMultiLayerMultiViewOperation::deinit_execution() { - unsigned int width = this->get_width(); - unsigned int height = this->get_height(); + uint width = this->get_width(); + uint height = this->get_height(); if (width != 0 && height != 0) { void *exrhandle; @@ -207,7 +207,7 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinit_execution() exrhandle = this->get_handle(filename); - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { add_exr_channels(exrhandle, layers_[i].name, layers_[i].datatype, @@ -217,7 +217,7 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinit_execution() layers_[i].output_buffer); } - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { /* memory can only be freed after we write all views to the file */ layers_[i].output_buffer = nullptr; layers_[i].image_input = nullptr; @@ -228,7 +228,7 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinit_execution() IMB_exr_write_channels(exrhandle); /* free buffer memory for all the views */ - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { free_exr_channels(exrhandle, rd_, layers_[i].name, layers_[i].datatype); } @@ -284,8 +284,8 @@ void *OutputStereoOperation::get_handle(const char *filename) void OutputStereoOperation::deinit_execution() { - unsigned int width = this->get_width(); - unsigned int height = this->get_height(); + uint width = this->get_width(); + uint height = this->get_height(); if (width != 0 && height != 0) { void *exrhandle; diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cc b/source/blender/compositor/operations/COM_OutputFileOperation.cc index 1d22f3e8cd2..6c7333c007a 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cc +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cc @@ -150,7 +150,7 @@ int get_datatype_size(DataType datatype) } } -static float *init_buffer(unsigned int width, unsigned int height, DataType datatype) +static float *init_buffer(uint width, uint height, DataType datatype) { /* When initializing the tree during initial load the width and height can be zero. */ if (width != 0 && height != 0) { @@ -165,7 +165,7 @@ static void write_buffer_rect(rcti *rect, const bNodeTree *tree, SocketReader *reader, float *buffer, - unsigned int width, + uint width, DataType datatype) { float color[4]; @@ -242,7 +242,7 @@ void OutputSingleLayerOperation::init_execution() output_buffer_ = init_buffer(this->get_width(), this->get_height(), datatype_); } -void OutputSingleLayerOperation::execute_region(rcti *rect, unsigned int /*tile_number*/) +void OutputSingleLayerOperation::execute_region(rcti *rect, uint /*tile_number*/) { write_buffer_rect(rect, tree_, image_input_, output_buffer_, this->get_width(), datatype_); } @@ -369,7 +369,7 @@ StampData *OutputOpenExrMultiLayerOperation::create_stamp_data() const void OutputOpenExrMultiLayerOperation::init_execution() { - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { if (layers_[i].use_layer) { SocketReader *reader = get_input_socket_reader(i); layers_[i].image_input = reader; @@ -379,9 +379,9 @@ void OutputOpenExrMultiLayerOperation::init_execution() } } -void OutputOpenExrMultiLayerOperation::execute_region(rcti *rect, unsigned int /*tile_number*/) +void OutputOpenExrMultiLayerOperation::execute_region(rcti *rect, uint /*tile_number*/) { - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { OutputOpenExrLayer &layer = layers_[i]; if (layer.image_input) { write_buffer_rect( @@ -392,8 +392,8 @@ void OutputOpenExrMultiLayerOperation::execute_region(rcti *rect, unsigned int / void OutputOpenExrMultiLayerOperation::deinit_execution() { - unsigned int width = this->get_width(); - unsigned int height = this->get_height(); + uint width = this->get_width(); + uint height = this->get_height(); if (width != 0 && height != 0) { char filename[FILE_MAX]; const char *suffix; @@ -410,7 +410,7 @@ void OutputOpenExrMultiLayerOperation::deinit_execution() suffix); BLI_make_existing_file(filename); - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { OutputOpenExrLayer &layer = layers_[i]; if (!layer.image_input) { continue; /* skip unconnected sockets */ @@ -437,7 +437,7 @@ void OutputOpenExrMultiLayerOperation::deinit_execution() } IMB_exr_close(exrhandle); - for (unsigned int i = 0; i < layers_.size(); i++) { + for (uint i = 0; i < layers_.size(); i++) { if (layers_[i].output_buffer) { MEM_freeN(layers_[i].output_buffer); layers_[i].output_buffer = nullptr; diff --git a/source/blender/compositor/operations/COM_PreviewOperation.cc b/source/blender/compositor/operations/COM_PreviewOperation.cc index dbc544896e3..2a6d858f91c 100644 --- a/source/blender/compositor/operations/COM_PreviewOperation.cc +++ b/source/blender/compositor/operations/COM_PreviewOperation.cc @@ -10,8 +10,8 @@ namespace blender::compositor { PreviewOperation::PreviewOperation(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, - const unsigned int default_width, - const unsigned int default_height) + const uint default_width, + const uint default_height) { this->add_input_socket(DataType::Color, ResizeMode::Align); @@ -39,14 +39,13 @@ void PreviewOperation::init_execution() { input_ = get_input_socket_reader(0); - if (this->get_width() == (unsigned int)preview_->xsize && - this->get_height() == (unsigned int)preview_->ysize) { + if (this->get_width() == (uint)preview_->xsize && this->get_height() == (uint)preview_->ysize) { output_buffer_ = preview_->rect; } if (output_buffer_ == nullptr) { - output_buffer_ = (unsigned char *)MEM_callocN( - sizeof(unsigned char) * 4 * get_width() * get_height(), "PreviewOperation"); + output_buffer_ = (uchar *)MEM_callocN(sizeof(uchar) * 4 * get_width() * get_height(), + "PreviewOperation"); if (preview_->rect) { MEM_freeN(preview_->rect); } @@ -62,7 +61,7 @@ void PreviewOperation::deinit_execution() input_ = nullptr; } -void PreviewOperation::execute_region(rcti *rect, unsigned int /*tile_number*/) +void PreviewOperation::execute_region(rcti *rect, uint /*tile_number*/) { int offset; float color[4]; diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cc b/source/blender/compositor/operations/COM_RenderLayersProg.cc index 40f2187b27b..fa9efbe15be 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cc +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cc @@ -52,7 +52,7 @@ void RenderLayersProg::init_execution() void RenderLayersProg::do_interpolation(float output[4], float x, float y, PixelSampler sampler) { - unsigned int offset; + uint offset; int width = this->get_width(), height = this->get_height(); int ix = x, iy = y; @@ -328,7 +328,7 @@ void RenderLayersDepthProg::execute_pixel_sampled(float output[4], output[0] = 10e10f; } else { - unsigned int offset = (iy * this->get_width() + ix); + uint offset = (iy * this->get_width() + ix); output[0] = input_buffer[offset]; } } diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc index d4365af4860..451c76bb36a 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc @@ -510,8 +510,8 @@ void InverseSearchRadiusOperation::deinit_execution() input_radius_ = nullptr; } -void InverseSearchRadiusOperation::determine_resolution(unsigned int resolution[2], - unsigned int preferred_resolution[2]) +void InverseSearchRadiusOperation::determine_resolution(uint resolution[2], + uint preferred_resolution[2]) { NodeOperation::determine_resolution(resolution, preferred_resolution); resolution[0] = resolution[0] / DIVIDER; diff --git a/source/blender/compositor/operations/COM_ViewerOperation.cc b/source/blender/compositor/operations/COM_ViewerOperation.cc index 3bd5fa4ad14..c1874bb51db 100644 --- a/source/blender/compositor/operations/COM_ViewerOperation.cc +++ b/source/blender/compositor/operations/COM_ViewerOperation.cc @@ -60,7 +60,7 @@ void ViewerOperation::deinit_execution() output_buffer_ = nullptr; } -void ViewerOperation::execute_region(rcti *rect, unsigned int /*tile_number*/) +void ViewerOperation::execute_region(rcti *rect, uint /*tile_number*/) { float *buffer = output_buffer_; float *depthbuffer = depth_buffer_; diff --git a/source/blender/compositor/operations/COM_WriteBufferOperation.cc b/source/blender/compositor/operations/COM_WriteBufferOperation.cc index 9073c92b154..56261bfc660 100644 --- a/source/blender/compositor/operations/COM_WriteBufferOperation.cc +++ b/source/blender/compositor/operations/COM_WriteBufferOperation.cc @@ -42,7 +42,7 @@ void WriteBufferOperation::deinit_execution() memory_proxy_->free(); } -void WriteBufferOperation::execute_region(rcti *rect, unsigned int /*tile_number*/) +void WriteBufferOperation::execute_region(rcti *rect, uint /*tile_number*/) { MemoryBuffer *memory_buffer = memory_proxy_->get_buffer(); float *buffer = memory_buffer->get_buffer(); @@ -95,7 +95,7 @@ void WriteBufferOperation::execute_region(rcti *rect, unsigned int /*tile_number void WriteBufferOperation::execute_opencl_region(OpenCLDevice *device, rcti * /*rect*/, - unsigned int /*chunk_number*/, + uint /*chunk_number*/, MemoryBuffer **input_memory_buffers, MemoryBuffer *output_buffer) { @@ -110,8 +110,8 @@ void WriteBufferOperation::execute_opencl_region(OpenCLDevice *device, * NOTE: list of cl_mem will be filled by 2, and needs to be cleaned up by 4 */ /* STEP 1 */ - const unsigned int output_buffer_width = output_buffer->get_width(); - const unsigned int output_buffer_height = output_buffer->get_height(); + const uint output_buffer_width = output_buffer->get_width(); + const uint output_buffer_height = output_buffer->get_height(); const cl_image_format *image_format = OpenCLDevice::determine_image_format(output_buffer); diff --git a/source/blender/compositor/realtime_compositor/intern/shader_operation.cc b/source/blender/compositor/realtime_compositor/intern/shader_operation.cc index 8e52baf63ec..88efdae1872 100644 --- a/source/blender/compositor/realtime_compositor/intern/shader_operation.cc +++ b/source/blender/compositor/realtime_compositor/intern/shader_operation.cc @@ -273,7 +273,7 @@ static const char *get_store_function_name(ResultType type) void ShaderOperation::populate_operation_result(DOutputSocket output_socket, GPUMaterial *material) { - const unsigned int output_id = output_sockets_to_output_identifiers_map_.size(); + const uint output_id = output_sockets_to_output_identifiers_map_.size(); std::string output_identifier = "output" + std::to_string(output_id); const ResultType result_type = get_node_socket_result_type(output_socket.bsocket()); -- cgit v1.2.3