Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-08-08 06:29:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-08 06:38:00 +0300
commit171e77c3c25a1224fc5f7db40ec6f8879f8dbbb0 (patch)
treeea51f4fa508a39807e6f6d333b2d53af8a2b9fc1 /source/blender/compositor
parent4bf3ca20165959f98c7c830a138ba2901d3dd851 (diff)
Cleanup: use array syntax for sizeof with fixed values
Also order sizeof(..) first to promote other values to size_t.
Diffstat (limited to 'source/blender/compositor')
-rw-r--r--source/blender/compositor/operations/COM_CompositorOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_DenoiseOperation.cpp10
-rw-r--r--source/blender/compositor/operations/COM_VectorBlurOperation.cpp4
3 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/compositor/operations/COM_CompositorOperation.cpp b/source/blender/compositor/operations/COM_CompositorOperation.cpp
index 71cef9dc4da..8d55fe53aa7 100644
--- a/source/blender/compositor/operations/COM_CompositorOperation.cpp
+++ b/source/blender/compositor/operations/COM_CompositorOperation.cpp
@@ -65,11 +65,11 @@ void CompositorOperation::initExecution()
this->m_depthInput = getInputSocketReader(2);
if (this->getWidth() * this->getHeight() != 0) {
this->m_outputBuffer = (float *)MEM_callocN(
- this->getWidth() * this->getHeight() * 4 * sizeof(float), "CompositorOperation");
+ sizeof(float[4]) * this->getWidth() * this->getHeight(), "CompositorOperation");
}
if (this->m_depthInput != NULL) {
this->m_depthBuffer = (float *)MEM_callocN(
- this->getWidth() * this->getHeight() * sizeof(float), "CompositorOperation");
+ sizeof(float) * this->getWidth() * this->getHeight(), "CompositorOperation");
}
}
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cpp b/source/blender/compositor/operations/COM_DenoiseOperation.cpp
index 202e614c0c5..4087056a79d 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.cpp
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.cpp
@@ -105,7 +105,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileColor->getWidth(),
inputTileColor->getHeight(),
0,
- 4 * sizeof(float));
+ sizeof(float[4]));
if (inputTileNormal && inputTileNormal->getBuffer()) {
filter.setImage("normal",
inputTileNormal->getBuffer(),
@@ -113,7 +113,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileNormal->getWidth(),
inputTileNormal->getHeight(),
0,
- 3 * sizeof(float));
+ sizeof(float[3]));
}
if (inputTileAlbedo && inputTileAlbedo->getBuffer()) {
filter.setImage("albedo",
@@ -122,7 +122,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileAlbedo->getWidth(),
inputTileAlbedo->getHeight(),
0,
- 4 * sizeof(float));
+ sizeof(float[4]));
}
filter.setImage("output",
data,
@@ -130,7 +130,7 @@ void DenoiseOperation::generateDenoise(float *data,
inputTileColor->getWidth(),
inputTileColor->getHeight(),
0,
- 4 * sizeof(float));
+ sizeof(float[4]));
BLI_assert(settings);
if (settings) {
@@ -158,5 +158,5 @@ void DenoiseOperation::generateDenoise(float *data,
UNUSED_VARS(inputTileAlbedo, inputTileNormal, settings);
::memcpy(data,
inputBufferColor,
- inputTileColor->getWidth() * inputTileColor->getHeight() * sizeof(float) * 4);
+ sizeof(float[4]) * inputTileColor->getWidth() * inputTileColor->getHeight());
}
diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
index 0f81780bb00..1e392b1f991 100644
--- a/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cpp
@@ -595,7 +595,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd,
float minspeed = (float)nbd->minspeed;
float minspeedsq = minspeed * minspeed;
- minvecbufrect = (float *)MEM_callocN(4 * sizeof(float) * xsize * ysize, "minspeed buf");
+ minvecbufrect = (float *)MEM_callocN(sizeof(float[4]) * xsize * ysize, "minspeed buf");
dvec1 = vecbufrect;
dvec2 = minvecbufrect;
@@ -621,7 +621,7 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd,
}
/* make vertex buffer with averaged speed and zvalues */
- rectvz = (float *)MEM_callocN(4 * sizeof(float) * (xsize + 1) * (ysize + 1), "vertices");
+ rectvz = (float *)MEM_callocN(sizeof(float[4]) * (xsize + 1) * (ysize + 1), "vertices");
dvz = rectvz;
for (y = 0; y <= ysize; y++) {