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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-01-14 14:53:19 +0300
committerJacques Lucke <jacques@blender.org>2022-01-14 14:53:19 +0300
commit0a3de0305c35f3dbe472b87d4e8f98ff117aa3ad (patch)
tree9744a98e6a280ed506356df92c36b31fb1b3a911 /source/blender/editors/geometry
parentc9a8975de5555c716013d0c16058bdc401541965 (diff)
Cleanup: move attribute operators to c++
Diffstat (limited to 'source/blender/editors/geometry')
-rw-r--r--source/blender/editors/geometry/CMakeLists.txt6
-rw-r--r--source/blender/editors/geometry/geometry_attributes.cc (renamed from source/blender/editors/geometry/geometry_attributes.c)22
-rw-r--r--source/blender/editors/geometry/geometry_intern.hh (renamed from source/blender/editors/geometry/geometry_intern.h)2
-rw-r--r--source/blender/editors/geometry/geometry_ops.cc (renamed from source/blender/editors/geometry/geometry_ops.c)2
4 files changed, 16 insertions, 16 deletions
diff --git a/source/blender/editors/geometry/CMakeLists.txt b/source/blender/editors/geometry/CMakeLists.txt
index 75b334b9ec6..65b9633da98 100644
--- a/source/blender/editors/geometry/CMakeLists.txt
+++ b/source/blender/editors/geometry/CMakeLists.txt
@@ -29,10 +29,10 @@ set(INC_SYS
)
set(SRC
- geometry_attributes.c
- geometry_ops.c
+ geometry_attributes.cc
+ geometry_ops.cc
- geometry_intern.h
+ geometry_intern.hh
)
set(LIB
diff --git a/source/blender/editors/geometry/geometry_attributes.c b/source/blender/editors/geometry/geometry_attributes.cc
index 5cb491f116a..9c0f6728701 100644
--- a/source/blender/editors/geometry/geometry_attributes.c
+++ b/source/blender/editors/geometry/geometry_attributes.cc
@@ -35,14 +35,14 @@
#include "ED_object.h"
-#include "geometry_intern.h"
+#include "geometry_intern.hh"
/*********************** Attribute Operators ************************/
static bool geometry_attributes_poll(bContext *C)
{
Object *ob = ED_object_context(C);
- ID *data = (ob) ? ob->data : NULL;
+ ID *data = (ob) ? static_cast<ID *>(ob->data) : nullptr;
return (ob && !ID_IS_LINKED(ob) && data && !ID_IS_LINKED(data)) &&
BKE_id_attributes_supported(data);
}
@@ -54,8 +54,8 @@ static bool geometry_attributes_remove_poll(bContext *C)
}
Object *ob = ED_object_context(C);
- ID *data = (ob) ? ob->data : NULL;
- if (BKE_id_attributes_active_get(data) != NULL) {
+ ID *data = (ob) ? static_cast<ID *>(ob->data) : nullptr;
+ if (BKE_id_attributes_active_get(data) != nullptr) {
return true;
}
@@ -67,22 +67,22 @@ static const EnumPropertyItem *geometry_attribute_domain_itemf(bContext *C,
PropertyRNA *UNUSED(prop),
bool *r_free)
{
- if (C == NULL) {
+ if (C == nullptr) {
return DummyRNA_NULL_items;
}
Object *ob = ED_object_context(C);
- if (ob == NULL) {
+ if (ob == nullptr) {
return DummyRNA_NULL_items;
}
- return rna_enum_attribute_domain_itemf(ob->data, r_free);
+ return rna_enum_attribute_domain_itemf(static_cast<ID *>(ob->data), r_free);
}
static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
- ID *id = ob->data;
+ ID *id = static_cast<ID *>(ob->data);
char name[MAX_NAME];
RNA_string_get(op->ptr, "name", name);
@@ -90,7 +90,7 @@ static int geometry_attribute_add_exec(bContext *C, wmOperator *op)
AttributeDomain domain = (AttributeDomain)RNA_enum_get(op->ptr, "domain");
CustomDataLayer *layer = BKE_id_attribute_new(id, name, type, domain, op->reports);
- if (layer == NULL) {
+ if (layer == nullptr) {
return OPERATOR_CANCELLED;
}
@@ -144,10 +144,10 @@ void GEOMETRY_OT_attribute_add(wmOperatorType *ot)
static int geometry_attribute_remove_exec(bContext *C, wmOperator *op)
{
Object *ob = ED_object_context(C);
- ID *id = ob->data;
+ ID *id = static_cast<ID *>(ob->data);
CustomDataLayer *layer = BKE_id_attributes_active_get(id);
- if (layer == NULL) {
+ if (layer == nullptr) {
return OPERATOR_CANCELLED;
}
diff --git a/source/blender/editors/geometry/geometry_intern.h b/source/blender/editors/geometry/geometry_intern.hh
index 8a0f9294722..14992476edd 100644
--- a/source/blender/editors/geometry/geometry_intern.h
+++ b/source/blender/editors/geometry/geometry_intern.hh
@@ -25,6 +25,6 @@
struct wmOperatorType;
-/* *** geometry_attributes.c *** */
+/* *** geometry_attributes.cc *** */
void GEOMETRY_OT_attribute_add(struct wmOperatorType *ot);
void GEOMETRY_OT_attribute_remove(struct wmOperatorType *ot);
diff --git a/source/blender/editors/geometry/geometry_ops.c b/source/blender/editors/geometry/geometry_ops.cc
index ed0aeda731b..ba8afe0e62f 100644
--- a/source/blender/editors/geometry/geometry_ops.c
+++ b/source/blender/editors/geometry/geometry_ops.cc
@@ -25,7 +25,7 @@
#include "ED_geometry.h"
-#include "geometry_intern.h"
+#include "geometry_intern.hh"
/**************************** registration **********************************/