Cleanup: Clang-Tidy modernize-use-nullptr

Replace `NULL` with `nullptr` in C++ code.

No functional changes.
This commit is contained in:
Sybren A. Stüvel 2020-11-06 17:49:09 +01:00
parent 88926375a0
commit 16732def37
426 changed files with 7145 additions and 7146 deletions

View File

@ -38,7 +38,6 @@ Checks: >
-modernize-deprecated-headers,
-modernize-avoid-c-arrays,
-modernize-use-equals-default,
-modernize-use-nullptr,
-modernize-concat-nested-namespaces,
-modernize-use-nodiscard,
-modernize-use-using,

View File

@ -290,7 +290,7 @@ TEST(fcurve_active_keyframe, ActiveKeyframe)
EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), 2);
/* Check clearing the index. */
BKE_fcurve_active_keyframe_set(fcu, NULL);
BKE_fcurve_active_keyframe_set(fcu, nullptr);
EXPECT_EQ(fcu->active_keyframe_index, FCURVE_ACTIVE_KEYFRAME_NONE);
EXPECT_EQ(BKE_fcurve_active_keyframe_index(fcu), FCURVE_ACTIVE_KEYFRAME_NONE);

View File

@ -83,7 +83,7 @@ static void test_lattice_deform_free(LatticeDeformTestContext *ctx)
TEST(lattice_deform_performance, performance_no_dvert_1)
{
const int32_t num_items = 1;
LatticeDeformTestContext ctx = {{{0}}};
LatticeDeformTestContext ctx = {{{nullptr}}};
RandomNumberGenerator rng;
test_lattice_deform_init(&ctx, &rng, num_items);
test_lattice_deform(&ctx, num_items);
@ -92,7 +92,7 @@ TEST(lattice_deform_performance, performance_no_dvert_1)
TEST(lattice_deform_performance, performance_no_dvert_1000)
{
const int32_t num_items = 1000;
LatticeDeformTestContext ctx = {{{0}}};
LatticeDeformTestContext ctx = {{{nullptr}}};
RandomNumberGenerator rng;
test_lattice_deform_init(&ctx, &rng, num_items);
test_lattice_deform(&ctx, num_items);
@ -101,7 +101,7 @@ TEST(lattice_deform_performance, performance_no_dvert_1000)
TEST(lattice_deform_performance, performance_no_dvert_10000)
{
const int32_t num_items = 10000;
LatticeDeformTestContext ctx = {{{0}}};
LatticeDeformTestContext ctx = {{{nullptr}}};
RandomNumberGenerator rng;
test_lattice_deform_init(&ctx, &rng, num_items);
test_lattice_deform(&ctx, num_items);
@ -110,7 +110,7 @@ TEST(lattice_deform_performance, performance_no_dvert_10000)
TEST(lattice_deform_performance, performance_no_dvert_100000)
{
const int32_t num_items = 100000;
LatticeDeformTestContext ctx = {{{0}}};
LatticeDeformTestContext ctx = {{{nullptr}}};
RandomNumberGenerator rng;
test_lattice_deform_init(&ctx, &rng, num_items);
test_lattice_deform(&ctx, num_items);
@ -119,7 +119,7 @@ TEST(lattice_deform_performance, performance_no_dvert_100000)
TEST(lattice_deform_performance, performance_no_dvert_1000000)
{
const int32_t num_items = 1000000;
LatticeDeformTestContext ctx = {{{0}}};
LatticeDeformTestContext ctx = {{{nullptr}}};
RandomNumberGenerator rng;
test_lattice_deform_init(&ctx, &rng, num_items);
test_lattice_deform(&ctx, num_items);
@ -128,7 +128,7 @@ TEST(lattice_deform_performance, performance_no_dvert_1000000)
TEST(lattice_deform_performance, performance_no_dvert_10000000)
{
const int32_t num_items = 10000000;
LatticeDeformTestContext ctx = {{{0}}};
LatticeDeformTestContext ctx = {{{nullptr}}};
RandomNumberGenerator rng;
test_lattice_deform_init(&ctx, &rng, num_items);
test_lattice_deform(&ctx, num_items);

View File

@ -165,14 +165,14 @@ IDTypeInfo IDType_ID_SIM = {
/* free_data */ simulation_free_data,
/* make_local */ nullptr,
/* foreach_id */ simulation_foreach_id,
/* foreach_cache */ NULL,
/* foreach_cache */ nullptr,
/* blend_write */ simulation_blend_write,
/* blend_read_data */ simulation_blend_read_data,
/* blend_read_lib */ simulation_blend_read_lib,
/* blend_read_expand */ simulation_blend_read_expand,
/* blend_read_undo_preserve */ NULL,
/* blend_read_undo_preserve */ nullptr,
};
void *BKE_simulation_add(Main *bmain, const char *name)

View File

@ -265,12 +265,12 @@ static struct VolumeFileCache {
struct VolumeGrid {
VolumeGrid(const VolumeFileCache::Entry &template_entry, const int simplify_level)
: entry(NULL), simplify_level(simplify_level), is_loaded(false)
: entry(nullptr), simplify_level(simplify_level), is_loaded(false)
{
entry = GLOBAL_CACHE.add_metadata_user(template_entry);
}
VolumeGrid(const openvdb::GridBase::Ptr &grid) : entry(NULL), local_grid(grid), is_loaded(true)
VolumeGrid(const openvdb::GridBase::Ptr &grid) : entry(nullptr), local_grid(grid), is_loaded(true)
{
}
@ -295,7 +295,7 @@ struct VolumeGrid {
void load(const char *volume_name, const char *filepath)
{
/* If already loaded or not file-backed, nothing to do. */
if (is_loaded || entry == NULL) {
if (is_loaded || entry == nullptr) {
return;
}
@ -337,7 +337,7 @@ struct VolumeGrid {
void unload(const char *volume_name)
{
/* Not loaded or not file-backed, nothing to do. */
if (!is_loaded || entry == NULL) {
if (!is_loaded || entry == nullptr) {
return;
}
@ -364,7 +364,7 @@ struct VolumeGrid {
local_grid = grid()->copyGridWithNewTree();
if (entry) {
GLOBAL_CACHE.remove_user(*entry, is_loaded);
entry = NULL;
entry = nullptr;
}
is_loaded = true;
}
@ -378,7 +378,7 @@ struct VolumeGrid {
local_grid = grid()->deepCopyGrid();
if (entry) {
GLOBAL_CACHE.remove_user(*entry, is_loaded);
entry = NULL;
entry = nullptr;
}
is_loaded = true;
}
@ -398,7 +398,7 @@ struct VolumeGrid {
return entry->error_msg.c_str();
}
return NULL;
return nullptr;
}
bool grid_is_loaded() const
@ -562,7 +562,7 @@ static void volume_blend_write(BlendWriter *writer, ID *id, const void *id_addre
Volume *volume = (Volume *)id;
if (volume->id.us > 0 || BLO_write_is_undo(writer)) {
/* Clean up, important in undo case to reduce false detection of changed datablocks. */
volume->runtime.grids = 0;
volume->runtime.grids = nullptr;
/* write LibData */
BLO_write_id_struct(writer, Volume, id_address, &volume->id);
@ -634,13 +634,13 @@ IDTypeInfo IDType_ID_VO = {
/* blend_read_lib */ volume_blend_read_lib,
/* blend_read_expand */ volume_blend_read_expand,
/* blend_read_undo_preserve */ NULL,
/* blend_read_undo_preserve */ nullptr,
};
void BKE_volume_init_grids(Volume *volume)
{
#ifdef WITH_OPENVDB
if (volume->runtime.grids == NULL) {
if (volume->runtime.grids == nullptr) {
volume->runtime.grids = OBJECT_GUARDED_NEW(VolumeGridVector);
}
#else
@ -871,11 +871,11 @@ BoundBox *BKE_volume_boundbox_get(Object *ob)
{
BLI_assert(ob->type == OB_VOLUME);
if (ob->runtime.bb != NULL && (ob->runtime.bb->flag & BOUNDBOX_DIRTY) == 0) {
if (ob->runtime.bb != nullptr && (ob->runtime.bb->flag & BOUNDBOX_DIRTY) == 0) {
return ob->runtime.bb;
}
if (ob->runtime.bb == NULL) {
if (ob->runtime.bb == nullptr) {
Volume *volume = (Volume *)ob->data;
ob->runtime.bb = (BoundBox *)MEM_callocN(sizeof(BoundBox), "volume boundbox");
@ -1006,7 +1006,7 @@ static Volume *volume_evaluate_modifiers(struct Depsgraph *depsgraph,
if (volume_next && volume_next != volume) {
/* If the modifier returned a new volume, release the old one. */
if (volume != volume_input) {
BKE_id_free(NULL, volume);
BKE_id_free(nullptr, volume);
}
volume = volume_next;
}
@ -1057,7 +1057,7 @@ void BKE_volume_grids_backup_restore(Volume *volume, VolumeGridVector *grids, co
/* Restore grids after datablock was re-copied from original by depsgraph,
* we don't want to load them again if possible. */
BLI_assert(volume->id.tag & LIB_TAG_COPIED_ON_WRITE);
BLI_assert(volume->runtime.grids != NULL && grids != NULL);
BLI_assert(volume->runtime.grids != nullptr && grids != nullptr);
if (!grids->is_loaded()) {
/* No grids loaded in CoW datablock, nothing lost by discarding. */
@ -1080,8 +1080,8 @@ void BKE_volume_grids_backup_restore(Volume *volume, VolumeGridVector *grids, co
/* Draw Cache */
void (*BKE_volume_batch_cache_dirty_tag_cb)(Volume *volume, int mode) = NULL;
void (*BKE_volume_batch_cache_free_cb)(Volume *volume) = NULL;
void (*BKE_volume_batch_cache_dirty_tag_cb)(Volume *volume, int mode) = nullptr;
void (*BKE_volume_batch_cache_free_cb)(Volume *volume) = nullptr;
void BKE_volume_batch_cache_dirty_tag(Volume *volume, int mode)
{
@ -1138,7 +1138,7 @@ VolumeGrid *BKE_volume_grid_get(const Volume *volume, int grid_index)
return &grid;
}
}
return NULL;
return nullptr;
#else
UNUSED_VARS(volume, grid_index);
return NULL;
@ -1149,7 +1149,7 @@ VolumeGrid *BKE_volume_grid_active_get(const Volume *volume)
{
const int num_grids = BKE_volume_num_grids(volume);
if (num_grids == 0) {
return NULL;
return nullptr;
}
const int index = clamp_i(volume->active_grid, 0, num_grids - 1);
@ -1167,7 +1167,7 @@ VolumeGrid *BKE_volume_grid_find(const Volume *volume, const char *name)
}
}
return NULL;
return nullptr;
}
/* Grid Loading */
@ -1352,7 +1352,7 @@ bool BKE_volume_grid_bounds(const VolumeGrid *volume_grid, float min[3], float m
Volume *BKE_volume_new_for_eval(const Volume *volume_src)
{
Volume *volume_dst = (Volume *)BKE_id_new_nomain(ID_VO, NULL);
Volume *volume_dst = (Volume *)BKE_id_new_nomain(ID_VO, nullptr);
STRNCPY(volume_dst->id.name, volume_src->id.name);
volume_dst->mat = (Material **)MEM_dupallocN(volume_src->mat);
@ -1372,7 +1372,7 @@ Volume *BKE_volume_copy_for_eval(Volume *volume_src, bool reference)
flags |= LIB_ID_COPY_CD_REFERENCE;
}
Volume *result = (Volume *)BKE_id_copy_ex(NULL, &volume_src->id, NULL, flags);
Volume *result = (Volume *)BKE_id_copy_ex(nullptr, &volume_src->id, nullptr, flags);
return result;
}
@ -1395,12 +1395,12 @@ VolumeGrid *BKE_volume_grid_add(Volume *volume, const char *name, VolumeGridType
{
#ifdef WITH_OPENVDB
VolumeGridVector &grids = *volume->runtime.grids;
BLI_assert(BKE_volume_grid_find(volume, name) == NULL);
BLI_assert(BKE_volume_grid_find(volume, name) == nullptr);
BLI_assert(type != VOLUME_GRID_UNKNOWN);
openvdb::GridBase::Ptr vdb_grid = BKE_volume_grid_type_operation(type, CreateGridOp{});
if (!vdb_grid) {
return NULL;
return nullptr;
}
vdb_grid->setName(name);

View File

@ -123,7 +123,7 @@ bool BKE_volume_grid_dense_floats(const Volume *volume,
const int channels = BKE_volume_grid_channels(volume_grid);
const int elem_size = sizeof(float) * channels;
float *voxels = static_cast<float *>(MEM_malloc_arrayN(num_voxels, elem_size, __func__));
if (voxels == NULL) {
if (voxels == nullptr) {
return false;
}
@ -143,7 +143,7 @@ bool BKE_volume_grid_dense_floats(const Volume *volume,
void BKE_volume_dense_float_grid_clear(DenseFloatVolumeGrid *dense_grid)
{
if (dense_grid->voxels != NULL) {
if (dense_grid->voxels != nullptr) {
MEM_freeN(dense_grid->voxels);
}
}
@ -339,7 +339,7 @@ void BKE_volume_grid_wireframe(const Volume *volume,
void *cb_userdata)
{
if (volume->display.wireframe_type == VOLUME_WIREFRAME_NONE) {
cb(cb_userdata, NULL, NULL, 0, 0);
cb(cb_userdata, nullptr, nullptr, 0, 0);
return;
}

View File

@ -654,12 +654,12 @@ template<typename T> inline bool is_border_edge(const CDTEdge<T> *e, const CDT_s
template<typename T> inline bool is_constrained_edge(const CDTEdge<T> *e)
{
return e->input_ids != NULL;
return e->input_ids != nullptr;
}
template<typename T> inline bool is_deleted_edge(const CDTEdge<T> *e)
{
return e->symedges[0].next == NULL;
return e->symedges[0].next == nullptr;
}
template<typename T> inline bool is_original_vert(const CDTVert<T> *v, CDT_state<T> *cdt)
@ -1386,8 +1386,8 @@ void fill_crossdata_for_through_vert(CDTVert<T> *v,
cd_next->lambda = T(0);
cd_next->vert = v;
cd_next->in = NULL;
cd_next->out = NULL;
cd_next->in = nullptr;
cd_next->out = nullptr;
if (cd->lambda == 0) {
cd->out = cd_out;
}
@ -1630,10 +1630,10 @@ void add_edge_constraint(
if (dbg_level > 0) {
std::cout << "\nADD EDGE CONSTRAINT\n" << vertname(v1) << " " << vertname(v2) << "\n";
}
LinkNodePair edge_list = {NULL, NULL};
LinkNodePair edge_list = {nullptr, nullptr};
if (r_edges) {
*r_edges = NULL;
*r_edges = nullptr;
}
/*
@ -1648,7 +1648,7 @@ void add_edge_constraint(
if (t != nullptr) {
/* Segment already there. */
add_to_input_ids(&t->edge->input_ids, input_id);
if (r_edges != NULL) {
if (r_edges != nullptr) {
BLI_linklist_append(&edge_list, t->edge);
*r_edges = edge_list.list;
}
@ -1736,15 +1736,15 @@ void add_edge_constraint(
SymEdge<T> *se;
if (cd_prev->lambda == 0.0) {
se = find_symedge_between_verts(cd_prev->vert, v);
if (se == NULL) {
if (se == nullptr) {
return;
}
cd_prev->out = se;
cd->in = NULL;
cd->in = nullptr;
}
else {
se = find_symedge_with_face(v, sym(cd_prev->in)->face);
if (se == NULL) {
if (se == nullptr) {
return;
}
cd->in = se;
@ -1783,7 +1783,7 @@ void add_edge_constraint(
if (cd->lambda == -1.0) {
continue; /* This crossing was deleted. */
}
t = NULL;
t = nullptr;
SymEdge<T> *tnext = t;
CDTEdge<T> *edge;
if (cd->lambda != 0.0) {
@ -1795,7 +1795,7 @@ void add_edge_constraint(
else if (cd->lambda == 0.0) {
t = cd->in;
tnext = cd->out;
if (t == NULL) {
if (t == nullptr) {
/* Previous non-deleted crossing must also have been a vert, and segment should exist. */
int j;
CrossData<T> *cd_prev;
@ -1809,12 +1809,12 @@ void add_edge_constraint(
BLI_assert(cd_prev->out->next->vert == cd->vert);
edge = cd_prev->out->edge;
add_to_input_ids(&edge->input_ids, input_id);
if (r_edges != NULL) {
if (r_edges != nullptr) {
BLI_linklist_append(&edge_list, edge);
}
}
}
if (t != NULL) {
if (t != nullptr) {
if (tstart->next->vert == t->vert) {
edge = tstart->edge;
}
@ -1822,7 +1822,7 @@ void add_edge_constraint(
edge = cdt_state->cdt.add_diagonal(tstart, t);
}
add_to_input_ids(&edge->input_ids, input_id);
if (r_edges != NULL) {
if (r_edges != nullptr) {
BLI_linklist_append(&edge_list, edge);
}
/* Now retriangulate upper and lower gaps. */
@ -1830,7 +1830,7 @@ void add_edge_constraint(
re_delaunay_triangulate(&cdt_state->cdt, &edge->symedges[1]);
}
if (i < ncrossings - 1) {
if (tnext != NULL) {
if (tnext != nullptr) {
tstart = tnext;
}
}
@ -2011,7 +2011,7 @@ template<typename T> void dissolve_symedge(CDT_state<T> *cdt_state, SymEdge<T> *
if (ELEM(cdt->outer_face->symedge, se, symse)) {
/* Advancing by 2 to get past possible 'sym(se)'. */
if (se->next->next == se) {
cdt->outer_face->symedge = NULL;
cdt->outer_face->symedge = nullptr;
}
else {
cdt->outer_face->symedge = se->next->next;
@ -2177,9 +2177,9 @@ template<typename T> void remove_outer_edges_until_constraints(CDT_state<T> *cdt
}
se = se->next;
} while (se != se_start);
while (to_dissolve != NULL) {
while (to_dissolve != nullptr) {
se = static_cast<SymEdge<T> *>(BLI_linklist_pop(&to_dissolve));
if (se->next != NULL) {
if (se->next != nullptr) {
dissolve_symedge(cdt_state, se);
}
}

View File

@ -1137,7 +1137,7 @@ static bool non_trivially_2d_hex_overlap(int orients[2][3][3])
for (int ab = 0; ab < 2; ++ab) {
for (int i = 0; i < 3; ++i) {
bool ok = orients[ab][i][0] + orients[ab][i][1] + orients[ab][i][2] == 1 &&
orients[ab][i][0] != 0 && orients[ab][i][1] != 0 && orients[i][2] != 0;
orients[ab][i][0] != 0 && orients[ab][i][1] != 0 && orients[i][2] != nullptr;
if (!ok) {
return false;
}
@ -2460,12 +2460,12 @@ class TriOverlaps {
if (two_trees_no_self) {
BLI_bvhtree_balance(tree_b_);
/* Don't expect a lot of trivial intersects in this case. */
overlap_ = BLI_bvhtree_overlap(tree_, tree_b_, &overlap_tot_, NULL, NULL);
overlap_ = BLI_bvhtree_overlap(tree_, tree_b_, &overlap_tot_, nullptr, nullptr);
}
else {
CBData cbdata{tm, shape_fn, nshapes, use_self};
if (nshapes == 1) {
overlap_ = BLI_bvhtree_overlap(tree_, tree_, &overlap_tot_, NULL, NULL);
overlap_ = BLI_bvhtree_overlap(tree_, tree_, &overlap_tot_, nullptr, nullptr);
}
else {
overlap_ = BLI_bvhtree_overlap(

View File

@ -83,11 +83,11 @@ class Task {
free_taskdata(other.free_taskdata),
freedata(other.freedata)
{
other.pool = NULL;
other.run = NULL;
other.taskdata = NULL;
other.pool = nullptr;
other.run = nullptr;
other.taskdata = nullptr;
other.free_taskdata = false;
other.freedata = NULL;
other.freedata = nullptr;
}
#if defined(WITH_TBB) && TBB_INTERFACE_VERSION_MAJOR < 10
@ -302,7 +302,7 @@ static void *background_task_run(void *userdata)
task->~Task();
MEM_freeN(task);
}
return NULL;
return nullptr;
}
static void background_task_pool_create(TaskPool *pool)

View File

@ -70,7 +70,7 @@ struct RangeTask {
~RangeTask()
{
if (settings->func_free != NULL) {
if (settings->func_free != nullptr) {
settings->func_free(userdata, userdata_chunk);
}
MEM_SAFE_FREE(userdata_chunk);
@ -83,7 +83,7 @@ struct RangeTask {
memcpy(userdata_chunk, from_chunk, settings->userdata_chunk_size);
}
else {
userdata_chunk = NULL;
userdata_chunk = nullptr;
}
}
@ -139,7 +139,7 @@ void BLI_task_parallel_range(const int start,
for (int i = start; i < stop; i++) {
func(userdata, i, &tls);
}
if (settings->func_free != NULL) {
if (settings->func_free != nullptr) {
settings->func_free(userdata, settings->userdata_chunk);
}
}

View File

@ -125,7 +125,7 @@ static TestBuffer *testbuffer_list_add(ListBase *lb, const void *data, size_t da
TestBuffer *tb = (TestBuffer *)MEM_mallocN(sizeof(*tb), __func__);
tb->data = data;
tb->data_len = data_len;
tb->state = NULL;
tb->state = nullptr;
BLI_addtail(lb, tb);
return tb;
}
@ -244,10 +244,10 @@ static void testbuffer_list_data_randomize(ListBase *lb, unsigned int random_see
static void testbuffer_list_store_populate(BArrayStore *bs, ListBase *lb)
{
for (TestBuffer *tb = (TestBuffer *)lb->first, *tb_prev = NULL; tb;
for (TestBuffer *tb = (TestBuffer *)lb->first, *tb_prev = nullptr; tb;
tb_prev = tb, tb = tb->next) {
tb->state = BLI_array_store_state_add(
bs, tb->data, tb->data_len, (tb_prev ? tb_prev->state : NULL));
bs, tb->data, tb->data_len, (tb_prev ? tb_prev->state : nullptr));
}
}
@ -255,7 +255,7 @@ static void testbuffer_list_store_clear(BArrayStore *bs, ListBase *lb)
{
for (TestBuffer *tb = (TestBuffer *)lb->first; tb; tb = tb->next) {
BLI_array_store_state_remove(bs, tb->state);
tb->state = NULL;
tb->state = nullptr;
}
}
@ -313,7 +313,7 @@ TEST(array_store, NopState)
{
BArrayStore *bs = BLI_array_store_create(1, 32);
const unsigned char data[] = "test";
BArrayState *state = BLI_array_store_state_add(bs, data, sizeof(data) - 1, NULL);
BArrayState *state = BLI_array_store_state_add(bs, data, sizeof(data) - 1, nullptr);
EXPECT_EQ(BLI_array_store_state_size_get(state), sizeof(data) - 1);
BLI_array_store_state_remove(bs, state);
BLI_array_store_destroy(bs);
@ -324,7 +324,7 @@ TEST(array_store, Single)
BArrayStore *bs = BLI_array_store_create(1, 32);
const char data_src[] = "test";
const char *data_dst;
BArrayState *state = BLI_array_store_state_add(bs, data_src, sizeof(data_src), NULL);
BArrayState *state = BLI_array_store_state_add(bs, data_src, sizeof(data_src), nullptr);
size_t data_dst_len;
data_dst = (char *)BLI_array_store_state_data_get_alloc(state, &data_dst_len);
EXPECT_STREQ(data_src, data_dst);
@ -339,7 +339,7 @@ TEST(array_store, DoubleNop)
const char data_src[] = "test";
const char *data_dst;
BArrayState *state_a = BLI_array_store_state_add(bs, data_src, sizeof(data_src), NULL);
BArrayState *state_a = BLI_array_store_state_add(bs, data_src, sizeof(data_src), nullptr);
BArrayState *state_b = BLI_array_store_state_add(bs, data_src, sizeof(data_src), state_a);
EXPECT_EQ(BLI_array_store_calc_size_compacted_get(bs), sizeof(data_src));
@ -366,7 +366,7 @@ TEST(array_store, DoubleDiff)
const char data_src_b[] = "####";
const char *data_dst;
BArrayState *state_a = BLI_array_store_state_add(bs, data_src_a, sizeof(data_src_a), NULL);
BArrayState *state_a = BLI_array_store_state_add(bs, data_src_a, sizeof(data_src_a), nullptr);
BArrayState *state_b = BLI_array_store_state_add(bs, data_src_b, sizeof(data_src_b), state_a);
size_t data_dst_len;
@ -594,7 +594,7 @@ static void testbuffer_list_state_random_data(ListBase *lb,
size_t data_len = rand_range_i(rng, data_min_len, data_max_len + stride, stride);
char *data = (char *)MEM_mallocN(data_len, __func__);
if (lb->last == NULL) {
if (lb->last == nullptr) {
BLI_rng_get_char_n(rng, data, data_len);
}
else {

View File

@ -91,7 +91,7 @@ TEST(array_utils, FindIndexInt4_DupeMid)
TEST(array_utils, FindIndexPointer)
{
const char *data[4] = {NULL};
const char *data[4] = {nullptr};
STACK_DECLARE(data);
STACK_INIT(data, ARRAY_SIZE(data));

View File

@ -1513,7 +1513,7 @@ TEST(delaunay_d, CintTwoFace)
input.edges_len = 0;
input.faces_len = 2;
input.vert_coords = vert_coords;
input.edges = NULL;
input.edges = nullptr;
input.faces = faces;
input.faces_len_table = faces_len;
input.faces_start_table = faces_start;

View File

@ -12,7 +12,7 @@
static void expr_pylike_parse_fail_test(const char *str)
{
ExprPyLike_Parsed *expr = BLI_expr_pylike_parse(str, NULL, 0);
ExprPyLike_Parsed *expr = BLI_expr_pylike_parse(str, nullptr, 0);
EXPECT_FALSE(BLI_expr_pylike_is_valid(expr));
@ -21,7 +21,7 @@ static void expr_pylike_parse_fail_test(const char *str)
static void expr_pylike_const_test(const char *str, double value, bool force_const)
{
ExprPyLike_Parsed *expr = BLI_expr_pylike_parse(str, NULL, 0);
ExprPyLike_Parsed *expr = BLI_expr_pylike_parse(str, nullptr, 0);
if (force_const) {
EXPECT_TRUE(BLI_expr_pylike_is_constant(expr));
@ -32,7 +32,7 @@ static void expr_pylike_const_test(const char *str, double value, bool force_con
}
double result;
eExprPyLike_EvalStatus status = BLI_expr_pylike_eval(expr, NULL, 0, &result);
eExprPyLike_EvalStatus status = BLI_expr_pylike_eval(expr, nullptr, 0, &result);
EXPECT_EQ(status, EXPR_PYLIKE_SUCCESS);
EXPECT_EQ(result, value);
@ -344,10 +344,10 @@ TEST_ERROR(Mixed3, "sqrt(x) + 1 / max(0, x)", 1.0, EXPR_PYLIKE_SUCCESS)
TEST(expr_pylike, Error_Invalid)
{
ExprPyLike_Parsed *expr = BLI_expr_pylike_parse("", NULL, 0);
ExprPyLike_Parsed *expr = BLI_expr_pylike_parse("", nullptr, 0);
double result;
EXPECT_EQ(BLI_expr_pylike_eval(expr, NULL, 0, &result), EXPR_PYLIKE_INVALID);
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID);
BLI_expr_pylike_free(expr);
}
@ -357,7 +357,7 @@ TEST(expr_pylike, Error_ArgumentCount)
ExprPyLike_Parsed *expr = parse_for_eval("x", false);
double result;
EXPECT_EQ(BLI_expr_pylike_eval(expr, NULL, 0, &result), EXPR_PYLIKE_FATAL_ERROR);
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_FATAL_ERROR);
BLI_expr_pylike_free(expr);
}

View File

@ -77,7 +77,7 @@ TEST(ghash, InsertLookup)
EXPECT_EQ(POINTER_AS_UINT(v), *k);
}
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
}
/* Here we simply insert and then remove all keys, ensuring we do get an empty,
@ -98,14 +98,14 @@ TEST(ghash, InsertRemove)
bkt_size = BLI_ghash_buckets_len(ghash);
for (i = TESTCASE_SIZE, k = keys; i--; k++) {
void *v = BLI_ghash_popkey(ghash, POINTER_FROM_UINT(*k), NULL);
void *v = BLI_ghash_popkey(ghash, POINTER_FROM_UINT(*k), nullptr);
EXPECT_EQ(POINTER_AS_UINT(v), *k);
}
EXPECT_EQ(BLI_ghash_len(ghash), 0);
EXPECT_EQ(BLI_ghash_buckets_len(ghash), bkt_size);
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
}
/* Same as above, but this time we allow ghash to shrink. */
@ -126,14 +126,14 @@ TEST(ghash, InsertRemoveShrink)
bkt_size = BLI_ghash_buckets_len(ghash);
for (i = TESTCASE_SIZE, k = keys; i--; k++) {
void *v = BLI_ghash_popkey(ghash, POINTER_FROM_UINT(*k), NULL);
void *v = BLI_ghash_popkey(ghash, POINTER_FROM_UINT(*k), nullptr);
EXPECT_EQ(POINTER_AS_UINT(v), *k);
}
EXPECT_EQ(BLI_ghash_len(ghash), 0);
EXPECT_LT(BLI_ghash_buckets_len(ghash), bkt_size);
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
}
/* Check copy. */
@ -152,7 +152,7 @@ TEST(ghash, Copy)
EXPECT_EQ(BLI_ghash_len(ghash), TESTCASE_SIZE);
ghash_copy = BLI_ghash_copy(ghash, NULL, NULL);
ghash_copy = BLI_ghash_copy(ghash, nullptr, nullptr);
EXPECT_EQ(BLI_ghash_len(ghash_copy), TESTCASE_SIZE);
EXPECT_EQ(BLI_ghash_buckets_len(ghash_copy), BLI_ghash_buckets_len(ghash));
@ -162,8 +162,8 @@ TEST(ghash, Copy)
EXPECT_EQ(POINTER_AS_UINT(v), *k);
}
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash_copy, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
BLI_ghash_free(ghash_copy, nullptr, nullptr);
}
/* Check pop. */
@ -205,5 +205,5 @@ TEST(ghash, Pop)
}
EXPECT_EQ(BLI_ghash_len(ghash), 0);
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
}

View File

@ -29,7 +29,7 @@ TEST(heap, SimpleEmpty)
heap = BLI_heapsimple_new();
EXPECT_TRUE(BLI_heapsimple_is_empty(heap));
EXPECT_EQ(BLI_heapsimple_len(heap), 0);
BLI_heapsimple_free(heap, NULL);
BLI_heapsimple_free(heap, nullptr);
}
TEST(heap, SimpleOne)
@ -45,7 +45,7 @@ TEST(heap, SimpleOne)
EXPECT_EQ(in, BLI_heapsimple_pop_min(heap));
EXPECT_TRUE(BLI_heapsimple_is_empty(heap));
EXPECT_EQ(BLI_heapsimple_len(heap), 0);
BLI_heapsimple_free(heap, NULL);
BLI_heapsimple_free(heap, nullptr);
}
TEST(heap, SimpleRange)
@ -59,7 +59,7 @@ TEST(heap, SimpleRange)
EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heapsimple_pop_min(heap)));
}
EXPECT_TRUE(BLI_heapsimple_is_empty(heap));
BLI_heapsimple_free(heap, NULL);
BLI_heapsimple_free(heap, nullptr);
}
TEST(heap, SimpleRangeReverse)
@ -73,7 +73,7 @@ TEST(heap, SimpleRangeReverse)
EXPECT_EQ(-out_test, POINTER_AS_INT(BLI_heapsimple_pop_min(heap)));
}
EXPECT_TRUE(BLI_heapsimple_is_empty(heap));
BLI_heapsimple_free(heap, NULL);
BLI_heapsimple_free(heap, nullptr);
}
TEST(heap, SimpleDuplicates)
@ -81,13 +81,13 @@ TEST(heap, SimpleDuplicates)
const int items_total = SIZE;
HeapSimple *heap = BLI_heapsimple_new();
for (int in = 0; in < items_total; in++) {
BLI_heapsimple_insert(heap, 1.0f, 0);
BLI_heapsimple_insert(heap, 1.0f, nullptr);
}
for (int out_test = 0; out_test < items_total; out_test++) {
EXPECT_EQ(0, POINTER_AS_INT(BLI_heapsimple_pop_min(heap)));
}
EXPECT_TRUE(BLI_heapsimple_is_empty(heap));
BLI_heapsimple_free(heap, NULL);
BLI_heapsimple_free(heap, nullptr);
}
static void random_heapsimple_helper(const int items_total, const int random_seed)
@ -103,7 +103,7 @@ static void random_heapsimple_helper(const int items_total, const int random_see
EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heapsimple_pop_min(heap)));
}
EXPECT_TRUE(BLI_heapsimple_is_empty(heap));
BLI_heapsimple_free(heap, NULL);
BLI_heapsimple_free(heap, nullptr);
MEM_freeN(values);
}

View File

@ -28,7 +28,7 @@ TEST(heap, Empty)
heap = BLI_heap_new();
EXPECT_TRUE(BLI_heap_is_empty(heap));
EXPECT_EQ(BLI_heap_len(heap), 0);
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
}
TEST(heap, One)
@ -44,7 +44,7 @@ TEST(heap, One)
EXPECT_EQ(in, BLI_heap_pop_min(heap));
EXPECT_TRUE(BLI_heap_is_empty(heap));
EXPECT_EQ(BLI_heap_len(heap), 0);
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
}
TEST(heap, Range)
@ -58,7 +58,7 @@ TEST(heap, Range)
EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heap_pop_min(heap)));
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
}
TEST(heap, RangeReverse)
@ -72,7 +72,7 @@ TEST(heap, RangeReverse)
EXPECT_EQ(-out_test, POINTER_AS_INT(BLI_heap_pop_min(heap)));
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
}
TEST(heap, RangeRemove)
@ -85,13 +85,13 @@ TEST(heap, RangeRemove)
}
for (int i = 0; i < items_total; i += 2) {
BLI_heap_remove(heap, nodes[i]);
nodes[i] = NULL;
nodes[i] = nullptr;
}
for (int out_test = 1; out_test < items_total; out_test += 2) {
EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heap_pop_min(heap)));
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
MEM_freeN(nodes);
}
@ -100,13 +100,13 @@ TEST(heap, Duplicates)
const int items_total = SIZE;
Heap *heap = BLI_heap_new();
for (int in = 0; in < items_total; in++) {
BLI_heap_insert(heap, 1.0f, 0);
BLI_heap_insert(heap, 1.0f, nullptr);
}
for (int out_test = 0; out_test < items_total; out_test++) {
EXPECT_EQ(0, POINTER_AS_INT(BLI_heap_pop_min(heap)));
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
}
static void random_heap_helper(const int items_total, const int random_seed)
@ -122,7 +122,7 @@ static void random_heap_helper(const int items_total, const int random_seed)
EXPECT_EQ(out_test, POINTER_AS_INT(BLI_heap_pop_min(heap)));
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
MEM_freeN(values);
}
@ -156,7 +156,7 @@ TEST(heap, ReInsertSimple)
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
MEM_freeN(nodes);
}
@ -181,7 +181,7 @@ static void random_heap_reinsert_helper(const int items_total, const int random_
BLI_heap_pop_min(heap);
}
EXPECT_TRUE(BLI_heap_is_empty(heap));
BLI_heap_free(heap, NULL);
BLI_heap_free(heap, nullptr);
MEM_freeN(nodes);
}

View File

@ -82,11 +82,11 @@ static void find_nearest_points_test(
BLI_bvhtree_balance(tree);
/* first find each point */
BVHTree_NearestPointCallback callback = optimal ? optimal_check_callback : NULL;
BVHTree_NearestPointCallback callback = optimal ? optimal_check_callback : nullptr;
int flags = optimal ? BVH_NEAREST_OPTIMAL_ORDER : 0;
for (int i = 0; i < points_len; i++) {
const int j = BLI_bvhtree_find_nearest_ex(tree, points[i], NULL, callback, points, flags);
const int j = BLI_bvhtree_find_nearest_ex(tree, points[i], nullptr, callback, points, flags);
if (j != i) {
#if 0
const float dist = len_v3v3(points[i], points[j]);

View File

@ -15,7 +15,7 @@ TEST(LockfreeLinkList, Init)
BLI_linklist_lockfree_init(&list);
EXPECT_EQ(list.head, &list.dummy_node);
EXPECT_EQ(list.tail, &list.dummy_node);
BLI_linklist_lockfree_free(&list, NULL);
BLI_linklist_lockfree_free(&list, nullptr);
}
TEST(LockfreeLinkList, InsertSingle)
@ -27,7 +27,7 @@ TEST(LockfreeLinkList, InsertSingle)
EXPECT_EQ(list.head, &list.dummy_node);
EXPECT_EQ(list.head->next, &node);
EXPECT_EQ(list.tail, &node);
BLI_linklist_lockfree_free(&list, NULL);
BLI_linklist_lockfree_free(&list, nullptr);
}
TEST(LockfreeLinkList, InsertMultiple)
@ -45,7 +45,7 @@ TEST(LockfreeLinkList, InsertMultiple)
EXPECT_EQ(list.tail, &nodes[num_nodes - 1]);
/* Check rest of the nodes. */
int node_index = 0;
for (LockfreeLinkNode *node = BLI_linklist_lockfree_begin(&list); node != NULL;
for (LockfreeLinkNode *node = BLI_linklist_lockfree_begin(&list); node != nullptr;
node = node->next, ++node_index) {
EXPECT_EQ(node, &nodes[node_index]);
if (node_index != num_nodes - 1) {
@ -53,7 +53,7 @@ TEST(LockfreeLinkList, InsertMultiple)
}
}
/* Free list. */
BLI_linklist_lockfree_free(&list, NULL);
BLI_linklist_lockfree_free(&list, nullptr);
}
namespace {
@ -84,7 +84,7 @@ TEST(LockfreeLinkList, InsertMultipleConcurrent)
TaskPool *pool = BLI_task_pool_create_suspended(&list, TASK_PRIORITY_HIGH);
/* Push tasks to the pool. */
for (int i = 0; i < num_nodes; ++i) {
BLI_task_pool_push(pool, concurrent_insert, POINTER_FROM_INT(i), false, NULL);
BLI_task_pool_push(pool, concurrent_insert, POINTER_FROM_INT(i), false, nullptr);
}
/* Run all the tasks. */
BLI_task_pool_work_and_wait(pool);
@ -92,7 +92,7 @@ TEST(LockfreeLinkList, InsertMultipleConcurrent)
EXPECT_EQ(list.head, &list.dummy_node);
bool *visited_nodes = (bool *)MEM_callocN(sizeof(bool) * num_nodes, "visited nodes");
/* First, we make sure that none of the nodes are added twice. */
for (LockfreeLinkNode *node_v = BLI_linklist_lockfree_begin(&list); node_v != NULL;
for (LockfreeLinkNode *node_v = BLI_linklist_lockfree_begin(&list); node_v != nullptr;
node_v = node_v->next) {
IndexedNode *node = (IndexedNode *)node_v;
EXPECT_GE(node->index, 0);

View File

@ -22,19 +22,19 @@ static bool listbase_is_valid(const ListBase *listbase)
if (listbase->first) {
const Link *prev, *link;
link = (Link *)listbase->first;
TESTFAIL(link->prev == NULL);
TESTFAIL(link->prev == nullptr);
link = (Link *)listbase->last;
TESTFAIL(link->next == NULL);
TESTFAIL(link->next == nullptr);
prev = NULL;
prev = nullptr;
link = (Link *)listbase->first;
do {
TESTFAIL(link->prev == prev);
} while ((void)(prev = link), (link = link->next));
TESTFAIL(prev == listbase->last);
prev = NULL;
prev = nullptr;
link = (Link *)listbase->last;
do {
TESTFAIL(link->next == prev);
@ -42,7 +42,7 @@ static bool listbase_is_valid(const ListBase *listbase)
TESTFAIL(prev == listbase->first);
}
else {
TESTFAIL(listbase->last == NULL);
TESTFAIL(listbase->last == nullptr);
}
#undef TESTFAIL
@ -73,12 +73,12 @@ TEST(listbase, FindLinkOrIndex)
/* Empty list */
BLI_listbase_clear(&lb);
EXPECT_EQ(BLI_findlink(&lb, -1), (void *)NULL);
EXPECT_EQ(BLI_findlink(&lb, 0), (void *)NULL);
EXPECT_EQ(BLI_findlink(&lb, 1), (void *)NULL);
EXPECT_EQ(BLI_rfindlink(&lb, -1), (void *)NULL);
EXPECT_EQ(BLI_rfindlink(&lb, 0), (void *)NULL);
EXPECT_EQ(BLI_rfindlink(&lb, 1), (void *)NULL);
EXPECT_EQ(BLI_findlink(&lb, -1), (void *)nullptr);
EXPECT_EQ(BLI_findlink(&lb, 0), (void *)nullptr);
EXPECT_EQ(BLI_findlink(&lb, 1), (void *)nullptr);
EXPECT_EQ(BLI_rfindlink(&lb, -1), (void *)nullptr);
EXPECT_EQ(BLI_rfindlink(&lb, 0), (void *)nullptr);
EXPECT_EQ(BLI_rfindlink(&lb, 1), (void *)nullptr);
EXPECT_EQ(BLI_findindex(&lb, link1), -1);
/* One link */

View File

@ -18,46 +18,46 @@ TEST(path_util, Clean)
/* "/./" -> "/" */
{
char path[FILE_MAX] = "/a/./b/./c/./";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("/a/b/c/", path);
}
{
char path[FILE_MAX] = "/./././";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("/", path);
}
{
char path[FILE_MAX] = "/a/./././b/";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("/a/b/", path);
}
/* "//" -> "/" */
{
char path[FILE_MAX] = "a////";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("a/", path);
}
if (false) /* FIXME */
{
char path[FILE_MAX] = "./a////";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("./a/", path);
}
/* "foo/bar/../" -> "foo/" */
{
char path[FILE_MAX] = "/a/b/c/../../../";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("/", path);
}
{
char path[FILE_MAX] = "/a/../a/b/../b/c/../c/";
BLI_path_normalize(NULL, path);
BLI_path_normalize(nullptr, path);
EXPECT_STREQ("/a/b/c/", path);
}
@ -96,10 +96,10 @@ TEST(path_util, NameAtIndex_Single)
AT_INDEX("//a//", 0, "a");
AT_INDEX("a/b", 0, "a");
AT_INDEX("/a", 1, NULL);
AT_INDEX("/a/", 1, NULL);
AT_INDEX("a/", 1, NULL);
AT_INDEX("//a//", 1, NULL);
AT_INDEX("/a", 1, nullptr);
AT_INDEX("/a/", 1, nullptr);
AT_INDEX("a/", 1, nullptr);
AT_INDEX("//a//", 1, nullptr);
}
TEST(path_util, NameAtIndex_SingleNeg)
{
@ -109,10 +109,10 @@ TEST(path_util, NameAtIndex_SingleNeg)
AT_INDEX("//a//", -1, "a");
AT_INDEX("a/b", -1, "b");
AT_INDEX("/a", -2, NULL);
AT_INDEX("/a/", -2, NULL);
AT_INDEX("a/", -2, NULL);
AT_INDEX("//a//", -2, NULL);
AT_INDEX("/a", -2, nullptr);
AT_INDEX("/a/", -2, nullptr);
AT_INDEX("a/", -2, nullptr);
AT_INDEX("//a//", -2, nullptr);
}
TEST(path_util, NameAtIndex_Double)
@ -123,10 +123,10 @@ TEST(path_util, NameAtIndex_Double)
AT_INDEX("//ab//", 0, "ab");
AT_INDEX("ab/c", 0, "ab");
AT_INDEX("/ab", 1, NULL);
AT_INDEX("/ab/", 1, NULL);
AT_INDEX("ab/", 1, NULL);
AT_INDEX("//ab//", 1, NULL);
AT_INDEX("/ab", 1, nullptr);
AT_INDEX("/ab/", 1, nullptr);
AT_INDEX("ab/", 1, nullptr);
AT_INDEX("//ab//", 1, nullptr);
}
TEST(path_util, NameAtIndex_DoublNeg)
@ -137,10 +137,10 @@ TEST(path_util, NameAtIndex_DoublNeg)
AT_INDEX("//ab//", -1, "ab");
AT_INDEX("ab/c", -1, "c");
AT_INDEX("/ab", -2, NULL);
AT_INDEX("/ab/", -2, NULL);
AT_INDEX("ab/", -2, NULL);
AT_INDEX("//ab//", -2, NULL);
AT_INDEX("/ab", -2, nullptr);
AT_INDEX("/ab/", -2, nullptr);
AT_INDEX("ab/", -2, nullptr);
AT_INDEX("//ab//", -2, nullptr);
}
TEST(path_util, NameAtIndex_Misc)
@ -149,8 +149,8 @@ TEST(path_util, NameAtIndex_Misc)
AT_INDEX("/how/now/brown/cow", 1, "now");
AT_INDEX("/how/now/brown/cow", 2, "brown");
AT_INDEX("/how/now/brown/cow", 3, "cow");
AT_INDEX("/how/now/brown/cow", 4, NULL);
AT_INDEX("/how/now/brown/cow/", 4, NULL);
AT_INDEX("/how/now/brown/cow", 4, nullptr);
AT_INDEX("/how/now/brown/cow/", 4, nullptr);
}
TEST(path_util, NameAtIndex_MiscNeg)
@ -159,8 +159,8 @@ TEST(path_util, NameAtIndex_MiscNeg)
AT_INDEX("/how/now/brown/cow", 1, "now");
AT_INDEX("/how/now/brown/cow", 2, "brown");
AT_INDEX("/how/now/brown/cow", 3, "cow");
AT_INDEX("/how/now/brown/cow", 4, NULL);
AT_INDEX("/how/now/brown/cow/", 4, NULL);
AT_INDEX("/how/now/brown/cow", 4, nullptr);
AT_INDEX("/how/now/brown/cow/", 4, nullptr);
}
TEST(path_util, NameAtIndex_MiscComplex)
@ -169,8 +169,8 @@ TEST(path_util, NameAtIndex_MiscComplex)
AT_INDEX("//how///now\\/brown/cow", 1, "now");
AT_INDEX("/how/now\\//brown\\/cow", 2, "brown");
AT_INDEX("/how/now/brown/cow//\\", 3, "cow");
AT_INDEX("/how/now/brown/\\cow", 4, NULL);
AT_INDEX("how/now/brown/\\cow\\", 4, NULL);
AT_INDEX("/how/now/brown/\\cow", 4, nullptr);
AT_INDEX("how/now/brown/\\cow\\", 4, nullptr);
}
TEST(path_util, NameAtIndex_MiscComplexNeg)
@ -179,24 +179,24 @@ TEST(path_util, NameAtIndex_MiscComplexNeg)
AT_INDEX("//how///now\\/brown/cow", -3, "now");
AT_INDEX("/how/now\\//brown\\/cow", -2, "brown");
AT_INDEX("/how/now/brown/cow//\\", -1, "cow");
AT_INDEX("/how/now/brown/\\cow", -5, NULL);
AT_INDEX("how/now/brown/\\cow\\", -5, NULL);
AT_INDEX("/how/now/brown/\\cow", -5, nullptr);
AT_INDEX("how/now/brown/\\cow\\", -5, nullptr);
}
TEST(path_util, NameAtIndex_NoneComplex)
{
AT_INDEX("", 0, NULL);
AT_INDEX("/", 0, NULL);
AT_INDEX("//", 0, NULL);
AT_INDEX("///", 0, NULL);
AT_INDEX("", 0, nullptr);
AT_INDEX("/", 0, nullptr);
AT_INDEX("//", 0, nullptr);
AT_INDEX("///", 0, nullptr);
}
TEST(path_util, NameAtIndex_NoneComplexNeg)
{
AT_INDEX("", -1, NULL);
AT_INDEX("/", -1, NULL);
AT_INDEX("//", -1, NULL);
AT_INDEX("///", -1, NULL);
AT_INDEX("", -1, nullptr);
AT_INDEX("/", -1, nullptr);
AT_INDEX("//", -1, nullptr);
AT_INDEX("///", -1, nullptr);
}
#undef AT_INDEX
@ -590,9 +590,9 @@ TEST(path_util, PathFrameGet)
/* BLI_path_extension */
TEST(path_util, PathExtension)
{
EXPECT_EQ(NULL, BLI_path_extension("some.def/file"));
EXPECT_EQ(NULL, BLI_path_extension("Text"));
EXPECT_EQ(NULL, BLI_path_extension("Text…001"));
EXPECT_EQ(nullptr, BLI_path_extension("some.def/file"));
EXPECT_EQ(nullptr, BLI_path_extension("Text"));
EXPECT_EQ(nullptr, BLI_path_extension("Text…001"));
EXPECT_STREQ(".", BLI_path_extension("some/file."));
EXPECT_STREQ(".gz", BLI_path_extension("some/file.tar.gz"));

View File

@ -118,7 +118,7 @@ static void test_polyfill_topology(const float /*poly*/[][2],
}
BLI_edgehashIterator_free(ehi);
BLI_edgehash_free(edgehash, NULL);
BLI_edgehash_free(edgehash, nullptr);
}
/**
@ -205,7 +205,7 @@ static void test_polyfill_template(const char *id,
test_polyfill_template_check(id, is_degenerate, poly, poly_tot, tris, tris_tot);
BLI_memarena_free(pf_arena);
BLI_heap_free(pf_heap, NULL);
BLI_heap_free(pf_heap, nullptr);
}
#endif
}

View File

@ -66,8 +66,8 @@ TEST(string, StrPartition)
/* "" -> "", NULL, NULL, 0 */
pre_ln = BLI_str_partition(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 0);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
{
@ -76,8 +76,8 @@ TEST(string, StrPartition)
/* "material" -> "material", NULL, NULL, 8 */
pre_ln = BLI_str_partition(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 8);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
}
@ -125,8 +125,8 @@ TEST(string, StrRPartition)
/* "" -> "", NULL, NULL, 0 */
pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 0);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
{
@ -135,8 +135,8 @@ TEST(string, StrRPartition)
/* "material" -> "material", NULL, NULL, 8 */
pre_ln = BLI_str_rpartition(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 8);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
}
@ -166,8 +166,8 @@ TEST(string, StrPartitionEx)
/* "mate.rial" over "mate" -> "mate.rial", NULL, NULL, 4 */
pre_ln = BLI_str_partition_ex(str, str + 4, delim, &sep, &suf, true);
EXPECT_EQ(pre_ln, 4);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
}
@ -215,8 +215,8 @@ TEST(string, StrPartitionUtf8)
/* "" -> "", NULL, NULL, 0 */
pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 0);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
{
@ -225,8 +225,8 @@ TEST(string, StrPartitionUtf8)
/* "material" -> "material", NULL, NULL, 8 */
pre_ln = BLI_str_partition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 8);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
}
@ -274,8 +274,8 @@ TEST(string, StrRPartitionUtf8)
/* "" -> "", NULL, NULL, 0 */
pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 0);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
{
@ -284,8 +284,8 @@ TEST(string, StrRPartitionUtf8)
/* "material" -> "material", NULL, NULL, 8 */
pre_ln = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_ln, 8);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
}
@ -316,8 +316,8 @@ TEST(string, StrPartitionExUtf8)
/* "mate\xe2\x98\xafrial" over "mate" -> "mate\xe2\x98\xafrial", NULL, NULL, 4 */
pre_ln = BLI_str_partition_ex_utf8(str, str + 4, delim, &sep, &suf, true);
EXPECT_EQ(pre_ln, 4);
EXPECT_EQ(sep, (void *)NULL);
EXPECT_EQ(suf, (void *)NULL);
EXPECT_EQ(sep, (void *)nullptr);
EXPECT_EQ(suf, (void *)nullptr);
}
}
@ -567,7 +567,7 @@ TEST(string, StringStrncasestr)
EXPECT_EQ(res, str_test0 + 1);
res = BLI_strncasestr(str_test0, "not there", 9);
EXPECT_EQ(res, (void *)NULL);
EXPECT_EQ(res, (void *)nullptr);
}
/* BLI_string_max_possible_word_count */

View File

@ -262,14 +262,14 @@ const char *utf8_invalid_tests[][3] = {
/* For now, we ignore those, they do not seem to be crucial anyway... */
/* 5.3.3 U+FDD0 .. U+FDEF
* 5.3.4 U+nFFFE U+nFFFF (for n = 1..10) */
{NULL, NULL, NULL},
{nullptr, nullptr, nullptr},
};
/* clang-format on */
/* BLI_utf8_invalid_strip (and indirectly, BLI_utf8_invalid_byte). */
TEST(string, Utf8InvalidBytes)
{
for (int i = 0; utf8_invalid_tests[i][0] != NULL; i++) {
for (int i = 0; utf8_invalid_tests[i][0] != nullptr; i++) {
const char *tst = utf8_invalid_tests[i][0];
const char *tst_stripped = utf8_invalid_tests[i][1];
const int num_errors = (int)utf8_invalid_tests[i][2][0];

View File

@ -52,16 +52,16 @@ TEST(task, GraphSequential)
TaskGraph *graph = BLI_task_graph_create();
/* 0 => 1 */
TaskNode *node_a = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, NULL);
TaskNode *node_a = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, nullptr);
/* 1 => 2 */
TaskNode *node_b = BLI_task_graph_node_create(
graph, TaskData_multiply_by_two_value, &data, NULL);
graph, TaskData_multiply_by_two_value, &data, nullptr);
/* 2 => 1 */
TaskNode *node_c = BLI_task_graph_node_create(graph, TaskData_decrease_value, &data, NULL);
TaskNode *node_c = BLI_task_graph_node_create(graph, TaskData_decrease_value, &data, nullptr);
/* 2 => 1 */
TaskNode *node_d = BLI_task_graph_node_create(graph, TaskData_square_value, &data, NULL);
TaskNode *node_d = BLI_task_graph_node_create(graph, TaskData_square_value, &data, nullptr);
/* 1 => 1 */
TaskNode *node_e = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, NULL);
TaskNode *node_e = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, nullptr);
/* 1 => 2 */
const int expected_value = 2;
@ -82,12 +82,12 @@ TEST(task, GraphStartAtAnyNode)
TaskData data = {4};
TaskGraph *graph = BLI_task_graph_create();
TaskNode *node_a = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, NULL);
TaskNode *node_a = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, nullptr);
TaskNode *node_b = BLI_task_graph_node_create(
graph, TaskData_multiply_by_two_value, &data, NULL);
TaskNode *node_c = BLI_task_graph_node_create(graph, TaskData_decrease_value, &data, NULL);
TaskNode *node_d = BLI_task_graph_node_create(graph, TaskData_square_value, &data, NULL);
TaskNode *node_e = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, NULL);
graph, TaskData_multiply_by_two_value, &data, nullptr);
TaskNode *node_c = BLI_task_graph_node_create(graph, TaskData_decrease_value, &data, nullptr);
TaskNode *node_d = BLI_task_graph_node_create(graph, TaskData_square_value, &data, nullptr);
TaskNode *node_e = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, nullptr);
// ((4 - 1) * (4 - 1)) + 1
const int expected_value = 10;
@ -109,11 +109,11 @@ TEST(task, GraphSplit)
TaskData data = {1};
TaskGraph *graph = BLI_task_graph_create();
TaskNode *node_a = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, NULL);
TaskNode *node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data, NULL);
TaskNode *node_c = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, NULL);
TaskNode *node_a = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, nullptr);
TaskNode *node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data, nullptr);
TaskNode *node_c = BLI_task_graph_node_create(graph, TaskData_increase_value, &data, nullptr);
TaskNode *node_d = BLI_task_graph_node_create(
graph, TaskData_multiply_by_two_store, &data, NULL);
graph, TaskData_multiply_by_two_store, &data, nullptr);
BLI_task_graph_edge_create(node_a, node_b);
BLI_task_graph_edge_create(node_b, node_c);
BLI_task_graph_edge_create(node_b, node_d);
@ -134,12 +134,12 @@ TEST(task, GraphForest)
{
TaskNode *tree1_node_a = BLI_task_graph_node_create(
graph, TaskData_increase_value, &data1, NULL);
TaskNode *tree1_node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data1, NULL);
graph, TaskData_increase_value, &data1, nullptr);
TaskNode *tree1_node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data1, nullptr);
TaskNode *tree1_node_c = BLI_task_graph_node_create(
graph, TaskData_increase_value, &data1, NULL);
graph, TaskData_increase_value, &data1, nullptr);
TaskNode *tree1_node_d = BLI_task_graph_node_create(
graph, TaskData_multiply_by_two_store, &data1, NULL);
graph, TaskData_multiply_by_two_store, &data1, nullptr);
BLI_task_graph_edge_create(tree1_node_a, tree1_node_b);
BLI_task_graph_edge_create(tree1_node_b, tree1_node_c);
BLI_task_graph_edge_create(tree1_node_b, tree1_node_d);
@ -148,12 +148,12 @@ TEST(task, GraphForest)
{
TaskNode *tree2_node_a = BLI_task_graph_node_create(
graph, TaskData_increase_value, &data2, NULL);
TaskNode *tree2_node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data2, NULL);
graph, TaskData_increase_value, &data2, nullptr);
TaskNode *tree2_node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data2, nullptr);
TaskNode *tree2_node_c = BLI_task_graph_node_create(
graph, TaskData_increase_value, &data2, NULL);
graph, TaskData_increase_value, &data2, nullptr);
TaskNode *tree2_node_d = BLI_task_graph_node_create(
graph, TaskData_multiply_by_two_store, &data2, NULL);
graph, TaskData_multiply_by_two_store, &data2, nullptr);
BLI_task_graph_edge_create(tree2_node_a, tree2_node_b);
BLI_task_graph_edge_create(tree2_node_b, tree2_node_c);
BLI_task_graph_edge_create(tree2_node_b, tree2_node_d);
@ -175,7 +175,7 @@ TEST(task, GraphTaskData)
TaskGraph *graph = BLI_task_graph_create();
TaskNode *node_a = BLI_task_graph_node_create(
graph, TaskData_store_value, &data, TaskData_increase_value);
TaskNode *node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data, NULL);
TaskNode *node_b = BLI_task_graph_node_create(graph, TaskData_store_value, &data, nullptr);
BLI_task_graph_edge_create(node_a, node_b);
EXPECT_TRUE(BLI_task_graph_node_push_work(node_a));
BLI_task_graph_work_and_wait(graph);

View File

@ -72,7 +72,7 @@ static void task_mempool_iter_func(void *userdata, MempoolIterData *item)
int *data = (int *)item;
int *count = (int *)userdata;
EXPECT_TRUE(data != NULL);
EXPECT_TRUE(data != nullptr);
*data += 1;
atomic_sub_and_fetch_uint32((uint32_t *)count, 1);
@ -97,12 +97,12 @@ TEST(task, MempoolIter)
for (i = 0; i < NUM_ITEMS; i += 3) {
BLI_mempool_free(mempool, data[i]);
data[i] = NULL;
data[i] = nullptr;
num_items--;
}
for (i = 0; i < NUM_ITEMS; i += 7) {
if (data[i] == NULL) {
if (data[i] == nullptr) {
data[i] = (int *)BLI_mempool_alloc(mempool);
*data[i] = i - 1;
num_items++;
@ -111,9 +111,9 @@ TEST(task, MempoolIter)
for (i = 0; i < NUM_ITEMS - 5; i += 23) {
for (int j = 0; j < 5; j++) {
if (data[i + j] != NULL) {
if (data[i + j] != nullptr) {
BLI_mempool_free(mempool, data[i + j]);
data[i + j] = NULL;
data[i + j] = nullptr;
num_items--;
}
}
@ -125,7 +125,7 @@ TEST(task, MempoolIter)
* expected. */
EXPECT_EQ(num_items, 0);
for (i = 0; i < NUM_ITEMS; i++) {
if (data[i] != NULL) {
if (data[i] != nullptr) {
EXPECT_EQ(*data[i], i);
}
}
@ -150,7 +150,7 @@ static void task_listbase_iter_func(void *userdata,
TEST(task, ListBaseIter)
{
ListBase list = {NULL, NULL};
ListBase list = {nullptr, nullptr};
LinkData *items_buffer = (LinkData *)MEM_calloc_arrayN(
NUM_ITEMS, sizeof(*items_buffer), __func__);
BLI_threadapi_init();
@ -172,7 +172,7 @@ TEST(task, ListBaseIter)
* as expected. */
EXPECT_EQ(num_items, 0);
LinkData *item;
for (i = 0, item = (LinkData *)list.first; i < NUM_ITEMS && item != NULL;
for (i = 0, item = (LinkData *)list.first; i < NUM_ITEMS && item != nullptr;
i++, item = item->next) {
EXPECT_EQ(POINTER_AS_INT(item->data), i);
}

View File

@ -79,11 +79,11 @@ struct TestListValue {
TEST(vector, ListBaseConstructor)
{
TestListValue *value1 = new TestListValue{0, 0, 4};
TestListValue *value2 = new TestListValue{0, 0, 5};
TestListValue *value3 = new TestListValue{0, 0, 6};
TestListValue *value1 = new TestListValue{nullptr, nullptr, 4};
TestListValue *value2 = new TestListValue{nullptr, nullptr, 5};
TestListValue *value3 = new TestListValue{nullptr, nullptr, 6};
ListBase list = {NULL, NULL};
ListBase list = {nullptr, nullptr};
BLI_addtail(&list, value1);
BLI_addtail(&list, value2);
BLI_addtail(&list, value3);

View File

@ -152,7 +152,7 @@ static void str_ghash_tests(GHash *ghash, const char *id)
TIMEIT_END(string_lookup);
}
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
MEM_freeN(data);
MEM_freeN(data_p);
MEM_freeN(data_w);
@ -227,7 +227,7 @@ static void int_ghash_tests(GHash *ghash, const char *id, const unsigned int nbr
}
EXPECT_EQ(BLI_ghash_len(ghash), 0);
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
printf("========== ENDED %s ==========\n\n", id);
}
@ -309,7 +309,7 @@ static void randint_ghash_tests(GHash *ghash, const char *id, const unsigned int
TIMEIT_END(int_lookup);
}
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
MEM_freeN(data);
printf("========== ENDED %s ==========\n\n", id);
@ -421,7 +421,7 @@ static void int4_ghash_tests(GHash *ghash, const char *id, const unsigned int nb
TIMEIT_END(int_v4_lookup);
}
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
MEM_freeN(data);
printf("========== ENDED %s ==========\n\n", id);
@ -506,7 +506,7 @@ static void multi_small_ghash_tests_one(GHash *ghash, RNG *rng, const unsigned i
EXPECT_EQ(POINTER_AS_UINT(v), *dt);
}
BLI_ghash_clear(ghash, NULL, NULL);
BLI_ghash_clear(ghash, nullptr, nullptr);
MEM_freeN(data);
}
@ -538,7 +538,7 @@ static void multi_small_ghash_tests(GHash *ghash, const char *id, const unsigned
TIMEIT_END(multi_small2_ghash);
BLI_ghash_free(ghash, NULL, NULL);
BLI_ghash_free(ghash, nullptr, nullptr);
BLI_rng_free(rng);
printf("========== ENDED %s ==========\n\n", id);

View File

@ -119,7 +119,7 @@ static void task_listbase_test_do(ListBase *list,
}
LinkData *item;
int j;
for (j = 0, item = (LinkData *)list->first; j < num_items && item != NULL;
for (j = 0, item = (LinkData *)list->first; j < num_items && item != nullptr;
j++, item = item->next) {
EXPECT_EQ(POINTER_AS_INT(item->data), j);
item->data = POINTER_FROM_INT(0);
@ -139,7 +139,7 @@ static void task_listbase_test(const char *id, const int nbr, const bool use_thr
{
printf("\n========== STARTING %s ==========\n", id);
ListBase list = {NULL, NULL};
ListBase list = {nullptr, nullptr};
LinkData *items_buffer = (LinkData *)MEM_calloc_arrayN(nbr, sizeof(*items_buffer), __func__);
BLI_threadapi_init();

View File

@ -127,7 +127,7 @@ bool BlendfileLoadingBaseTest::blendfile_load(const char *filepath)
char abspath[FILENAME_MAX];
BLI_path_join(abspath, sizeof(abspath), test_assets_dir.c_str(), filepath, NULL);
bfile = BLO_read_from_file(abspath, BLO_READ_SKIP_NONE, NULL /* reports */);
bfile = BLO_read_from_file(abspath, BLO_READ_SKIP_NONE, nullptr /* reports */);
if (bfile == nullptr) {
ADD_FAILURE() << "Unable to load file '" << filepath << "' from test assets dir '"
<< test_assets_dir << "'";
@ -144,7 +144,7 @@ void BlendfileLoadingBaseTest::blendfile_free()
wmWindowManager *wm = static_cast<wmWindowManager *>(bfile->main->wm.first);
if (wm != nullptr) {
wm_close_and_free(NULL, wm);
wm_close_and_free(nullptr, wm);
}
BLO_blendfiledata_free(bfile);
bfile = nullptr;

View File

@ -16,8 +16,8 @@ TEST(bmesh_core, BMVertCreate)
EXPECT_EQ(bm->totvert, 0);
/* make a custom layer so we can see if it is copied properly */
BM_data_layer_add(bm, &bm->vdata, CD_PROP_FLOAT);
bv1 = BM_vert_create(bm, co1, NULL, BM_CREATE_NOP);
ASSERT_TRUE(bv1 != NULL);
bv1 = BM_vert_create(bm, co1, nullptr, BM_CREATE_NOP);
ASSERT_TRUE(bv1 != nullptr);
EXPECT_EQ(bv1->co[0], 1.0f);
EXPECT_EQ(bv1->co[1], 2.0f);
EXPECT_EQ(bv1->co[2], 0.0f);
@ -25,14 +25,14 @@ TEST(bmesh_core, BMVertCreate)
EXPECT_EQ(bv1->head.htype, (char)BM_VERT);
EXPECT_EQ(bv1->head.hflag, 0);
EXPECT_EQ(bv1->head.api_flag, 0);
bv2 = BM_vert_create(bm, NULL, NULL, BM_CREATE_NOP);
ASSERT_TRUE(bv2 != NULL);
bv2 = BM_vert_create(bm, nullptr, nullptr, BM_CREATE_NOP);
ASSERT_TRUE(bv2 != nullptr);
EXPECT_TRUE(is_zero_v3(bv2->co));
/* create with example should copy custom data but not select flag */
BM_vert_select_set(bm, bv2, true);
BM_elem_float_data_set(&bm->vdata, bv2, CD_PROP_FLOAT, 1.5f);
bv3 = BM_vert_create(bm, co1, bv2, BM_CREATE_NOP);
ASSERT_TRUE(bv3 != NULL);
ASSERT_TRUE(bv3 != nullptr);
EXPECT_FALSE(BM_elem_flag_test((BMElem *)bv3, BM_ELEM_SELECT));
EXPECT_EQ(BM_elem_float_data_get(&bm->vdata, bv3, CD_PROP_FLOAT), 1.5f);
EXPECT_EQ(BM_mesh_elem_count(bm, BM_VERT), 3);

View File

@ -121,7 +121,7 @@ static bool face_has_verts_in_order(BMesh *bm, BMFace *bmf, const BMVert *v1, co
{
BMIter liter;
BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf));
while (l != NULL) {
while (l != nullptr) {
if (l->v == v1 && l->next->v == v2) {
return true;
}
@ -184,7 +184,7 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
for (int i = 0; i < 3; ++i) {
co[i] = static_cast<float>(d_co[i]);
}
BMVert *bmv = BM_vert_create(bm, co, NULL, BM_CREATE_NOP);
BMVert *bmv = BM_vert_create(bm, co, nullptr, BM_CREATE_NOP);
new_bmvs[v] = bmv;
BM_elem_flag_enable(bmv, KEEP_FLAG);
any_change = true;
@ -231,7 +231,7 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
BMFace *bmf = BM_face_exists(face_bmverts.data(), flen);
/* #BM_face_exists checks if the face exists with the vertices in either order.
* We can only reuse the face if the orientations are the same. */
if (bmf != NULL && face_has_verts_in_order(bm, bmf, face_bmverts[0], face_bmverts[1])) {
if (bmf != nullptr && face_has_verts_in_order(bm, bmf, face_bmverts[0], face_bmverts[1])) {
BM_elem_flag_enable(bmf, KEEP_FLAG);
}
else {
@ -242,20 +242,20 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
orig_face = old_bmfs[orig];
}
else {
orig_face = NULL;
orig_face = nullptr;
}
/* Make or find #BMEdge's. */
for (int i = 0; i < flen; ++i) {
BMVert *bmv1 = face_bmverts[i];
BMVert *bmv2 = face_bmverts[(i + 1) % flen];
BMEdge *bme = BM_edge_exists(bmv1, bmv2);
if (bme == NULL) {
BMEdge *orig_edge = NULL;
if (bme == nullptr) {
BMEdge *orig_edge = nullptr;
if (face.edge_orig[i] != NO_INDEX) {
orig_edge = old_edges[face.edge_orig[i]];
}
bme = BM_edge_create(bm, bmv1, bmv2, orig_edge, BM_CREATE_NOP);
if (orig_edge != NULL) {
if (orig_edge != nullptr) {
BM_elem_select_copy(bm, bme, orig_edge);
}
}
@ -269,15 +269,15 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
}
BMFace *bmf = BM_face_create(
bm, face_bmverts.data(), face_bmedges.data(), flen, orig_face, BM_CREATE_NOP);
if (orig_face != NULL) {
if (orig_face != nullptr) {
BM_elem_select_copy(bm, bmf, orig_face);
}
BM_elem_flag_enable(bmf, KEEP_FLAG);
/* Now do interpolation of loop data (e.g., UV's) using the example face. */
if (orig_face != NULL) {
if (orig_face != nullptr) {
BMIter liter;
BMLoop *l = static_cast<BMLoop *>(BM_iter_new(&liter, bm, BM_LOOPS_OF_FACE, bmf));
while (l != NULL) {
while (l != nullptr) {
BM_loop_interp_from_face(bm, l, orig_face, true, true);
l = static_cast<BMLoop *>(BM_iter_step(&liter));
}
@ -290,8 +290,8 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
/* #BM_ITER_MESH_MUTABLE macro needs type casts for C++, so expand here.
* TODO(howard): make some nice C++ iterators for #BMesh. */
BMIter iter;
BMFace *bmf = static_cast<BMFace *>(BM_iter_new(&iter, bm, BM_FACES_OF_MESH, NULL));
while (bmf != NULL) {
BMFace *bmf = static_cast<BMFace *>(BM_iter_new(&iter, bm, BM_FACES_OF_MESH, nullptr));
while (bmf != nullptr) {
# ifdef DEBUG
iter.count = BM_iter_mesh_count(BM_FACES_OF_MESH, bm);
# endif
@ -308,8 +308,8 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out)
}
bmf = bmf_next;
}
BMVert *bmv = static_cast<BMVert *>(BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, NULL));
while (bmv != NULL) {
BMVert *bmv = static_cast<BMVert *>(BM_iter_new(&iter, bm, BM_VERTS_OF_MESH, nullptr));
while (bmv != nullptr) {
# ifdef DEBUG
iter.count = BM_iter_mesh_count(BM_VERTS_OF_MESH, bm);
# endif

View File

@ -32,5 +32,5 @@ void CPUDevice::execute(WorkPackage *work)
executionGroup->getOutputOperation()->executeRegion(&rect, chunkNumber);
executionGroup->finalizeChunkExecution(chunkNumber, NULL);
executionGroup->finalizeChunkExecution(chunkNumber, nullptr);
}

View File

@ -22,13 +22,13 @@
CompositorContext::CompositorContext()
{
this->m_scene = NULL;
this->m_rd = NULL;
this->m_scene = nullptr;
this->m_rd = nullptr;
this->m_quality = COM_QUALITY_HIGH;
this->m_hasActiveOpenCLDevices = false;
this->m_fastCalculation = false;
this->m_viewSettings = NULL;
this->m_displaySettings = NULL;
this->m_viewSettings = nullptr;
this->m_displaySettings = nullptr;
}
int CompositorContext::getFramenumber() const

View File

@ -133,11 +133,11 @@ bool Converter::is_fast_node(bNode *b_node)
Node *Converter::convert(bNode *b_node)
{
Node *node = NULL;
Node *node = nullptr;
/* ignore undefined nodes with missing or invalid node data */
if (!nodeIsRegistered(b_node)) {
return NULL;
return nullptr;
}
switch (b_node->type) {
@ -439,7 +439,7 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
return new ConvertVectorToColorOperation();
}
return NULL;
return nullptr;
}
void Converter::convertResolution(NodeOperationBuilder &builder,
@ -498,8 +498,8 @@ void Converter::convertResolution(NodeOperationBuilder &builder,
}
if (doCenter) {
NodeOperation *first = NULL;
ScaleOperation *scaleOperation = NULL;
NodeOperation *first = nullptr;
ScaleOperation *scaleOperation = nullptr;
if (doScale) {
scaleOperation = new ScaleOperation();
scaleOperation->getInputSocket(1)->setResizeMode(COM_SC_NO_RESIZE);

View File

@ -45,8 +45,8 @@ ExecutionGroup::ExecutionGroup()
{
this->m_isOutput = false;
this->m_complex = false;
this->m_chunkExecutionStates = NULL;
this->m_bTree = NULL;
this->m_chunkExecutionStates = nullptr;
this->m_bTree = nullptr;
this->m_height = 0;
this->m_width = 0;
this->m_cachedMaxReadBufferOffset = 0;
@ -121,13 +121,13 @@ NodeOperation *ExecutionGroup::getOutputOperation() const
void ExecutionGroup::initExecution()
{
if (this->m_chunkExecutionStates != NULL) {
if (this->m_chunkExecutionStates != nullptr) {
MEM_freeN(this->m_chunkExecutionStates);
}
unsigned int index;
determineNumberOfChunks();
this->m_chunkExecutionStates = NULL;
this->m_chunkExecutionStates = nullptr;
if (this->m_numberOfChunks != 0) {
this->m_chunkExecutionStates = (ChunkExecutionState *)MEM_mallocN(
sizeof(ChunkExecutionState) * this->m_numberOfChunks, __func__);
@ -152,15 +152,15 @@ void ExecutionGroup::initExecution()
void ExecutionGroup::deinitExecution()
{
if (this->m_chunkExecutionStates != NULL) {
if (this->m_chunkExecutionStates != nullptr) {
MEM_freeN(this->m_chunkExecutionStates);
this->m_chunkExecutionStates = NULL;
this->m_chunkExecutionStates = nullptr;
}
this->m_numberOfChunks = 0;
this->m_numberOfXChunks = 0;
this->m_numberOfYChunks = 0;
this->m_cachedReadOperations.clear();
this->m_bTree = NULL;
this->m_bTree = nullptr;
}
void ExecutionGroup::determineResolution(unsigned int resolution[2])
{
@ -415,7 +415,7 @@ void ExecutionGroup::finalizeChunkExecution(int chunkNumber, MemoryBuffer **memo
MemoryBuffer *buffer = memoryBuffers[index];
if (buffer) {
if (buffer->isTemporarily()) {
memoryBuffers[index] = NULL;
memoryBuffers[index] = nullptr;
delete buffer;
}
}
@ -478,7 +478,7 @@ MemoryBuffer *ExecutionGroup::allocateOutputBuffer(int /*chunkNumber*/, rcti *re
MemoryBuffer *buffer = new MemoryBuffer(writeOperation->getMemoryProxy(), rect);
return buffer;
}
return NULL;
return nullptr;
}
bool ExecutionGroup::scheduleAreaWhenPossible(ExecutionSystem *graph, rcti *area)
@ -562,7 +562,7 @@ bool ExecutionGroup::scheduleChunkWhenPossible(ExecutionSystem *graph, int xChun
determineDependingAreaOfInterest(&rect, readOperation, &area);
ExecutionGroup *group = memoryProxy->getExecutor();
if (group != NULL) {
if (group != nullptr) {
if (!group->scheduleAreaWhenPossible(graph, &area)) {
canBeExecuted = false;
}

View File

@ -83,7 +83,7 @@ MemoryBuffer::MemoryBuffer(DataType dataType, rcti *rect)
this->m_width = BLI_rcti_size_x(&this->m_rect);
this->m_height = BLI_rcti_size_y(&this->m_rect);
this->m_height = this->m_rect.ymax - this->m_rect.ymin;
this->m_memoryProxy = NULL;
this->m_memoryProxy = nullptr;
this->m_chunkNumber = -1;
this->m_num_channels = determine_num_channels(dataType);
this->m_buffer = (float *)MEM_mallocN_aligned(
@ -145,7 +145,7 @@ MemoryBuffer::~MemoryBuffer()
{
if (this->m_buffer) {
MEM_freeN(this->m_buffer);
this->m_buffer = NULL;
this->m_buffer = nullptr;
}
}

View File

@ -20,8 +20,8 @@
MemoryProxy::MemoryProxy(DataType datatype)
{
this->m_writeBufferOperation = NULL;
this->m_executor = NULL;
this->m_writeBufferOperation = nullptr;
this->m_executor = nullptr;
this->m_datatype = datatype;
}
@ -40,6 +40,6 @@ void MemoryProxy::free()
{
if (this->m_buffer) {
delete this->m_buffer;
this->m_buffer = NULL;
this->m_buffer = nullptr;
}
}

View File

@ -37,14 +37,14 @@
**************/
Node::Node(bNode *editorNode, bool create_sockets)
: m_editorNodeTree(NULL),
: m_editorNodeTree(nullptr),
m_editorNode(editorNode),
m_inActiveGroup(false),
m_instanceKey(NODE_INSTANCE_KEY_NONE)
{
if (create_sockets) {
bNodeSocket *input = (bNodeSocket *)editorNode->inputs.first;
while (input != NULL) {
while (input != nullptr) {
DataType dt = COM_DT_VALUE;
if (input->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
@ -57,7 +57,7 @@ Node::Node(bNode *editorNode, bool create_sockets)
input = input->next;
}
bNodeSocket *output = (bNodeSocket *)editorNode->outputs.first;
while (output != NULL) {
while (output != nullptr) {
DataType dt = COM_DT_VALUE;
if (output->type == SOCK_RGBA) {
dt = COM_DT_COLOR;
@ -86,7 +86,7 @@ Node::~Node()
void Node::addInputSocket(DataType datatype)
{
this->addInputSocket(datatype, NULL);
this->addInputSocket(datatype, nullptr);
}
void Node::addInputSocket(DataType datatype, bNodeSocket *bSocket)
@ -97,7 +97,7 @@ void Node::addInputSocket(DataType datatype, bNodeSocket *bSocket)
void Node::addOutputSocket(DataType datatype)
{
this->addOutputSocket(datatype, NULL);
this->addOutputSocket(datatype, nullptr);
}
void Node::addOutputSocket(DataType datatype, bNodeSocket *bSocket)
{
@ -121,27 +121,27 @@ bNodeSocket *Node::getEditorInputSocket(int editorNodeInputSocketIndex)
{
bNodeSocket *bSock = (bNodeSocket *)this->getbNode()->inputs.first;
int index = 0;
while (bSock != NULL) {
while (bSock != nullptr) {
if (index == editorNodeInputSocketIndex) {
return bSock;
}
index++;
bSock = bSock->next;
}
return NULL;
return nullptr;
}
bNodeSocket *Node::getEditorOutputSocket(int editorNodeOutputSocketIndex)
{
bNodeSocket *bSock = (bNodeSocket *)this->getbNode()->outputs.first;
int index = 0;
while (bSock != NULL) {
while (bSock != nullptr) {
if (index == editorNodeOutputSocketIndex) {
return bSock;
}
index++;
bSock = bSock->next;
}
return NULL;
return nullptr;
}
/*******************
@ -149,7 +149,7 @@ bNodeSocket *Node::getEditorOutputSocket(int editorNodeOutputSocketIndex)
*******************/
NodeInput::NodeInput(Node *node, bNodeSocket *b_socket, DataType datatype)
: m_node(node), m_editorSocket(b_socket), m_datatype(datatype), m_link(NULL)
: m_node(node), m_editorSocket(b_socket), m_datatype(datatype), m_link(nullptr)
{
}

View File

@ -61,7 +61,7 @@ bNodeSocket *NodeGraph::find_b_node_input(bNode *b_node, const char *identifier)
return b_sock;
}
}
return NULL;
return nullptr;
}
bNodeSocket *NodeGraph::find_b_node_output(bNode *b_node, const char *identifier)
@ -71,7 +71,7 @@ bNodeSocket *NodeGraph::find_b_node_output(bNode *b_node, const char *identifier
return b_sock;
}
}
return NULL;
return nullptr;
}
void NodeGraph::add_node(Node *node,
@ -179,7 +179,7 @@ NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_s
}
}
}
return NULL;
return nullptr;
}
void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink)

View File

@ -36,7 +36,7 @@ NodeOperation::NodeOperation()
this->m_height = 0;
this->m_isResolutionSet = false;
this->m_openCL = false;
this->m_btree = NULL;
this->m_btree = nullptr;
}
NodeOperation::~NodeOperation()
@ -146,7 +146,7 @@ NodeOperation *NodeOperation::getInputOperation(unsigned int inputSocketIndex)
return &input->getLink()->getOperation();
}
return NULL;
return nullptr;
}
void NodeOperation::getConnectedInputSockets(Inputs *sockets)
@ -199,7 +199,7 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input,
NodeOperationInput::NodeOperationInput(NodeOperation *op,
DataType datatype,
InputResizeMode resizeMode)
: m_operation(op), m_datatype(datatype), m_resizeMode(resizeMode), m_link(NULL)
: m_operation(op), m_datatype(datatype), m_resizeMode(resizeMode), m_link(nullptr)
{
}
@ -209,7 +209,7 @@ SocketReader *NodeOperationInput::getReader()
return &m_link->getOperation();
}
return NULL;
return nullptr;
}
void NodeOperationInput::determineResolution(unsigned int resolution[2],

View File

@ -38,7 +38,7 @@
#include "COM_NodeOperationBuilder.h" /* own include */
NodeOperationBuilder::NodeOperationBuilder(const CompositorContext *context, bNodeTree *b_nodetree)
: m_context(context), m_current_node(NULL), m_active_viewer(NULL)
: m_context(context), m_current_node(nullptr), m_active_viewer(nullptr)
{
m_graph.from_bNodeTree(*context, b_nodetree);
}
@ -61,7 +61,7 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
node->convertToOperations(converter, *m_context);
}
m_current_node = NULL;
m_current_node = nullptr;
/* The input map constructed by nodes maps operation inputs to node inputs.
* Inverting yields a map of node inputs to all connected operation inputs,
@ -168,7 +168,7 @@ void NodeOperationBuilder::removeInputLink(NodeOperationInput *to)
Link &link = *it;
if (link.to() == to) {
/* unregister with the input */
to->setLink(NULL);
to->setLink(nullptr);
m_links.erase(it);
return;
@ -203,15 +203,15 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const
BLI_assert(m_current_node);
if (!(m_current_node->getbNode()->flag & NODE_PREVIEW)) {
return NULL;
return nullptr;
}
/* previews only in the active group */
if (!m_current_node->isInActiveGroup()) {
return NULL;
return nullptr;
}
/* do not calculate previews of hidden nodes */
if (m_current_node->getbNode()->flag & NODE_HIDDEN) {
return NULL;
return nullptr;
}
bNodeInstanceHash *previews = m_context->getPreviewHash();
@ -223,7 +223,7 @@ PreviewOperation *NodeOperationBuilder::make_preview_operation() const
return operation;
}
return NULL;
return nullptr;
}
void NodeOperationBuilder::addPreview(NodeOperationOutput *output)
@ -476,7 +476,7 @@ WriteBufferOperation *NodeOperationBuilder::find_attached_write_buffer_operation
}
}
}
return NULL;
return nullptr;
}
void NodeOperationBuilder::add_input_buffers(NodeOperation * /*operation*/,
@ -526,13 +526,13 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
return;
}
WriteBufferOperation *writeOperation = NULL;
WriteBufferOperation *writeOperation = nullptr;
for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
NodeOperationInput *target = *it;
/* try to find existing write buffer operation */
if (target->getOperation().isWriteBufferOperation()) {
BLI_assert(writeOperation == NULL); /* there should only be one write op connected */
BLI_assert(writeOperation == nullptr); /* there should only be one write op connected */
writeOperation = (WriteBufferOperation *)(&target->getOperation());
}
else {
@ -728,7 +728,7 @@ void NodeOperationBuilder::group_operations()
ReadBufferOperation *read_op = (ReadBufferOperation *)op;
MemoryProxy *memproxy = read_op->getMemoryProxy();
if (memproxy->getExecutor() == NULL) {
if (memproxy->getExecutor() == nullptr) {
ExecutionGroup *group = make_group(memproxy->getWriteBufferOperation());
memproxy->setExecutor(group);
}

View File

@ -41,7 +41,7 @@ OpenCLDevice::OpenCLDevice(cl_context context,
this->m_device = device;
this->m_context = context;
this->m_program = program;
this->m_queue = NULL;
this->m_queue = nullptr;
this->m_vendorID = vendorId;
}
@ -196,7 +196,7 @@ void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel, MemoryBuffer *outputMemo
(size_t)outputMemoryBuffer->getHeight(),
};
error = clEnqueueNDRangeKernel(this->m_queue, kernel, 2, NULL, size, 0, 0, 0, NULL);
error = clEnqueueNDRangeKernel(this->m_queue, kernel, 2, nullptr, size, nullptr, 0, nullptr, nullptr);
if (error != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}
@ -243,7 +243,7 @@ void OpenCLDevice::COM_clEnqueueRange(cl_kernel kernel,
if (error != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}
error = clEnqueueNDRangeKernel(this->m_queue, kernel, 2, NULL, size, 0, 0, 0, NULL);
error = clEnqueueNDRangeKernel(this->m_queue, kernel, 2, nullptr, size, nullptr, 0, nullptr, nullptr);
if (error != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}

View File

@ -20,7 +20,7 @@
SingleThreadedOperation::SingleThreadedOperation()
{
this->m_cachedInstance = NULL;
this->m_cachedInstance = nullptr;
setComplex(true);
}
@ -39,7 +39,7 @@ void SingleThreadedOperation::deinitExecution()
deinitMutex();
if (this->m_cachedInstance) {
delete this->m_cachedInstance;
this->m_cachedInstance = NULL;
this->m_cachedInstance = nullptr;
}
}
void *SingleThreadedOperation::initializeTileData(rcti *rect)
@ -49,7 +49,7 @@ void *SingleThreadedOperation::initializeTileData(rcti *rect)
}
lockMutex();
if (this->m_cachedInstance == NULL) {
if (this->m_cachedInstance == nullptr) {
//
this->m_cachedInstance = createMemoryBuffer(rect);
}

View File

@ -80,7 +80,7 @@ void *WorkScheduler::thread_execute_cpu(void *data)
delete work;
}
return NULL;
return nullptr;
}
void *WorkScheduler::thread_execute_gpu(void *data)
@ -93,7 +93,7 @@ void *WorkScheduler::thread_execute_gpu(void *data)
delete work;
}
return NULL;
return nullptr;
}
#endif
@ -166,13 +166,13 @@ void WorkScheduler::stop()
BLI_thread_queue_nowait(g_cpuqueue);
BLI_threadpool_end(&g_cputhreads);
BLI_thread_queue_free(g_cpuqueue);
g_cpuqueue = NULL;
g_cpuqueue = nullptr;
# ifdef COM_OPENCL_ENABLED
if (g_openclActive) {
BLI_thread_queue_nowait(g_gpuqueue);
BLI_threadpool_end(&g_gputhreads);
BLI_thread_queue_free(g_gpuqueue);
g_gpuqueue = NULL;
g_gpuqueue = nullptr;
}
# endif
#endif
@ -234,8 +234,8 @@ void WorkScheduler::initialize(bool use_opencl, int num_cpu_threads)
# ifdef COM_OPENCL_ENABLED
/* deinitialize OpenCL GPU's */
if (use_opencl && !g_openclInitialized) {
g_context = NULL;
g_program = NULL;
g_context = nullptr;
g_program = nullptr;
/* This will check for errors and skip if already initialized. */
if (clewInit() != CLEW_SUCCESS) {
@ -245,7 +245,7 @@ void WorkScheduler::initialize(bool use_opencl, int num_cpu_threads)
if (clCreateContextFromType) {
cl_uint numberOfPlatforms = 0;
cl_int error;
error = clGetPlatformIDs(0, 0, &numberOfPlatforms);
error = clGetPlatformIDs(0, nullptr, &numberOfPlatforms);
if (error == -1001) {
} /* GPU not supported */
else if (error != CL_SUCCESS) {
@ -256,40 +256,40 @@ void WorkScheduler::initialize(bool use_opencl, int num_cpu_threads)
}
cl_platform_id *platforms = (cl_platform_id *)MEM_mallocN(
sizeof(cl_platform_id) * numberOfPlatforms, __func__);
error = clGetPlatformIDs(numberOfPlatforms, platforms, 0);
error = clGetPlatformIDs(numberOfPlatforms, platforms, nullptr);
unsigned int indexPlatform;
for (indexPlatform = 0; indexPlatform < numberOfPlatforms; indexPlatform++) {
cl_platform_id platform = platforms[indexPlatform];
cl_uint numberOfDevices = 0;
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, 0, &numberOfDevices);
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, nullptr, &numberOfDevices);
if (numberOfDevices <= 0) {
continue;
}
cl_device_id *cldevices = (cl_device_id *)MEM_mallocN(
sizeof(cl_device_id) * numberOfDevices, __func__);
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices, 0);
clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, numberOfDevices, cldevices, nullptr);
g_context = clCreateContext(
NULL, numberOfDevices, cldevices, clContextError, NULL, &error);
nullptr, numberOfDevices, cldevices, clContextError, nullptr, &error);
if (error != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}
const char *cl_str[2] = {datatoc_COM_OpenCLKernels_cl, NULL};
g_program = clCreateProgramWithSource(g_context, 1, cl_str, 0, &error);
error = clBuildProgram(g_program, numberOfDevices, cldevices, 0, 0, 0);
const char *cl_str[2] = {datatoc_COM_OpenCLKernels_cl, nullptr};
g_program = clCreateProgramWithSource(g_context, 1, cl_str, nullptr, &error);
error = clBuildProgram(g_program, numberOfDevices, cldevices, nullptr, nullptr, nullptr);
if (error != CL_SUCCESS) {
cl_int error2;
size_t ret_val_size = 0;
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
error2 = clGetProgramBuildInfo(
g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, NULL, &ret_val_size);
g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, 0, nullptr, &ret_val_size);
if (error2 != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}
char *build_log = (char *)MEM_mallocN(sizeof(char) * ret_val_size + 1, __func__);
error2 = clGetProgramBuildInfo(
g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, NULL);
g_program, cldevices[0], CL_PROGRAM_BUILD_LOG, ret_val_size, build_log, nullptr);
if (error2 != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error, clewErrorString(error));
}
@ -303,7 +303,7 @@ void WorkScheduler::initialize(bool use_opencl, int num_cpu_threads)
cl_device_id device = cldevices[indexDevices];
cl_int vendorID = 0;
cl_int error2 = clGetDeviceInfo(
device, CL_DEVICE_VENDOR_ID, sizeof(cl_int), &vendorID, NULL);
device, CL_DEVICE_VENDOR_ID, sizeof(cl_int), &vendorID, nullptr);
if (error2 != CL_SUCCESS) {
printf("CLERROR[%d]: %s\n", error2, clewErrorString(error2));
}
@ -351,11 +351,11 @@ void WorkScheduler::deinitialize()
}
if (g_program) {
clReleaseProgram(g_program);
g_program = NULL;
g_program = nullptr;
}
if (g_context) {
clReleaseContext(g_context);
g_context = NULL;
g_context = nullptr;
}
g_openclInitialized = false;

View File

@ -46,7 +46,7 @@ void BlurNode::convertToOperations(NodeConverter &converter,
const bool extend_bounds = (editorNode->custom1 & CMP_NODEFLAG_BLUR_EXTEND_BOUNDS) != 0;
CompositorQuality quality = context.getQuality();
NodeOperation *input_operation = NULL, *output_operation = NULL;
NodeOperation *input_operation = nullptr, *output_operation = nullptr;
if (data->filtertype == R_FILTER_FAST_GAUSS) {
FastGaussianBlurOperation *operationfgb = new FastGaussianBlurOperation();

View File

@ -36,7 +36,7 @@ void ChannelMatteNode::convertToOperations(NodeConverter &converter,
NodeOutput *outputSocketImage = this->getOutputSocket(0);
NodeOutput *outputSocketMatte = this->getOutputSocket(1);
NodeOperation *convert = NULL, *inv_convert = NULL;
NodeOperation *convert = nullptr, *inv_convert = nullptr;
/* colorspace */
switch (node->custom1) {
case CMP_NODE_CHANNEL_MATTE_CS_RGB:
@ -67,7 +67,7 @@ void ChannelMatteNode::convertToOperations(NodeConverter &converter,
SetAlphaOperation *operationAlpha = new SetAlphaOperation();
converter.addOperation(operationAlpha);
if (convert != NULL) {
if (convert != nullptr) {
converter.addOperation(convert);
converter.mapInputSocket(inputSocketImage, convert->getInputSocket(0));
@ -82,7 +82,7 @@ void ChannelMatteNode::convertToOperations(NodeConverter &converter,
converter.mapOutputSocket(outputSocketMatte, operation->getOutputSocket(0));
converter.addLink(operation->getOutputSocket(), operationAlpha->getInputSocket(1));
if (inv_convert != NULL) {
if (inv_convert != nullptr) {
converter.addOperation(inv_convert);
converter.addLink(operationAlpha->getOutputSocket(0), inv_convert->getInputSocket(0));
converter.mapOutputSocket(outputSocketImage, inv_convert->getOutputSocket());

View File

@ -67,7 +67,7 @@ void CombineColorNode::convertToOperations(NodeConverter &converter,
NodeOperation *CombineRGBANode::getColorConverter(const CompositorContext & /*context*/) const
{
return NULL; /* no conversion needed */
return nullptr; /* no conversion needed */
}
NodeOperation *CombineHSVANode::getColorConverter(const CompositorContext & /*context*/) const

View File

@ -23,7 +23,7 @@
void ConvertAlphaNode::convertToOperations(NodeConverter &converter,
const CompositorContext & /*context*/) const
{
NodeOperation *operation = NULL;
NodeOperation *operation = nullptr;
bNode *node = this->getbNode();
/* value hardcoded in rna_nodetree.c */

View File

@ -41,7 +41,7 @@ void DefocusNode::convertToOperations(NodeConverter &converter,
bNode *node = this->getbNode();
NodeDefocus *data = (NodeDefocus *)node->storage;
Scene *scene = node->id ? (Scene *)node->id : context.getScene();
Object *camob = scene ? scene->camera : NULL;
Object *camob = scene ? scene->camera : nullptr;
NodeOperation *radiusOperation;
if (data->no_zbuf) {

View File

@ -34,7 +34,7 @@ void FilterNode::convertToOperations(NodeConverter &converter,
NodeInput *inputSocket = this->getInputSocket(0);
NodeInput *inputImageSocket = this->getInputSocket(1);
NodeOutput *outputSocket = this->getOutputSocket(0);
ConvolutionFilterOperation *operation = NULL;
ConvolutionFilterOperation *operation = nullptr;
switch (this->getbNode()->custom1) {
case CMP_FILT_SOFT:

View File

@ -38,7 +38,7 @@ void GlareNode::convertToOperations(NodeConverter &converter,
bNode *node = this->getbNode();
NodeGlare *glare = (NodeGlare *)node->storage;
GlareBaseOperation *glareoperation = NULL;
GlareBaseOperation *glareoperation = nullptr;
switch (glare->type) {
default:
case 3:

View File

@ -44,7 +44,7 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter,
DataType datatype) const
{
NodeOutput *outputSocket = this->getOutputSocket(outputsocketIndex);
MultilayerBaseOperation *operation = NULL;
MultilayerBaseOperation *operation = nullptr;
switch (datatype) {
case COM_DT_VALUE:
operation = new MultilayerValueOperation(passindex, view);
@ -84,7 +84,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
/* force a load, we assume iuser index will be set OK anyway */
if (image && image->type == IMA_TYPE_MULTILAYER) {
bool is_multilayer_ok = false;
ImBuf *ibuf = BKE_image_acquire_ibuf(image, imageuser, NULL);
ImBuf *ibuf = BKE_image_acquire_ibuf(image, imageuser, nullptr);
if (image->rr) {
RenderLayer *rl = (RenderLayer *)BLI_findlink(&image->rr->layers, imageuser->layer);
if (rl) {
@ -94,7 +94,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
is_multilayer_ok = true;
for (index = 0; index < numberOfOutputs; index++) {
NodeOperation *operation = NULL;
NodeOperation *operation = nullptr;
socket = this->getOutputSocket(index);
bNodeSocket *bnodeSocket = socket->getbNodeSocket();
NodeImageLayer *storage = (NodeImageLayer *)bnodeSocket->storage;
@ -196,13 +196,13 @@ void ImageNode::convertToOperations(NodeConverter &converter,
}
/* In case we can't load the layer. */
if (operation == NULL) {
if (operation == nullptr) {
converter.setInvalidOutput(getOutputSocket(index));
}
}
}
}
BKE_image_release_ibuf(image, ibuf, NULL);
BKE_image_release_ibuf(image, ibuf, nullptr);
/* without this, multilayer that fail to load will crash blender T32490. */
if (is_multilayer_ok == false) {
@ -263,7 +263,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
/* happens when unlinking image datablock from multilayer node */
for (int i = 3; i < numberOfOutputs; i++) {
NodeOutput *output = this->getOutputSocket(i);
NodeOperation *operation = NULL;
NodeOperation *operation = nullptr;
switch (output->getDataType()) {
case COM_DT_VALUE: {
SetValueOperation *valueoperation = new SetValueOperation();

View File

@ -228,7 +228,7 @@ void KeyingNode::convertToOperations(NodeConverter &converter,
NodeOutput *outputImage = this->getOutputSocket(0);
NodeOutput *outputMatte = this->getOutputSocket(1);
NodeOutput *outputEdges = this->getOutputSocket(2);
NodeOperationOutput *postprocessedMatte = NULL, *postprocessedImage = NULL, *edgesMatte = NULL;
NodeOperationOutput *postprocessedMatte = nullptr, *postprocessedImage = nullptr, *edgesMatte = nullptr;
/* keying operation */
KeyingOperation *keyingOperation = new KeyingOperation();

View File

@ -23,7 +23,7 @@
void MathNode::convertToOperations(NodeConverter &converter,
const CompositorContext & /*context*/) const
{
MathBaseOperation *operation = NULL;
MathBaseOperation *operation = nullptr;
switch (this->getbNode()->custom1) {
case NODE_MATH_ADD:

View File

@ -49,7 +49,7 @@ void MovieClipNode::convertToOperations(NodeConverter &converter,
MovieClipUser *movieClipUser = (MovieClipUser *)editorNode->storage;
bool cacheFrame = !context.isRendering();
ImBuf *ibuf = NULL;
ImBuf *ibuf = nullptr;
if (movieClip) {
if (cacheFrame) {
ibuf = BKE_movieclip_get_ibuf(movieClip, movieClipUser);

View File

@ -100,7 +100,7 @@ void OutputFileNode::convertToOperations(NodeConverter &converter,
/* combine file path for the input */
BLI_join_dirfile(path, FILE_MAX, storage->base_path, sockdata->path);
NodeOperation *outputOperation = NULL;
NodeOperation *outputOperation = nullptr;
if (is_multiview && format->views_format == R_IMF_VIEWS_MULTIVIEW) {
outputOperation = new OutputOpenExrSingleLayerMultiViewOperation(

View File

@ -58,17 +58,17 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter,
Scene *scene = (Scene *)this->getbNode()->id;
const short layerId = this->getbNode()->custom1;
RenderResult *rr = RE_AcquireResultRead(re);
if (rr == NULL) {
if (rr == nullptr) {
missingRenderLink(converter);
return;
}
ViewLayer *view_layer = (ViewLayer *)BLI_findlink(&scene->view_layers, layerId);
if (view_layer == NULL) {
if (view_layer == nullptr) {
missingRenderLink(converter);
return;
}
RenderLayer *rl = RE_GetRenderLayer(rr, view_layer->name);
if (rl == NULL) {
if (rl == nullptr) {
missingRenderLink(converter);
return;
}
@ -78,7 +78,7 @@ void RenderLayersNode::testRenderLink(NodeConverter &converter,
NodeImageLayer *storage = (NodeImageLayer *)output->getbNodeSocket()->storage;
RenderPass *rpass = (RenderPass *)BLI_findstring(
&rl->passes, storage->pass_name, offsetof(RenderPass, name));
if (rpass == NULL) {
if (rpass == nullptr) {
missingSocketLink(converter, output);
continue;
}
@ -164,9 +164,9 @@ void RenderLayersNode::convertToOperations(NodeConverter &converter,
const CompositorContext &context) const
{
Scene *scene = (Scene *)this->getbNode()->id;
Render *re = (scene) ? RE_GetSceneRender(scene) : NULL;
Render *re = (scene) ? RE_GetSceneRender(scene) : nullptr;
if (re != NULL) {
if (re != nullptr) {
testRenderLink(converter, context, re);
RE_ReleaseResult(re);
}

View File

@ -99,7 +99,7 @@ void SeparateColorNode::convertToOperations(NodeConverter &converter,
NodeOperation *SeparateRGBANode::getColorConverter(const CompositorContext & /*context*/) const
{
return NULL; /* no conversion needed */
return nullptr; /* no conversion needed */
}
NodeOperation *SeparateHSVANode::getColorConverter(const CompositorContext & /*context*/) const

View File

@ -32,7 +32,7 @@ void ZCombineNode::convertToOperations(NodeConverter &converter,
const CompositorContext &context) const
{
if ((context.getRenderData()->scemode & R_FULL_SAMPLE) || this->getbNode()->custom2) {
ZCombineOperation *operation = NULL;
ZCombineOperation *operation = nullptr;
if (this->getbNode()->custom1) {
operation = new ZCombineAlphaOperation();
}

View File

@ -116,7 +116,7 @@ AntiAliasOperation::AntiAliasOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->m_valueReader = NULL;
this->m_valueReader = nullptr;
this->setComplex(true);
}
@ -179,7 +179,7 @@ void AntiAliasOperation::executePixel(float output[4], int x, int y, void *data)
void AntiAliasOperation::deinitExecution()
{
this->m_valueReader = NULL;
this->m_valueReader = nullptr;
}
bool AntiAliasOperation::determineDependingAreaOfInterest(rcti *input,

View File

@ -28,8 +28,8 @@ BilateralBlurOperation::BilateralBlurOperation()
this->addOutputSocket(COM_DT_COLOR);
this->setComplex(true);
this->m_inputColorProgram = NULL;
this->m_inputDeterminatorProgram = NULL;
this->m_inputColorProgram = nullptr;
this->m_inputDeterminatorProgram = nullptr;
}
void BilateralBlurOperation::initExecution()
@ -94,8 +94,8 @@ void BilateralBlurOperation::executePixel(float output[4], int x, int y, void *d
void BilateralBlurOperation::deinitExecution()
{
this->m_inputColorProgram = NULL;
this->m_inputDeterminatorProgram = NULL;
this->m_inputColorProgram = nullptr;
this->m_inputDeterminatorProgram = nullptr;
}
bool BilateralBlurOperation::determineDependingAreaOfInterest(rcti *input,

View File

@ -29,7 +29,7 @@ BlurBaseOperation::BlurBaseOperation(DataType data_type)
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(data_type);
this->setComplex(true);
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
memset(&m_data, 0, sizeof(NodeBlurData));
this->m_size = 1.0f;
this->m_sizeavailable = false;
@ -154,8 +154,8 @@ float *BlurBaseOperation::make_dist_fac_inverse(float rad, int size, int falloff
void BlurBaseOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputSize = NULL;
this->m_inputProgram = nullptr;
this->m_inputSize = nullptr;
}
void BlurBaseOperation::setData(const NodeBlurData *data)

View File

@ -34,9 +34,9 @@ BokehBlurOperation::BokehBlurOperation()
this->m_size = 1.0f;
this->m_sizeavailable = false;
this->m_inputProgram = NULL;
this->m_inputBokehProgram = NULL;
this->m_inputBoundingBoxReader = NULL;
this->m_inputProgram = nullptr;
this->m_inputBokehProgram = nullptr;
this->m_inputBoundingBoxReader = nullptr;
this->m_extend_bounds = false;
}
@ -47,7 +47,7 @@ void *BokehBlurOperation::initializeTileData(rcti * /*rect*/)
if (!this->m_sizeavailable) {
updateSize();
}
void *buffer = getInputOperation(0)->initializeTileData(NULL);
void *buffer = getInputOperation(0)->initializeTileData(nullptr);
unlockMutex();
return buffer;
}
@ -133,9 +133,9 @@ void BokehBlurOperation::executePixel(float output[4], int x, int y, void *data)
void BokehBlurOperation::deinitExecution()
{
deinitMutex();
this->m_inputProgram = NULL;
this->m_inputBokehProgram = NULL;
this->m_inputBoundingBoxReader = NULL;
this->m_inputProgram = nullptr;
this->m_inputBokehProgram = nullptr;
this->m_inputBoundingBoxReader = nullptr;
}
bool BokehBlurOperation::determineDependingAreaOfInterest(rcti *input,
@ -196,7 +196,7 @@ void BokehBlurOperation::executeOpenCL(OpenCLDevice *device,
list<cl_mem> *clMemToCleanUp,
list<cl_kernel> * /*clKernelsToCleanUp*/)
{
cl_kernel kernel = device->COM_clCreateKernel("bokehBlurKernel", NULL);
cl_kernel kernel = device->COM_clCreateKernel("bokehBlurKernel", nullptr);
if (!this->m_sizeavailable) {
updateSize();
}

View File

@ -113,7 +113,7 @@ void BokehImageOperation::deinitExecution()
if (this->m_deleteData) {
if (this->m_data) {
delete this->m_data;
this->m_data = NULL;
this->m_data = nullptr;
}
}
}

View File

@ -25,8 +25,8 @@ BoxMaskOperation::BoxMaskOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputMask = NULL;
this->m_inputValue = NULL;
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
this->m_cosine = 0.0f;
this->m_sine = 0.0f;
}
@ -105,6 +105,6 @@ void BoxMaskOperation::executePixelSampled(float output[4], float x, float y, Pi
void BoxMaskOperation::deinitExecution()
{
this->m_inputMask = NULL;
this->m_inputValue = NULL;
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
}

View File

@ -24,7 +24,7 @@ BrightnessOperation::BrightnessOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
this->m_use_premultiply = false;
}
@ -85,7 +85,7 @@ void BrightnessOperation::executePixelSampled(float output[4],
void BrightnessOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputBrightnessProgram = NULL;
this->m_inputContrastProgram = NULL;
this->m_inputProgram = nullptr;
this->m_inputBrightnessProgram = nullptr;
this->m_inputContrastProgram = nullptr;
}

View File

@ -26,7 +26,7 @@ CalculateMeanOperation::CalculateMeanOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addOutputSocket(COM_DT_VALUE);
this->m_imageReader = NULL;
this->m_imageReader = nullptr;
this->m_iscalculated = false;
this->m_setting = 1;
this->setComplex(true);
@ -45,7 +45,7 @@ void CalculateMeanOperation::executePixel(float output[4], int /*x*/, int /*y*/,
void CalculateMeanOperation::deinitExecution()
{
this->m_imageReader = NULL;
this->m_imageReader = nullptr;
NodeOperation::deinitMutex();
}
@ -77,7 +77,7 @@ void *CalculateMeanOperation::initializeTileData(rcti *rect)
this->m_iscalculated = true;
}
unlockMutex();
return NULL;
return nullptr;
}
void CalculateMeanOperation::calculateMean(MemoryBuffer *tile)

View File

@ -99,5 +99,5 @@ void *CalculateStandardDeviationOperation::initializeTileData(rcti *rect)
this->m_iscalculated = true;
}
unlockMutex();
return NULL;
return nullptr;
}

View File

@ -25,7 +25,7 @@ ChangeHSVOperation::ChangeHSVOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
void ChangeHSVOperation::initExecution()
@ -38,10 +38,10 @@ void ChangeHSVOperation::initExecution()
void ChangeHSVOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_hueOperation = NULL;
this->m_saturationOperation = NULL;
this->m_valueOperation = NULL;
this->m_inputOperation = nullptr;
this->m_hueOperation = nullptr;
this->m_saturationOperation = nullptr;
this->m_valueOperation = nullptr;
}
void ChangeHSVOperation::executePixelSampled(float output[4],

View File

@ -24,7 +24,7 @@ ChannelMatteOperation::ChannelMatteOperation()
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
this->m_inputImageProgram = NULL;
this->m_inputImageProgram = nullptr;
}
void ChannelMatteOperation::initExecution()
@ -77,7 +77,7 @@ void ChannelMatteOperation::initExecution()
void ChannelMatteOperation::deinitExecution()
{
this->m_inputImageProgram = NULL;
this->m_inputImageProgram = nullptr;
}
void ChannelMatteOperation::executePixelSampled(float output[4],

View File

@ -25,8 +25,8 @@ ChromaMatteOperation::ChromaMatteOperation()
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
this->m_inputImageProgram = NULL;
this->m_inputKeyProgram = NULL;
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;
}
void ChromaMatteOperation::initExecution()
@ -37,8 +37,8 @@ void ChromaMatteOperation::initExecution()
void ChromaMatteOperation::deinitExecution()
{
this->m_inputImageProgram = NULL;
this->m_inputKeyProgram = NULL;
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;
}
void ChromaMatteOperation::executePixelSampled(float output[4],

View File

@ -36,8 +36,8 @@ ColorBalanceASCCDLOperation::ColorBalanceASCCDLOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputValueOperation = NULL;
this->m_inputColorOperation = NULL;
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
this->setResolutionInputSocketIndex(1);
}
@ -76,6 +76,6 @@ void ColorBalanceASCCDLOperation::executePixelSampled(float output[4],
void ColorBalanceASCCDLOperation::deinitExecution()
{
this->m_inputValueOperation = NULL;
this->m_inputColorOperation = NULL;
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
}

View File

@ -41,8 +41,8 @@ ColorBalanceLGGOperation::ColorBalanceLGGOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputValueOperation = NULL;
this->m_inputColorOperation = NULL;
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
this->setResolutionInputSocketIndex(1);
}
@ -81,6 +81,6 @@ void ColorBalanceLGGOperation::executePixelSampled(float output[4],
void ColorBalanceLGGOperation::deinitExecution()
{
this->m_inputValueOperation = NULL;
this->m_inputColorOperation = NULL;
this->m_inputValueOperation = nullptr;
this->m_inputColorOperation = nullptr;
}

View File

@ -26,8 +26,8 @@ ColorCorrectionOperation::ColorCorrectionOperation()
this->addInputSocket(COM_DT_COLOR);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputImage = NULL;
this->m_inputMask = NULL;
this->m_inputImage = nullptr;
this->m_inputMask = nullptr;
this->m_redChannelEnabled = true;
this->m_greenChannelEnabled = true;
this->m_blueChannelEnabled = true;
@ -157,6 +157,6 @@ void ColorCorrectionOperation::executePixelSampled(float output[4],
void ColorCorrectionOperation::deinitExecution()
{
this->m_inputImage = NULL;
this->m_inputMask = NULL;
this->m_inputImage = nullptr;
this->m_inputMask = nullptr;
}

View File

@ -30,10 +30,10 @@ ColorCurveOperation::ColorCurveOperation()
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputFacProgram = NULL;
this->m_inputImageProgram = NULL;
this->m_inputBlackProgram = NULL;
this->m_inputWhiteProgram = NULL;
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;
this->m_inputBlackProgram = nullptr;
this->m_inputWhiteProgram = nullptr;
this->setResolutionInputSocketIndex(1);
}
@ -90,10 +90,10 @@ void ColorCurveOperation::executePixelSampled(float output[4],
void ColorCurveOperation::deinitExecution()
{
CurveBaseOperation::deinitExecution();
this->m_inputFacProgram = NULL;
this->m_inputImageProgram = NULL;
this->m_inputBlackProgram = NULL;
this->m_inputWhiteProgram = NULL;
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;
this->m_inputBlackProgram = nullptr;
this->m_inputWhiteProgram = nullptr;
}
// Constant level curve mapping
@ -104,8 +104,8 @@ ConstantLevelColorCurveOperation::ConstantLevelColorCurveOperation()
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputFacProgram = NULL;
this->m_inputImageProgram = NULL;
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;
this->setResolutionInputSocketIndex(1);
}
@ -148,6 +148,6 @@ void ConstantLevelColorCurveOperation::executePixelSampled(float output[4],
void ConstantLevelColorCurveOperation::deinitExecution()
{
CurveBaseOperation::deinitExecution();
this->m_inputFacProgram = NULL;
this->m_inputImageProgram = NULL;
this->m_inputFacProgram = nullptr;
this->m_inputImageProgram = nullptr;
}

View File

@ -25,8 +25,8 @@ ColorMatteOperation::ColorMatteOperation()
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
this->m_inputImageProgram = NULL;
this->m_inputKeyProgram = NULL;
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;
}
void ColorMatteOperation::initExecution()
@ -37,8 +37,8 @@ void ColorMatteOperation::initExecution()
void ColorMatteOperation::deinitExecution()
{
this->m_inputImageProgram = NULL;
this->m_inputKeyProgram = NULL;
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;
}
void ColorMatteOperation::executePixelSampled(float output[4],

View File

@ -25,8 +25,8 @@ ColorRampOperation::ColorRampOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputProgram = NULL;
this->m_colorBand = NULL;
this->m_inputProgram = nullptr;
this->m_colorBand = nullptr;
}
void ColorRampOperation::initExecution()
{
@ -46,5 +46,5 @@ void ColorRampOperation::executePixelSampled(float output[4],
void ColorRampOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}

View File

@ -26,8 +26,8 @@ ColorSpillOperation::ColorSpillOperation()
addInputSocket(COM_DT_VALUE);
addOutputSocket(COM_DT_COLOR);
this->m_inputImageReader = NULL;
this->m_inputFacReader = NULL;
this->m_inputImageReader = nullptr;
this->m_inputFacReader = nullptr;
this->m_spillChannel = 1; // GREEN
this->m_spillMethod = 0;
}
@ -77,8 +77,8 @@ void ColorSpillOperation::initExecution()
void ColorSpillOperation::deinitExecution()
{
this->m_inputImageReader = NULL;
this->m_inputFacReader = NULL;
this->m_inputImageReader = nullptr;
this->m_inputFacReader = nullptr;
}
void ColorSpillOperation::executePixelSampled(float output[4],

View File

@ -38,19 +38,19 @@ CompositorOperation::CompositorOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->setRenderData(NULL);
this->m_outputBuffer = NULL;
this->m_depthBuffer = NULL;
this->m_imageInput = NULL;
this->m_alphaInput = NULL;
this->m_depthInput = NULL;
this->setRenderData(nullptr);
this->m_outputBuffer = nullptr;
this->m_depthBuffer = nullptr;
this->m_imageInput = nullptr;
this->m_alphaInput = nullptr;
this->m_depthInput = nullptr;
this->m_useAlphaInput = false;
this->m_active = false;
this->m_scene = NULL;
this->m_scene = nullptr;
this->m_sceneName[0] = '\0';
this->m_viewName = NULL;
this->m_viewName = nullptr;
}
void CompositorOperation::initExecution()
@ -67,7 +67,7 @@ void CompositorOperation::initExecution()
this->m_outputBuffer = (float *)MEM_callocN(
sizeof(float[4]) * this->getWidth() * this->getHeight(), "CompositorOperation");
}
if (this->m_depthInput != NULL) {
if (this->m_depthInput != nullptr) {
this->m_depthBuffer = (float *)MEM_callocN(
sizeof(float) * this->getWidth() * this->getHeight(), "CompositorOperation");
}
@ -86,11 +86,11 @@ void CompositorOperation::deinitExecution()
if (rr) {
RenderView *rv = RE_RenderViewGetByName(rr, this->m_viewName);
if (rv->rectf != NULL) {
if (rv->rectf != nullptr) {
MEM_freeN(rv->rectf);
}
rv->rectf = this->m_outputBuffer;
if (rv->rectz != NULL) {
if (rv->rectz != nullptr) {
MEM_freeN(rv->rectz);
}
rv->rectz = this->m_depthBuffer;
@ -107,13 +107,13 @@ void CompositorOperation::deinitExecution()
if (re) {
RE_ReleaseResult(re);
re = NULL;
re = nullptr;
}
BLI_thread_lock(LOCK_DRAW_IMAGE);
BKE_image_signal(G.main,
BKE_image_ensure_viewer(G.main, IMA_TYPE_R_RESULT, "Render Result"),
NULL,
nullptr,
IMA_SIGNAL_FREE);
BLI_thread_unlock(LOCK_DRAW_IMAGE);
}
@ -126,11 +126,11 @@ void CompositorOperation::deinitExecution()
}
}
this->m_outputBuffer = NULL;
this->m_depthBuffer = NULL;
this->m_imageInput = NULL;
this->m_alphaInput = NULL;
this->m_depthInput = NULL;
this->m_outputBuffer = nullptr;
this->m_depthBuffer = nullptr;
this->m_imageInput = nullptr;
this->m_alphaInput = nullptr;
this->m_depthInput = nullptr;
}
void CompositorOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)

View File

@ -24,7 +24,7 @@ ConvertColorProfileOperation::ConvertColorProfileOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
this->m_predivided = false;
}
@ -46,5 +46,5 @@ void ConvertColorProfileOperation::executePixelSampled(float output[4],
void ConvertColorProfileOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}

View File

@ -25,11 +25,11 @@ ConvertDepthToRadiusOperation::ConvertDepthToRadiusOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
this->m_fStop = 128.0f;
this->m_cameraObject = NULL;
this->m_cameraObject = nullptr;
this->m_maxRadius = 32.0f;
this->m_blurPostOperation = NULL;
this->m_blurPostOperation = nullptr;
}
float ConvertDepthToRadiusOperation::determineFocalDistance()
@ -46,7 +46,7 @@ float ConvertDepthToRadiusOperation::determineFocalDistance()
void ConvertDepthToRadiusOperation::initExecution()
{
float cam_sensor = DEFAULT_SENSOR_WIDTH;
Camera *camera = NULL;
Camera *camera = nullptr;
if (this->m_cameraObject && this->m_cameraObject->type == OB_CAMERA) {
camera = (Camera *)this->m_cameraObject->data;
@ -111,5 +111,5 @@ void ConvertDepthToRadiusOperation::executePixelSampled(float output[4],
void ConvertDepthToRadiusOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}

View File

@ -22,7 +22,7 @@
ConvertBaseOperation::ConvertBaseOperation()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
void ConvertBaseOperation::initExecution()
@ -32,7 +32,7 @@ void ConvertBaseOperation::initExecution()
void ConvertBaseOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
/* ******** Value to Color ******** */
@ -401,7 +401,7 @@ SeparateChannelOperation::SeparateChannelOperation()
{
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
void SeparateChannelOperation::initExecution()
{
@ -410,7 +410,7 @@ void SeparateChannelOperation::initExecution()
void SeparateChannelOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
void SeparateChannelOperation::executePixelSampled(float output[4],
@ -433,10 +433,10 @@ CombineChannelsOperation::CombineChannelsOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->setResolutionInputSocketIndex(0);
this->m_inputChannel1Operation = NULL;
this->m_inputChannel2Operation = NULL;
this->m_inputChannel3Operation = NULL;
this->m_inputChannel4Operation = NULL;
this->m_inputChannel1Operation = nullptr;
this->m_inputChannel2Operation = nullptr;
this->m_inputChannel3Operation = nullptr;
this->m_inputChannel4Operation = nullptr;
}
void CombineChannelsOperation::initExecution()
@ -449,10 +449,10 @@ void CombineChannelsOperation::initExecution()
void CombineChannelsOperation::deinitExecution()
{
this->m_inputChannel1Operation = NULL;
this->m_inputChannel2Operation = NULL;
this->m_inputChannel3Operation = NULL;
this->m_inputChannel4Operation = NULL;
this->m_inputChannel1Operation = nullptr;
this->m_inputChannel2Operation = nullptr;
this->m_inputChannel3Operation = nullptr;
this->m_inputChannel4Operation = nullptr;
}
void CombineChannelsOperation::executePixelSampled(float output[4],

View File

@ -42,42 +42,42 @@ void ConvolutionEdgeFilterOperation::executePixel(float output[4], int x, int y,
CLAMP(y3, 0, getHeight() - 1);
float value[4];
this->m_inputValueOperation->read(value, x2, y2, NULL);
this->m_inputValueOperation->read(value, x2, y2, nullptr);
float mval = 1.0f - value[0];
this->m_inputOperation->read(in1, x1, y1, NULL);
this->m_inputOperation->read(in1, x1, y1, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[0]);
madd_v3_v3fl(res2, in1, this->m_filter[0]);
this->m_inputOperation->read(in1, x2, y1, NULL);
this->m_inputOperation->read(in1, x2, y1, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[1]);
madd_v3_v3fl(res2, in1, this->m_filter[3]);
this->m_inputOperation->read(in1, x3, y1, NULL);
this->m_inputOperation->read(in1, x3, y1, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[2]);
madd_v3_v3fl(res2, in1, this->m_filter[6]);
this->m_inputOperation->read(in1, x1, y2, NULL);
this->m_inputOperation->read(in1, x1, y2, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[3]);
madd_v3_v3fl(res2, in1, this->m_filter[1]);
this->m_inputOperation->read(in2, x2, y2, NULL);
this->m_inputOperation->read(in2, x2, y2, nullptr);
madd_v3_v3fl(res1, in2, this->m_filter[4]);
madd_v3_v3fl(res2, in2, this->m_filter[4]);
this->m_inputOperation->read(in1, x3, y2, NULL);
this->m_inputOperation->read(in1, x3, y2, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[5]);
madd_v3_v3fl(res2, in1, this->m_filter[7]);
this->m_inputOperation->read(in1, x1, y3, NULL);
this->m_inputOperation->read(in1, x1, y3, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[6]);
madd_v3_v3fl(res2, in1, this->m_filter[2]);
this->m_inputOperation->read(in1, x2, y3, NULL);
this->m_inputOperation->read(in1, x2, y3, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[7]);
madd_v3_v3fl(res2, in1, this->m_filter[5]);
this->m_inputOperation->read(in1, x3, y3, NULL);
this->m_inputOperation->read(in1, x3, y3, nullptr);
madd_v3_v3fl(res1, in1, this->m_filter[8]);
madd_v3_v3fl(res2, in1, this->m_filter[8]);

View File

@ -28,7 +28,7 @@ ConvolutionFilterOperation::ConvolutionFilterOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
this->setComplex(true);
}
void ConvolutionFilterOperation::initExecution()
@ -55,8 +55,8 @@ void ConvolutionFilterOperation::set3x3Filter(
void ConvolutionFilterOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputValueOperation = NULL;
this->m_inputOperation = nullptr;
this->m_inputValueOperation = nullptr;
}
void ConvolutionFilterOperation::executePixel(float output[4], int x, int y, void * /*data*/)
@ -76,27 +76,27 @@ void ConvolutionFilterOperation::executePixel(float output[4], int x, int y, voi
CLAMP(y2, 0, getHeight() - 1);
CLAMP(y3, 0, getHeight() - 1);
float value[4];
this->m_inputValueOperation->read(value, x2, y2, NULL);
this->m_inputValueOperation->read(value, x2, y2, nullptr);
const float mval = 1.0f - value[0];
zero_v4(output);
this->m_inputOperation->read(in1, x1, y1, NULL);
this->m_inputOperation->read(in1, x1, y1, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[0]);
this->m_inputOperation->read(in1, x2, y1, NULL);
this->m_inputOperation->read(in1, x2, y1, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[1]);
this->m_inputOperation->read(in1, x3, y1, NULL);
this->m_inputOperation->read(in1, x3, y1, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[2]);
this->m_inputOperation->read(in1, x1, y2, NULL);
this->m_inputOperation->read(in1, x1, y2, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[3]);
this->m_inputOperation->read(in2, x2, y2, NULL);
this->m_inputOperation->read(in2, x2, y2, nullptr);
madd_v4_v4fl(output, in2, this->m_filter[4]);
this->m_inputOperation->read(in1, x3, y2, NULL);
this->m_inputOperation->read(in1, x3, y2, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[5]);
this->m_inputOperation->read(in1, x1, y3, NULL);
this->m_inputOperation->read(in1, x1, y3, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[6]);
this->m_inputOperation->read(in1, x2, y3, NULL);
this->m_inputOperation->read(in1, x2, y3, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[7]);
this->m_inputOperation->read(in1, x3, y3, NULL);
this->m_inputOperation->read(in1, x3, y3, nullptr);
madd_v4_v4fl(output, in1, this->m_filter[8]);
output[0] = output[0] * value[0] + in2[0] * mval;

View File

@ -23,8 +23,8 @@ CropBaseOperation::CropBaseOperation()
{
this->addInputSocket(COM_DT_COLOR, COM_SC_NO_RESIZE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputOperation = NULL;
this->m_settings = NULL;
this->m_inputOperation = nullptr;
this->m_settings = nullptr;
}
void CropBaseOperation::updateArea()
@ -75,7 +75,7 @@ void CropBaseOperation::initExecution()
void CropBaseOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
CropOperation::CropOperation() : CropBaseOperation()

View File

@ -22,14 +22,14 @@
CurveBaseOperation::CurveBaseOperation()
{
this->m_curveMapping = NULL;
this->m_curveMapping = nullptr;
}
CurveBaseOperation::~CurveBaseOperation()
{
if (this->m_curveMapping) {
BKE_curvemapping_free(this->m_curveMapping);
this->m_curveMapping = NULL;
this->m_curveMapping = nullptr;
}
}
@ -41,7 +41,7 @@ void CurveBaseOperation::deinitExecution()
{
if (this->m_curveMapping) {
BKE_curvemapping_free(this->m_curveMapping);
this->m_curveMapping = NULL;
this->m_curveMapping = nullptr;
}
}

View File

@ -32,7 +32,7 @@ DenoiseOperation::DenoiseOperation()
this->addInputSocket(COM_DT_VECTOR);
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->m_settings = NULL;
this->m_settings = nullptr;
}
void DenoiseOperation::initExecution()
{
@ -44,9 +44,9 @@ void DenoiseOperation::initExecution()
void DenoiseOperation::deinitExecution()
{
this->m_inputProgramColor = NULL;
this->m_inputProgramNormal = NULL;
this->m_inputProgramAlbedo = NULL;
this->m_inputProgramColor = nullptr;
this->m_inputProgramNormal = nullptr;
this->m_inputProgramAlbedo = nullptr;
SingleThreadedOperation::deinitExecution();
}

View File

@ -28,7 +28,7 @@ DespeckleOperation::DespeckleOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
this->setComplex(true);
}
void DespeckleOperation::initExecution()
@ -39,8 +39,8 @@ void DespeckleOperation::initExecution()
void DespeckleOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputValueOperation = NULL;
this->m_inputOperation = nullptr;
this->m_inputValueOperation = nullptr;
}
BLI_INLINE int color_diff(const float a[3], const float b[3], const float threshold)
@ -69,10 +69,10 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da
CLAMP(y2, 0, getHeight() - 1);
CLAMP(y3, 0, getHeight() - 1);
float value[4];
this->m_inputValueOperation->read(value, x2, y2, NULL);
this->m_inputValueOperation->read(value, x2, y2, nullptr);
// const float mval = 1.0f - value[0];
this->m_inputOperation->read(color_org, x2, y2, NULL);
this->m_inputOperation->read(color_org, x2, y2, nullptr);
#define TOT_DIV_ONE 1.0f
#define TOT_DIV_CNR (float)M_SQRT1_2
@ -91,13 +91,13 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da
zero_v4(color_mid);
zero_v4(color_mid_ok);
this->m_inputOperation->read(in1, x1, y1, NULL);
this->m_inputOperation->read(in1, x1, y1, nullptr);
COLOR_ADD(TOT_DIV_CNR)
this->m_inputOperation->read(in1, x2, y1, NULL);
this->m_inputOperation->read(in1, x2, y1, nullptr);
COLOR_ADD(TOT_DIV_ONE)
this->m_inputOperation->read(in1, x3, y1, NULL);
this->m_inputOperation->read(in1, x3, y1, nullptr);
COLOR_ADD(TOT_DIV_CNR)
this->m_inputOperation->read(in1, x1, y2, NULL);
this->m_inputOperation->read(in1, x1, y2, nullptr);
COLOR_ADD(TOT_DIV_ONE)
#if 0
@ -105,13 +105,13 @@ void DespeckleOperation::executePixel(float output[4], int x, int y, void * /*da
madd_v4_v4fl(color_mid, in2, this->m_filter[4]);
#endif
this->m_inputOperation->read(in1, x3, y2, NULL);
this->m_inputOperation->read(in1, x3, y2, nullptr);
COLOR_ADD(TOT_DIV_ONE)
this->m_inputOperation->read(in1, x1, y3, NULL);
this->m_inputOperation->read(in1, x1, y3, nullptr);
COLOR_ADD(TOT_DIV_CNR)
this->m_inputOperation->read(in1, x2, y3, NULL);
this->m_inputOperation->read(in1, x2, y3, nullptr);
COLOR_ADD(TOT_DIV_ONE)
this->m_inputOperation->read(in1, x3, y3, NULL);
this->m_inputOperation->read(in1, x3, y3, nullptr);
COLOR_ADD(TOT_DIV_CNR)
mul_v4_fl(color_mid, 1.0f / (4.0f + (4.0f * (float)M_SQRT1_2)));

View File

@ -25,8 +25,8 @@ DifferenceMatteOperation::DifferenceMatteOperation()
addInputSocket(COM_DT_COLOR);
addOutputSocket(COM_DT_VALUE);
this->m_inputImage1Program = NULL;
this->m_inputImage2Program = NULL;
this->m_inputImage1Program = nullptr;
this->m_inputImage2Program = nullptr;
}
void DifferenceMatteOperation::initExecution()
@ -36,8 +36,8 @@ void DifferenceMatteOperation::initExecution()
}
void DifferenceMatteOperation::deinitExecution()
{
this->m_inputImage1Program = NULL;
this->m_inputImage2Program = NULL;
this->m_inputImage1Program = nullptr;
this->m_inputImage2Program = nullptr;
}
void DifferenceMatteOperation::executePixelSampled(float output[4],

View File

@ -28,7 +28,7 @@ DilateErodeThresholdOperation::DilateErodeThresholdOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->setComplex(true);
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
this->m_inset = 0.0f;
this->m__switch = 0.5f;
this->m_distance = 0.0f;
@ -54,7 +54,7 @@ void DilateErodeThresholdOperation::initExecution()
void *DilateErodeThresholdOperation::initializeTileData(rcti * /*rect*/)
{
void *buffer = this->m_inputProgram->initializeTileData(NULL);
void *buffer = this->m_inputProgram->initializeTileData(nullptr);
return buffer;
}
@ -142,7 +142,7 @@ void DilateErodeThresholdOperation::executePixel(float output[4], int x, int y,
void DilateErodeThresholdOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}
bool DilateErodeThresholdOperation::determineDependingAreaOfInterest(
@ -164,7 +164,7 @@ DilateDistanceOperation::DilateDistanceOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->setComplex(true);
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
this->m_distance = 0.0f;
this->setOpenCL(true);
}
@ -179,7 +179,7 @@ void DilateDistanceOperation::initExecution()
void *DilateDistanceOperation::initializeTileData(rcti * /*rect*/)
{
void *buffer = this->m_inputProgram->initializeTileData(NULL);
void *buffer = this->m_inputProgram->initializeTileData(nullptr);
return buffer;
}
@ -217,7 +217,7 @@ void DilateDistanceOperation::executePixel(float output[4], int x, int y, void *
void DilateDistanceOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}
bool DilateDistanceOperation::determineDependingAreaOfInterest(rcti *input,
@ -241,7 +241,7 @@ void DilateDistanceOperation::executeOpenCL(OpenCLDevice *device,
list<cl_mem> *clMemToCleanUp,
list<cl_kernel> * /*clKernelsToCleanUp*/)
{
cl_kernel dilateKernel = device->COM_clCreateKernel("dilateKernel", NULL);
cl_kernel dilateKernel = device->COM_clCreateKernel("dilateKernel", nullptr);
cl_int distanceSquared = this->m_distance * this->m_distance;
cl_int scope = this->m_scope;
@ -301,7 +301,7 @@ void ErodeDistanceOperation::executeOpenCL(OpenCLDevice *device,
list<cl_mem> *clMemToCleanUp,
list<cl_kernel> * /*clKernelsToCleanUp*/)
{
cl_kernel erodeKernel = device->COM_clCreateKernel("erodeKernel", NULL);
cl_kernel erodeKernel = device->COM_clCreateKernel("erodeKernel", nullptr);
cl_int distanceSquared = this->m_distance * this->m_distance;
cl_int scope = this->m_scope;
@ -322,7 +322,7 @@ DilateStepOperation::DilateStepOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->setComplex(true);
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}
void DilateStepOperation::initExecution()
{
@ -351,7 +351,7 @@ static tile_info *create_cache(int xmin, int xmax, int ymin, int ymax)
void *DilateStepOperation::initializeTileData(rcti *rect)
{
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(nullptr);
int x, y, i;
int width = tile->getWidth();
int height = tile->getHeight();
@ -448,7 +448,7 @@ void DilateStepOperation::executePixel(float output[4], int x, int y, void *data
void DilateStepOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}
void DilateStepOperation::deinitializeTileData(rcti * /*rect*/, void *data)
@ -480,7 +480,7 @@ ErodeStepOperation::ErodeStepOperation() : DilateStepOperation()
void *ErodeStepOperation::initializeTileData(rcti *rect)
{
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(NULL);
MemoryBuffer *tile = (MemoryBuffer *)this->m_inputProgram->initializeTileData(nullptr);
int x, y, i;
int width = tile->getWidth();
int height = tile->getHeight();

View File

@ -30,7 +30,7 @@ DirectionalBlurOperation::DirectionalBlurOperation()
this->setComplex(true);
this->setOpenCL(true);
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}
void DirectionalBlurOperation::initExecution()
@ -103,7 +103,7 @@ void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device,
list<cl_mem> *clMemToCleanUp,
list<cl_kernel> * /*clKernelsToCleanUp*/)
{
cl_kernel directionalBlurKernel = device->COM_clCreateKernel("directionalBlurKernel", NULL);
cl_kernel directionalBlurKernel = device->COM_clCreateKernel("directionalBlurKernel", nullptr);
cl_int iterations = pow(2.0f, this->m_data->iter);
cl_float2 ltxy = {{this->m_tx, this->m_ty}};
@ -128,7 +128,7 @@ void DirectionalBlurOperation::executeOpenCL(OpenCLDevice *device,
void DirectionalBlurOperation::deinitExecution()
{
this->m_inputProgram = NULL;
this->m_inputProgram = nullptr;
}
bool DirectionalBlurOperation::determineDependingAreaOfInterest(rcti * /*input*/,

View File

@ -29,10 +29,10 @@ DisplaceOperation::DisplaceOperation()
this->addOutputSocket(COM_DT_COLOR);
this->setComplex(true);
this->m_inputColorProgram = NULL;
this->m_inputVectorProgram = NULL;
this->m_inputScaleXProgram = NULL;
this->m_inputScaleYProgram = NULL;
this->m_inputColorProgram = nullptr;
this->m_inputVectorProgram = nullptr;
this->m_inputScaleXProgram = nullptr;
this->m_inputScaleYProgram = nullptr;
}
void DisplaceOperation::initExecution()
@ -143,10 +143,10 @@ void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r
void DisplaceOperation::deinitExecution()
{
this->m_inputColorProgram = NULL;
this->m_inputVectorProgram = NULL;
this->m_inputScaleXProgram = NULL;
this->m_inputScaleYProgram = NULL;
this->m_inputColorProgram = nullptr;
this->m_inputVectorProgram = nullptr;
this->m_inputScaleXProgram = nullptr;
this->m_inputScaleYProgram = nullptr;
}
bool DisplaceOperation::determineDependingAreaOfInterest(rcti *input,
@ -155,7 +155,7 @@ bool DisplaceOperation::determineDependingAreaOfInterest(rcti *input,
{
rcti colorInput;
rcti vectorInput;
NodeOperation *operation = NULL;
NodeOperation *operation = nullptr;
/* the vector buffer only needs a 2x2 buffer. The image needs whole buffer */
/* image */

View File

@ -28,10 +28,10 @@ DisplaceSimpleOperation::DisplaceSimpleOperation()
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_COLOR);
this->m_inputColorProgram = NULL;
this->m_inputVectorProgram = NULL;
this->m_inputScaleXProgram = NULL;
this->m_inputScaleYProgram = NULL;
this->m_inputColorProgram = nullptr;
this->m_inputVectorProgram = nullptr;
this->m_inputScaleXProgram = nullptr;
this->m_inputScaleYProgram = nullptr;
}
void DisplaceSimpleOperation::initExecution()
@ -86,10 +86,10 @@ void DisplaceSimpleOperation::executePixelSampled(float output[4],
void DisplaceSimpleOperation::deinitExecution()
{
this->m_inputColorProgram = NULL;
this->m_inputVectorProgram = NULL;
this->m_inputScaleXProgram = NULL;
this->m_inputScaleYProgram = NULL;
this->m_inputColorProgram = nullptr;
this->m_inputVectorProgram = nullptr;
this->m_inputScaleXProgram = nullptr;
this->m_inputScaleYProgram = nullptr;
}
bool DisplaceSimpleOperation::determineDependingAreaOfInterest(rcti *input,
@ -97,7 +97,7 @@ bool DisplaceSimpleOperation::determineDependingAreaOfInterest(rcti *input,
rcti *output)
{
rcti colorInput;
NodeOperation *operation = NULL;
NodeOperation *operation = nullptr;
/* the vector buffer only needs a 2x2 buffer. The image needs whole buffer */
/* image */

View File

@ -25,8 +25,8 @@ DistanceRGBMatteOperation::DistanceRGBMatteOperation()
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputImageProgram = NULL;
this->m_inputKeyProgram = NULL;
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;
}
void DistanceRGBMatteOperation::initExecution()
@ -37,8 +37,8 @@ void DistanceRGBMatteOperation::initExecution()
void DistanceRGBMatteOperation::deinitExecution()
{
this->m_inputImageProgram = NULL;
this->m_inputKeyProgram = NULL;
this->m_inputImageProgram = nullptr;
this->m_inputKeyProgram = nullptr;
}
float DistanceRGBMatteOperation::calculateDistance(float key[4], float image[4])

View File

@ -24,8 +24,8 @@ DotproductOperation::DotproductOperation()
this->addInputSocket(COM_DT_VECTOR);
this->addOutputSocket(COM_DT_VALUE);
this->setResolutionInputSocketIndex(0);
this->m_input1Operation = NULL;
this->m_input2Operation = NULL;
this->m_input1Operation = nullptr;
this->m_input2Operation = nullptr;
}
void DotproductOperation::initExecution()
{
@ -35,8 +35,8 @@ void DotproductOperation::initExecution()
void DotproductOperation::deinitExecution()
{
this->m_input1Operation = NULL;
this->m_input2Operation = NULL;
this->m_input1Operation = nullptr;
this->m_input2Operation = nullptr;
}
/** \todo: current implementation is the inverse of a dotproduct. not 'logically' correct

View File

@ -1311,8 +1311,8 @@ DoubleEdgeMaskOperation::DoubleEdgeMaskOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputInnerMask = NULL;
this->m_inputOuterMask = NULL;
this->m_inputInnerMask = nullptr;
this->m_inputOuterMask = nullptr;
this->m_adjecentOnly = false;
this->m_keepInside = false;
this->setComplex(true);
@ -1322,7 +1322,7 @@ bool DoubleEdgeMaskOperation::determineDependingAreaOfInterest(rcti * /*input*/,
ReadBufferOperation *readOperation,
rcti *output)
{
if (this->m_cachedInstance == NULL) {
if (this->m_cachedInstance == nullptr) {
rcti newInput;
newInput.xmax = this->getWidth();
newInput.xmin = 0;
@ -1339,7 +1339,7 @@ void DoubleEdgeMaskOperation::initExecution()
this->m_inputInnerMask = this->getInputSocketReader(0);
this->m_inputOuterMask = this->getInputSocketReader(1);
initMutex();
this->m_cachedInstance = NULL;
this->m_cachedInstance = nullptr;
}
void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect)
@ -1349,7 +1349,7 @@ void *DoubleEdgeMaskOperation::initializeTileData(rcti *rect)
}
lockMutex();
if (this->m_cachedInstance == NULL) {
if (this->m_cachedInstance == nullptr) {
MemoryBuffer *innerMask = (MemoryBuffer *)this->m_inputInnerMask->initializeTileData(rect);
MemoryBuffer *outerMask = (MemoryBuffer *)this->m_inputOuterMask->initializeTileData(rect);
float *data = (float *)MEM_mallocN(sizeof(float) * this->getWidth() * this->getHeight(),
@ -1371,11 +1371,11 @@ void DoubleEdgeMaskOperation::executePixel(float output[4], int x, int y, void *
void DoubleEdgeMaskOperation::deinitExecution()
{
this->m_inputInnerMask = NULL;
this->m_inputOuterMask = NULL;
this->m_inputInnerMask = nullptr;
this->m_inputOuterMask = nullptr;
deinitMutex();
if (this->m_cachedInstance) {
MEM_freeN(this->m_cachedInstance);
this->m_cachedInstance = NULL;
this->m_cachedInstance = nullptr;
}
}

View File

@ -25,8 +25,8 @@ EllipseMaskOperation::EllipseMaskOperation()
this->addInputSocket(COM_DT_VALUE);
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->m_inputMask = NULL;
this->m_inputValue = NULL;
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
this->m_cosine = 0.0f;
this->m_sine = 0.0f;
}
@ -114,6 +114,6 @@ void EllipseMaskOperation::executePixelSampled(float output[4],
void EllipseMaskOperation::deinitExecution()
{
this->m_inputMask = NULL;
this->m_inputValue = NULL;
this->m_inputMask = nullptr;
this->m_inputValue = nullptr;
}

View File

@ -24,7 +24,7 @@
FastGaussianBlurOperation::FastGaussianBlurOperation() : BlurBaseOperation(COM_DT_COLOR)
{
this->m_iirgaus = NULL;
this->m_iirgaus = nullptr;
}
void FastGaussianBlurOperation::executePixel(float output[4], int x, int y, void *data)
@ -70,7 +70,7 @@ void FastGaussianBlurOperation::deinitExecution()
{
if (this->m_iirgaus) {
delete this->m_iirgaus;
this->m_iirgaus = NULL;
this->m_iirgaus = nullptr;
}
BlurBaseOperation::deinitMutex();
}
@ -260,8 +260,8 @@ FastGaussianBlurValueOperation::FastGaussianBlurValueOperation()
{
this->addInputSocket(COM_DT_VALUE);
this->addOutputSocket(COM_DT_VALUE);
this->m_iirgaus = NULL;
this->m_inputprogram = NULL;
this->m_iirgaus = nullptr;
this->m_inputprogram = nullptr;
this->m_sigma = 1.0f;
this->m_overlay = 0;
setComplex(true);
@ -300,7 +300,7 @@ void FastGaussianBlurValueOperation::deinitExecution()
{
if (this->m_iirgaus) {
delete this->m_iirgaus;
this->m_iirgaus = NULL;
this->m_iirgaus = nullptr;
}
deinitMutex();
}

View File

@ -23,7 +23,7 @@ FlipOperation::FlipOperation()
this->addInputSocket(COM_DT_COLOR);
this->addOutputSocket(COM_DT_COLOR);
this->setResolutionInputSocketIndex(0);
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
this->m_flipX = true;
this->m_flipY = false;
}
@ -34,7 +34,7 @@ void FlipOperation::initExecution()
void FlipOperation::deinitExecution()
{
this->m_inputOperation = NULL;
this->m_inputOperation = nullptr;
}
void FlipOperation::executePixelSampled(float output[4], float x, float y, PixelSampler sampler)

Some files were not shown because too many files have changed in this diff Show More