diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-29 15:45:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-30 11:17:09 +0300 |
commit | 0ed2e254bbfced045bc5651f65b41e2ba9cf9b35 (patch) | |
tree | 6e28175703368c9c7194148d08b6333d23829885 | |
parent | cb22caa8c78ad2f4453a83683c97effb7fde862d (diff) |
Use enum for custom data allocation type
Allows to easily see human readable value in debugger.
-rw-r--r-- | source/blender/blenkernel/BKE_customdata.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h index 51cd4da183a..a9ded0b8356 100644 --- a/source/blender/blenkernel/BKE_customdata.h +++ b/source/blender/blenkernel/BKE_customdata.h @@ -67,12 +67,14 @@ extern const CustomDataMask CD_MASK_EVERYTHING; * CD_NUMTYPES elements, that indicate if a layer can be copied. */ /* add/copy/merge allocation types */ -#define CD_ASSIGN 0 /* use the data pointer */ -#define CD_CALLOC 1 /* allocate blank memory */ -#define CD_DEFAULT 2 /* allocate and set to default */ -#define CD_REFERENCE 3 /* use data pointers, set layer flag NOFREE */ -#define CD_DUPLICATE 4 /* do a full copy of all layers, only allowed if source - * has same number of elements */ +typedef enum CDAllocType { + CD_ASSIGN = 0, /* use the data pointer */ + CD_CALLOC = 1, /* allocate blank memory */ + CD_DEFAULT = 2, /* allocate and set to default */ + CD_REFERENCE = 3, /* use data pointers, set layer flag NOFREE */ + CD_DUPLICATE = 4, /* do a full copy of all layers, only allowed if source + * has same number of elements */ +} CDAllocType; #define CD_TYPE_AS_MASK(_type) (CustomDataMask)((CustomDataMask)1 << (CustomDataMask)(_type)) |