Fix out-of-date slot type sizes.
authorNicholas Bishop <nicholasbishop@gmail.com>
Fri, 30 Mar 2012 13:49:32 +0000 (13:49 +0000)
committerNicholas Bishop <nicholasbishop@gmail.com>
Fri, 30 Mar 2012 13:49:32 +0000 (13:49 +0000)
The BMO_OPSLOT_TYPEINFO array was out of date, the last two entries
were off by one. Updated with correct values and added comments to
make it easier to match up in future.

Also changed the alloc string for mapping slot's ghash to something
more descriptive than "bemsh op".

source/blender/bmesh/intern/bmesh_operators.c

index d658b9a5bf27f17030eec43549c3ee7051466b02..3c348b91f7841289db96a6d8dcb3802ea0d5c4b9 100644 (file)
@@ -64,16 +64,17 @@ static const char *bmo_error_messages[] = {
 
 /* operator slot type information - size of one element of the type given. */
 const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES] = {
-       0,
-       sizeof(int),
-       sizeof(int),
-       sizeof(float),
-       sizeof(void *),
-       0, /* unused */
-       0, /* unused */
-       0, /* unused */
-       sizeof(void *), /* pointer buffer */
-       sizeof(BMOElemMapping)
+       0,                      /*  0: BMO_OP_SLOT_SENTINEL */
+       sizeof(int),            /*  1: BMO_OP_SLOT_BOOL */ 
+       sizeof(int),            /*  2: BMO_OP_SLOT_INT */ 
+       sizeof(float),          /*  3: BMO_OP_SLOT_FLT */ 
+       sizeof(void *),         /*  4: BMO_OP_SLOT_PNT */ 
+       sizeof(void *),         /*  5: BMO_OP_SLOT_PNT */
+       0,                      /*  6: unused */
+       0,                      /*  7: unused */
+       sizeof(float) * 3,      /*  8: BMO_OP_SLOT_VEC */
+       sizeof(void *),         /*  9: BMO_OP_SLOT_ELEMENT_BUF */
+       sizeof(BMOElemMapping)  /* 10: BMO_OP_SLOT_MAPPING */
 };
 
 /* Dummy slot so there is something to return when slot name lookup fails */
@@ -546,7 +547,7 @@ void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname
 
        if (!slot->data.ghash) {
                slot->data.ghash = BLI_ghash_new(BLI_ghashutil_ptrhash,
-                                                BLI_ghashutil_ptrcmp, "bmesh op");
+                                                BLI_ghashutil_ptrcmp, "bmesh slot map hash");
        }
 
        BLI_ghash_insert(slot->data.ghash, element, mapping);