WIP: Vulkan: Workbench #107886

Closed
Jeroen Bakker wants to merge 88 commits from Jeroen-Bakker:vulkan-draw-manager-workbench into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
33 changed files with 69 additions and 67 deletions
Showing only changes of commit d0360f840d - Show all commits

View File

@ -161,8 +161,8 @@ void add_keyframe(FCurve *fcu, float x, float y)
TEST(action_assets, BKE_action_has_single_frame)
{
/* NULL action. */
EXPECT_FALSE(BKE_action_has_single_frame(nullptr)) << "NULL Action cannot have a single frame.";
/* Null action. */
EXPECT_FALSE(BKE_action_has_single_frame(nullptr)) << "Null Action cannot have a single frame.";
/* No FCurves. */
{

View File

@ -4507,7 +4507,7 @@ static bool CustomData_layer_ensure_data_exists(CustomDataLayer *layer, size_t c
default:
/* Log an error so we can collect instances of bad files. */
CLOG_WARN(&LOG, "CustomDataLayer->data is NULL for type %d.", layer->type);
CLOG_WARN(&LOG, "CustomDataLayer->data is null for type %d.", layer->type);
break;
}
return false;

View File

@ -750,7 +750,7 @@ void BKE_grease_pencil_data_update(struct Depsgraph * /*depsgraph*/,
int BKE_grease_pencil_object_material_index_get_by_name(Object *ob, const char *name)
{
short *totcol = BKE_object_material_len_p(ob);
Material *read_ma = NULL;
Material *read_ma = nullptr;
for (short i = 0; i < *totcol; i++) {
read_ma = BKE_object_material_get(ob, i + 1);
if (STREQ(name, read_ma->id.name + 2)) {

View File

@ -1289,7 +1289,7 @@ static void lib_override_library_create_post_process(Main *bmain,
/* No instantiation in case the root override is linked data, unless it is part of the given
* owner library.
*
* NOTE: that last case should never happen actually in current code? Since non-NULL owner
* NOTE: that last case should never happen actually in current code? Since non-null owner
* library should only happen in case of recursive resync, which is already excluded by the
* previous condition. */
}

View File

@ -48,7 +48,7 @@ using namespace blender;
*/
static bool id_name_final_build(char *name, char *base_name, size_t base_name_len, int number)
{
char number_str[11]; /* Dot + nine digits + NULL terminator. */
char number_str[11]; /* Dot + nine digits + null terminator. */
size_t number_str_len = SNPRINTF_RLEN(number_str, ".%.3d", number);
/* If the number would lead to an overflow of the maximum ID name length, we need to truncate

View File

@ -1667,7 +1667,8 @@ static void sculpt_update_object(
BLI_assert(me_eval != nullptr);
/* This is for handling a newly opened file with no object visible, causing me_eval==NULL. */
/* This is for handling a newly opened file with no object visible,
* causing `me_eval == nullptr`. */
if (me_eval == nullptr) {
return;
}

View File

@ -900,7 +900,7 @@ bool BKE_volume_load(const Volume *volume, const Main *bmain)
CLOG_INFO(&LOG, 1, "Volume %s: %s", volume_name, grids.error_msg.c_str());
}
/* Add grids read from file to own vector, filtering out any NULL pointers. */
/* Add grids read from file to own vector, filtering out any null pointers. */
for (const openvdb::GridBase::Ptr &vdb_grid : vdb_grids) {
if (vdb_grid) {
VolumeFileCache::Entry template_entry(filepath, vdb_grid);

View File

@ -392,7 +392,7 @@ template<typename T> std::ostream &operator<<(std::ostream &os, const SymEdge<T>
<< vertname(se.next->vert);
}
else {
os << vertname(se.vert) << "(" << se.vert->co << "->NULL)";
os << vertname(se.vert) << "(" << se.vert->co << "->null)";
}
return os;
}
@ -406,10 +406,10 @@ template<typename T> std::ostream &operator<<(std::ostream &os, const SymEdge<T>
template<typename T> std::string short_se_dump(const SymEdge<T> *se)
{
if (se == nullptr) {
return std::string("NULL");
return std::string("null");
}
return vertname(se->vert) +
(se->next == nullptr ? std::string("[NULL]") : vertname(se->next->vert));
(se->next == nullptr ? std::string("[null]") : vertname(se->next->vert));
}
template<typename T> std::ostream &operator<<(std::ostream &os, const CDT_state<T> &cdt_state)
@ -431,11 +431,11 @@ template<typename T> std::ostream &operator<<(std::ostream &os, const CDT_state<
os << " edges out:\n";
do {
if (se->next == nullptr) {
os << " [NULL] next/rot symedge, se=" << trunc_ptr(se) << "\n";
os << " [null] next/rot symedge, se=" << trunc_ptr(se) << "\n";
break;
}
if (se->next->next == nullptr) {
os << " [NULL] next-next/rot symedge, se=" << trunc_ptr(se) << "\n";
os << " [null] next-next/rot symedge, se=" << trunc_ptr(se) << "\n";
break;
}
const CDTVert<T> *vother = sym(se)->vert;
@ -1155,7 +1155,7 @@ template<typename T> void CDTArrangement<T>::delete_edge(SymEdge<T> *se)
v2->symedge = f;
}
/* Mark SymEdge as deleted by setting all its pointers to NULL. */
/* Mark #SymEdge as deleted by setting all its pointers to null. */
se->next = se->rot = nullptr;
sesym->next = sesym->rot = nullptr;
if (!v1_isolated && !v2_isolated && aface != bface) {
@ -1565,16 +1565,16 @@ template<typename T> inline int tri_orient(const SymEdge<T> *t)
* In general, lambda=0 indicates case a and lambda != 0 indicates case be.
* The 'in' edge gives the destination attachment point of a diagonal from the previous crossing,
* and the 'out' edge gives the origin attachment point of a diagonal to the next crossing.
* But in some cases, 'in' and 'out' are undefined or not needed, and will be NULL.
* But in some cases, 'in' and 'out' are undefined or not needed, and will be null.
*
* For case (a), 'vert' will be the vertex, and lambda will be 0, and 'in' will be the #SymEdge
* from 'vert' that has as face the one that you go through to get to this vertex. If you go
* exactly along an edge then we set 'in' to NULL, since it won't be needed. The first crossing
* will have 'in' = NULL. We set 'out' to the #SymEdge that has the face we go through to get to
* exactly along an edge then we set 'in' to null, since it won't be needed. The first crossing
* will have 'in' = null. We set 'out' to the #SymEdge that has the face we go through to get to
* the next crossing, or, if the next crossing is a case (a), then it is the edge that goes to that
* next vertex. 'out' will be NULL for the last one.
* next vertex. 'out' will be null for the last one.
*
* For case (b), vert will be NULL at first, and later filled in with the created split vertex,
* For case (b), vert will be null at first, and later filled in with the created split vertex,
* and 'in' will be the #SymEdge that we go through, and lambda will be between 0 and 1,
* the fraction from in's vert to in->next's vert to put the split vertex.
* 'out' is not needed in this case, since the attachment point will be the sym of the first
@ -1632,7 +1632,7 @@ bool get_next_crossing_from_vert(CDT_state<T> *cdt_state,
/**
* As part of finding crossings, we found a case where the next crossing goes through vert v.
* If it came from a previous vert in cd, then cd_out is the edge that leads from that to v.
* Else cd_out can be NULL, because it won't be used.
* Else cd_out can be null, because it won't be used.
* Set *cd_next to indicate this. We can set 'in' but not 'out'. We can set the 'out' of the
* current cd.
*/
@ -1880,7 +1880,7 @@ void dump_crossings(const Vector<CrossData<T>, inline_crossings_size> &crossings
* and partial overlaps with existing cdt vertices and edges.
* Each created #CDTEdge will have input_id added to its input_ids list.
*
* If \a r_edges is not NULL, the #CDTEdges generated or found that go from
* If \a r_edges is not null, the #CDTEdges generated or found that go from
* v1 to v2 are put into that linked list, in order.
*
* Assumes that #blender_constrained_delaunay_get_output has not been called yet.

View File

@ -171,7 +171,7 @@ TEST(listbase, FromLink)
Link *link2 = static_cast<Link *>(MEM_callocN(sizeof(Link), "link2"));
Link *link3 = static_cast<Link *>(MEM_callocN(sizeof(Link), "link3"));
/* NULL safety. */
/* Null safety. */
EXPECT_EQ(lb, BLI_listbase_from_link(nullptr));
/* One link. */

View File

@ -237,7 +237,7 @@ TEST(string, StrPartition)
{
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
/* "" -> "", nullptr, nullptr, 0 */
pre_len = BLI_str_partition(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
@ -247,7 +247,7 @@ TEST(string, StrPartition)
{
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
/* "material" -> "material", nullptr, nullptr, 8 */
pre_len = BLI_str_partition(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
@ -296,7 +296,7 @@ TEST(string, StrRPartition)
{
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
/* "" -> "", nullptr, nullptr, 0 */
pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
@ -306,7 +306,7 @@ TEST(string, StrRPartition)
{
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
/* "material" -> "material", nullptr, nullptr, 8 */
pre_len = BLI_str_rpartition(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
@ -337,7 +337,7 @@ TEST(string, StrPartitionEx)
{
const char *str = "mate.rial";
/* "mate.rial" over "mate" -> "mate.rial", NULL, NULL, 4 */
/* "mate.rial" over "mate" -> "mate.rial", nullptr, nullptr, 4 */
pre_len = BLI_str_partition_ex(str, str + 4, delim, &sep, &suf, true);
EXPECT_EQ(pre_len, 4);
EXPECT_EQ(sep, (void *)nullptr);
@ -386,7 +386,7 @@ TEST(string, StrPartitionUtf8)
{
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
/* "" -> "", nullptr, nullptr, 0 */
pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
@ -396,7 +396,7 @@ TEST(string, StrPartitionUtf8)
{
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
/* "material" -> "material", nullptr, nullptr, 8 */
pre_len = BLI_str_partition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
@ -445,7 +445,7 @@ TEST(string, StrRPartitionUtf8)
{
const char *str = "";
/* "" -> "", NULL, NULL, 0 */
/* "" -> "", nullptr, nullptr, 0 */
pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 0);
EXPECT_EQ(sep, (void *)nullptr);
@ -455,7 +455,7 @@ TEST(string, StrRPartitionUtf8)
{
const char *str = "material";
/* "material" -> "material", NULL, NULL, 8 */
/* "material" -> "material", nullptr, nullptr, 8 */
pre_len = BLI_str_rpartition_utf8(str, delim, &sep, &suf);
EXPECT_EQ(pre_len, 8);
EXPECT_EQ(sep, (void *)nullptr);
@ -487,7 +487,7 @@ TEST(string, StrPartitionExUtf8)
{
const char *str = "mate\xe2\x98\xafrial";
/* "mate\xe2\x98\xafrial" over "mate" -> "mate\xe2\x98\xafrial", NULL, NULL, 4 */
/* "mate\xe2\x98\xafrial" over "mate" -> "mate\xe2\x98\xafrial", nullptr, nullptr, 4 */
pre_len = BLI_str_partition_ex_utf8(str, str + 4, delim, &sep, &suf, true);
EXPECT_EQ(pre_len, 4);
EXPECT_EQ(sep, (void *)nullptr);

View File

@ -21,7 +21,7 @@
/* Breaking strings is confusing here, prefer over-long lines. */
/* clang-format off */
/* Each test is made of a 79 bytes (80 with NULL char) string to test, expected string result after
/* Each test is made of a 79 bytes (80 with null char) string to test, expected string result after
* stripping invalid utf8 bytes, and a single-byte string encoded with expected number of errors.
*
* Based on utf-8 decoder stress-test (https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt)

View File

@ -3140,7 +3140,7 @@ static void read_libblock_undo_restore_at_old_address(FileData *fd, Main *main,
/* We do need remapping of internal pointers to the ID itself here.
*
* Passing a NULL BMain means that not all potential runtime data (like collections' parent
* Passing a null #Main means that not all potential runtime data (like collections' parent
* pointers etc.) will be up-to-date. However, this should not be a problem here, since these
* data are re-generated later in file-read process anyway. */
BKE_lib_id_swap_full(nullptr,

View File

@ -176,7 +176,7 @@ bool BM_edge_uv_share_vert_check(BMEdge *e, BMLoop *l_a, BMLoop *l_b, const int
return false;
}
/* No need for NULL checks, these will always succeed. */
/* No need for null checks, these will always succeed. */
const BMLoop *l_other_a = BM_loop_other_vert_loop_by_edge(l_a, e);
const BMLoop *l_other_b = BM_loop_other_vert_loop_by_edge(l_b, e);

View File

@ -31,7 +31,7 @@ void GPencilBackup::restore_to_gpencil(bGPdata *gpd)
BKE_gpencil_free_update_cache(gpd_orig);
}
/* Doing a copy-on-write copies the update cache pointer. Make sure to reset it
* to NULL as we should never use the update cache from eval data. */
* to null as we should never use the update cache from eval data. */
gpd->runtime.update_cache = nullptr;
/* Make sure to update the original runtime pointers in the eval data. */
BKE_gpencil_data_update_orig_pointers(gpd_orig, gpd);

View File

@ -195,8 +195,8 @@ enum {
CU_DATATYPE_TEXT_SELECT = 1 << 4,
};
/*
* ob_curve_cache can be NULL
/**
* \param ob_curve_cache: can be null.
*/
static CurveRenderData *curve_render_data_create(Curve *cu,
CurveCache *ob_curve_cache,

View File

@ -243,7 +243,7 @@ void sculpt_undo_print_nodes(Object *ob, void *active)
UndoStack *ustack = ED_undo_stack_get();
UndoStep *us = ustack->steps.first;
if (active == NULL) {
if (active == nullptr) {
active = ustack->step_active;
}
@ -1822,7 +1822,7 @@ void SCULPT_undo_push_end_ex(Object *ob, const bool use_nested_undo)
ustack, BKE_UNDOSYS_TYPE_SCULPT);
sculpt_save_active_attribute(ob, &us->active_color_end);
sculpt_undo_print_nodes(ob, NULL);
sculpt_undo_print_nodes(ob, nullptr);
}
/* -------------------------------------------------------------------- */
@ -1922,7 +1922,7 @@ static void sculpt_undosys_step_decode_undo_impl(bContext *C,
sculpt_undo_restore_list(C, depsgraph, &us->data.nodes);
us->step.is_applied = false;
sculpt_undo_print_nodes(CTX_data_active_object(C), NULL);
sculpt_undo_print_nodes(CTX_data_active_object(C), nullptr);
}
static void sculpt_undosys_step_decode_redo_impl(bContext *C,
@ -1934,7 +1934,7 @@ static void sculpt_undosys_step_decode_redo_impl(bContext *C,
sculpt_undo_restore_list(C, depsgraph, &us->data.nodes);
us->step.is_applied = true;
sculpt_undo_print_nodes(CTX_data_active_object(C), NULL);
sculpt_undo_print_nodes(CTX_data_active_object(C), nullptr);
}
static void sculpt_undosys_step_decode_undo(bContext *C,

View File

@ -1062,7 +1062,7 @@ void ED_image_undosys_type(UndoType *ut)
/* NOTE: this is actually a confusing case, since it expects a valid context, but only in a
* specific case, see `image_undosys_step_encode` code. We cannot specify
* `UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE` though, as it can be called with a NULL context by
* `UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE` though, as it can be called with a null context by
* current code. */
ut->flags = UNDOTYPE_FLAG_DECODE_ACTIVE_STEP;

View File

@ -243,7 +243,7 @@ static int outliner_get_insert_index(TreeElement *drag_te,
TreeElementInsertType insert_type,
ListBase *listbase)
{
/* Find the element to insert after. NULL is the start of the list. */
/* Find the element to insert after. Null is the start of the list. */
if (drag_te->index < drop_te->index) {
if (insert_type == TE_INSERT_BEFORE) {
drop_te = drop_te->prev;

View File

@ -1279,7 +1279,8 @@ static int outliner_open_back(TreeElement *te)
return retval;
}
/* Return element representing the active base or bone in the outliner, or NULL if none exists
/**
* \return element representing the active base or bone in the outliner, or null if none exists
*/
static TreeElement *outliner_show_active_get_element(bContext *C,
SpaceOutliner *space_outliner,

View File

@ -51,7 +51,7 @@ ListBase TreeDisplayLibraries::buildTree(const TreeSourceData &source_data)
for (ID *id : List<ID>(source_data.bmain->libraries)) {
Library *lib = reinterpret_cast<Library *>(id);
TreeElement *ten = add_library_contents(*source_data.bmain, tree, lib);
/* NULL-check matters, due to filtering there may not be a new element. */
/* Null-check matters, due to filtering there may not be a new element. */
if (ten) {
lib->id.newid = (ID *)ten;
}

View File

@ -117,7 +117,7 @@ BMLoop *ED_uvedit_active_vert_loop_get(BMesh *bm)
if (ese && ese->prev) {
BMEditSelection *ese_prev = ese->prev;
if ((ese->htype == BM_VERT) && (ese_prev->htype == BM_FACE)) {
/* May be NULL. */
/* May be null. */
return BM_face_vert_share_loop((BMFace *)ese_prev->ele, (BMVert *)ese->ele);
}
}
@ -139,7 +139,7 @@ BMLoop *ED_uvedit_active_edge_loop_get(BMesh *bm)
if (ese && ese->prev) {
BMEditSelection *ese_prev = ese->prev;
if ((ese->htype == BM_EDGE) && (ese_prev->htype == BM_FACE)) {
/* May be NULL. */
/* May be null. */
return BM_face_edge_share_loop((BMFace *)ese_prev->ele, (BMEdge *)ese->ele);
}
}
@ -2541,7 +2541,7 @@ static bool uv_mouse_select_multi(bContext *C,
}
else {
/* Vertex or island. For island (if we were using #uv_find_nearest_face_multi_ex, see above),
* `hit.l` is NULL, use `hit.efa` instead. */
* `hit.l` is null, use `hit.efa` instead. */
if (hit.l != nullptr) {
is_selected = uvedit_uv_select_test(scene, hit.l, offsets);
}

View File

@ -1166,7 +1166,7 @@ static int stitch_process_data(StitchStateContainer *ssc,
/* copy data from UVs to the preview display buffers */
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
/* just to test if face was added for processing.
* uvs of unselected vertices will return NULL */
* uvs of unselected vertices will return null */
UvElement *element = BM_uv_element_get(state->element_map, BM_FACE_FIRST_LOOP(efa));
if (element) {

View File

@ -3026,7 +3026,7 @@ static void p_chart_lscm_begin(PChart *chart, bool live, bool abf)
p_chart_boundaries(chart, &outer);
/* Outer can be NULL with non-finite coords. */
/* Outer can be null with non-finite coordinates. */
if (!(outer && p_chart_symmetry_pins(chart, outer, &pin1, &pin2))) {
p_chart_extrema_verts(chart, &pin1, &pin2);
}

View File

@ -55,7 +55,7 @@ static void vertex_buffer_fetch_mode(ColorType color)
GPU_vertbuf_vert_set(vbo, i, &data[i]);
}
GPUBatch *batch = GPU_batch_create(GPU_PRIM_TRI_FAN, vbo, NULL);
GPUBatch *batch = GPU_batch_create(GPU_PRIM_TRI_FAN, vbo, nullptr);
GPU_batch_program_set_builtin(batch, GPU_SHADER_3D_FLAT_COLOR);
GPU_batch_draw(batch);

View File

@ -22,7 +22,7 @@ VKVertexAttributeObject::VKVertexAttributeObject()
void VKVertexAttributeObject::clear()
{
is_valid = false;
info.pNext = NULL;
info.pNext = nullptr;
bindings.clear();
attributes.clear();
vbos.clear();

View File

@ -53,7 +53,7 @@ void CustomPropertiesExporter::write(const IDProperty *id_property)
switch (id_property->type) {
case IDP_STRING: {
/* The Alembic library doesn't accept NULL-terminated character arrays. */
/* The Alembic library doesn't accept null-terminated character arrays. */
const std::string prop_value(IDP_String(id_property), id_property->len - 1);
set_scalar_property<OStringArrayProperty, std::string>(id_property->name, prop_value);
break;

View File

@ -230,7 +230,7 @@ bool ABC_export(Scene *scene,
WM_jobs_start(CTX_wm_manager(C), wm_job);
}
else {
/* Fake a job context, so that we don't need NULL pointer checks while exporting. */
/* Fake a job context, so that we don't need null pointer checks while exporting. */
bool stop = false, do_update = false;
float progress = 0.0f;

View File

@ -159,7 +159,7 @@ void ABCHairWriter::write_hair_sample(const HierarchyContext &context,
const int num = pa->num_dmcache >= 0 ? pa->num_dmcache : pa->num;
if (num < mesh->totface) {
/* TODO(Sybren): check whether the NULL check here and if(mface) are actually required
/* TODO(Sybren): check whether the null check here and if(mface) are actually required
*/
const MFace *face = mface == nullptr ? nullptr : &mface[num];
MTFace *tface = mtface + num;

View File

@ -719,7 +719,7 @@ bool ABC_import(bContext *C,
WM_jobs_start(CTX_wm_manager(C), wm_job);
}
else {
/* Fake a job context, so that we don't need NULL pointer checks while importing. */
/* Fake a job context, so that we don't need null pointer checks while importing. */
bool stop = false, do_update = false;
float progress = 0.0f;

View File

@ -383,7 +383,7 @@ static void create_temp_path_for_usdz_export(const char *filepath,
static void set_job_filepath(blender::io::usd::ExportJobData *job, const char *filepath)
{
if (BLI_path_extension_check_n(filepath, ".usdz", NULL)) {
if (BLI_path_extension_check_n(filepath, ".usdz", nullptr)) {
create_temp_path_for_usdz_export(filepath, job);
return;
}
@ -432,7 +432,7 @@ bool USD_export(bContext *C,
WM_jobs_start(CTX_wm_manager(C), wm_job);
}
else {
/* Fake a job context, so that we don't need NULL pointer checks while exporting. */
/* Fake a job context, so that we don't need null pointer checks while exporting. */
bool stop = false, do_update = false;
float progress = 0.0f;

View File

@ -459,7 +459,7 @@ bool USD_import(struct bContext *C,
WM_jobs_start(CTX_wm_manager(C), wm_job);
}
else {
/* Fake a job context, so that we don't need NULL pointer checks while importing. */
/* Fake a job context, so that we don't need null pointer checks while importing. */
bool stop = false, do_update = false;
float progress = 0.0f;

View File

@ -343,7 +343,7 @@ static bool rna_path_parse_array_index(const char **path,
* that represent the whole given \a path).
* \param eval_pointer: If \a true, and \a path leads to a Pointer property, or an item in a
* Collection property, \a r_ptr will be set to the value of that property,
* and \a r_prop will be NULL.
* and \a r_prop will be null.
* Mutually exclusive with \a r_item_ptr.
*
* \return \a true on success, \a false if the path is somehow invalid.
@ -846,7 +846,7 @@ static char *rna_idp_path(PointerRNA *ptr,
if (prop->type == PROP_POINTER) {
PointerRNA child_ptr = RNA_property_pointer_get(ptr, prop);
if (RNA_pointer_is_null(&child_ptr)) {
/* Pointer ID prop might be a 'leaf' in the IDProp group hierarchy, in which case a NULL
/* Pointer ID prop might be a 'leaf' in the IDProp group hierarchy, in which case a null
* value is perfectly valid. Just means it won't match the searched needle. */
continue;
}
@ -874,7 +874,7 @@ static char *rna_idp_path(PointerRNA *ptr,
if (RNA_property_collection_lookup_int(ptr, prop, j, &child_ptr)) {
if (RNA_pointer_is_null(&child_ptr)) {
/* Array item ID prop might be a 'leaf' in the IDProp group hierarchy, in which case
* a NULL value is perfectly valid. Just means it won't match the searched needle. */
* a null value is perfectly valid. Just means it won't match the searched needle. */
continue;
}
link.index = j;
@ -1024,7 +1024,7 @@ char *RNA_path_from_real_ID_to_struct(Main *bmain, const PointerRNA *ptr, ID **r
{
char *path = RNA_path_from_ID_to_struct(ptr);
/* NULL path is valid in that case, when given struct is an ID one... */
/* Null path is valid in that case, when given struct is an ID one. */
return rna_prepend_real_ID_path(bmain, ptr->owner_id, path, r_real);
}
@ -1138,7 +1138,7 @@ char *RNA_path_from_real_ID_to_property_index(Main *bmain,
{
char *path = RNA_path_from_ID_to_property_index(ptr, prop, index_dim, index);
/* NULL path is always an error here, in that case do not return the 'fake ID from real ID' part
/* Null path is always an error here, in that case do not return the 'fake ID from real ID' part
* of the path either. */
return path != nullptr ? rna_prepend_real_ID_path(bmain, ptr->owner_id, path, r_real_id) :
nullptr;
@ -1231,7 +1231,7 @@ char *RNA_path_full_struct_py(const PointerRNA *ptr)
data_path = RNA_path_from_ID_to_struct(ptr);
/* XXX data_path may be NULL (see #36788),
/* XXX data_path may be null (see #36788),
* do we want to get the 'bpy.data.foo["bar"].(null)' stuff? */
ret = BLI_sprintfN("%s.%s", id_path, data_path);

View File

@ -546,7 +546,7 @@ void WM_exit_ex(bContext *C, const bool do_python, const bool do_user_exit_actio
* Don't run this code when `C` is null because #pyrna_unregister_class
* passes in `CTX_data_main(C)` to un-registration functions.
* Further: `addon_utils.disable_all()` may call into functions that expect a valid context,
* supporting all these code-paths with a NULL context is quite involved for such a corner-case.
* supporting all these code-paths with a null context is quite involved for such a corner-case.
*/
if (C) {
const char *imports[2] = {"addon_utils", nullptr};