diff options
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/delaunay_2d.cc | 38 | ||||
-rw-r--r-- | source/blender/blenlib/intern/mesh_intersect.cc | 6 | ||||
-rw-r--r-- | source/blender/blenlib/intern/task_pool.cc | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/task_range.cc | 6 |
4 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index 568a3206b18..daa006fd5cc 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -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); } } diff --git a/source/blender/blenlib/intern/mesh_intersect.cc b/source/blender/blenlib/intern/mesh_intersect.cc index 6647f8b8c92..53c104aae09 100644 --- a/source/blender/blenlib/intern/mesh_intersect.cc +++ b/source/blender/blenlib/intern/mesh_intersect.cc @@ -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( diff --git a/source/blender/blenlib/intern/task_pool.cc b/source/blender/blenlib/intern/task_pool.cc index cf328ec407c..1a119e135d5 100644 --- a/source/blender/blenlib/intern/task_pool.cc +++ b/source/blender/blenlib/intern/task_pool.cc @@ -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) diff --git a/source/blender/blenlib/intern/task_range.cc b/source/blender/blenlib/intern/task_range.cc index 27e0fb0ed07..229129bd088 100644 --- a/source/blender/blenlib/intern/task_range.cc +++ b/source/blender/blenlib/intern/task_range.cc @@ -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); } } |