[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48428] trunk/blender/source/blender: code cleanup: rename some members of bmesh operators, 'slots' is a C++ keyword which confuses some IDE's.

Campbell Barton ideasman42 at gmail.com
Sat Jun 30 11:55:05 CEST 2012


Revision: 48428
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48428
Author:   campbellbarton
Date:     2012-06-30 09:55:04 +0000 (Sat, 30 Jun 2012)
Log Message:
-----------
code cleanup: rename some members of bmesh operators, 'slots' is a C++ keyword which confuses some IDE's.
also added missing BMO_op_vinitf args to comments.

Modified Paths:
--------------
    trunk/blender/source/blender/bmesh/intern/bmesh_operator_api.h
    trunk/blender/source/blender/bmesh/intern/bmesh_operator_api_inline.h
    trunk/blender/source/blender/bmesh/intern/bmesh_operators.c
    trunk/blender/source/blender/editors/transform/transform.c

Modified: trunk/blender/source/blender/bmesh/intern/bmesh_operator_api.h
===================================================================
--- trunk/blender/source/blender/bmesh/intern/bmesh_operator_api.h	2012-06-30 07:43:37 UTC (rev 48427)
+++ trunk/blender/source/blender/bmesh/intern/bmesh_operator_api.h	2012-06-30 09:55:04 UTC (rev 48428)
@@ -116,7 +116,7 @@
  * for when your defining an operator with BMOpDefine.*/
 
 typedef struct BMOpSlot {
-	int slottype;
+	int slot_type;
 	int len;
 	int flag;
 	int index; /* index within slot array */
@@ -132,16 +132,13 @@
 
 #define BMO_OP_MAX_SLOTS 16 /* way more than probably needed */
 
-#ifdef slots
-#undef slots
-#endif
-
 typedef struct BMOperator {
 	int type;
-	int slottype;
+	int slot_type;
 	int needflag;
 	int flag;
-	struct BMOpSlot slots[BMO_OP_MAX_SLOTS]; void (*exec)(BMesh *bm, struct BMOperator *op);
+	struct BMOpSlot slot_args[BMO_OP_MAX_SLOTS];
+	void (*exec)(BMesh *bm, struct BMOperator *op);
 	struct MemArena *arena;
 } BMOperator;
 
@@ -154,7 +151,7 @@
 
 typedef struct BMOpDefine {
 	const char *name;
-	BMOSlotType slottypes[BMO_OP_MAX_SLOTS];
+	BMOSlotType slot_types[BMO_OP_MAX_SLOTS];
 	void (*exec)(BMesh *bm, BMOperator *op);
 	int flag;
 } BMOpDefine;
@@ -201,7 +198,7 @@
  * . . .will execute the delete operator, feeding in selected faces, deleting them.
  *
  * the basic format for the format string is:
- *   [operatorname] [slotname]=%[code] [slotname]=%[code]
+ *   [operatorname] [slot_name]=%[code] [slot_name]=%[code]
  *
  * as in printf, you pass in one additional argument to the function
  * for every code.
@@ -246,10 +243,10 @@
 int BMO_op_vinitf(BMesh *bm, BMOperator *op, const char *fmt, va_list vlist);
 
 /* test whether a named slot exists */
-int BMO_slot_exists(BMOperator *op, const char *slotname);
+int BMO_slot_exists(BMOperator *op, const char *slot_name);
 
 /* get a pointer to a slot.  this may be removed layer on from the public API. */
-BMOpSlot *BMO_slot_get(BMOperator *op, const char *slotname);
+BMOpSlot *BMO_slot_get(BMOperator *op, const char *slot_name);
 
 /* copies the data of a slot from one operator to another.  src and dst are the
  * source/destination slot codes, respectively. */
@@ -270,30 +267,30 @@
 void BMO_op_flag_enable(BMesh *bm, BMOperator *op, const int op_flag);
 void BMO_op_flag_disable(BMesh *bm, BMOperator *op, const int op_flag);
 
-void  BMO_slot_float_set(BMOperator *op, const char *slotname, const float f);
-float BMO_slot_float_get(BMOperator *op, const char *slotname);
-void  BMO_slot_int_set(BMOperator *op, const char *slotname, const int i);
-int   BMO_slot_int_get(BMOperator *op, const char *slotname);
-void  BMO_slot_bool_set(BMOperator *op, const char *slotname, const int i);
-int   BMO_slot_bool_get(BMOperator *op, const char *slotname);
+void  BMO_slot_float_set(BMOperator *op, const char *slot_name, const float f);
+float BMO_slot_float_get(BMOperator *op, const char *slot_name);
+void  BMO_slot_int_set(BMOperator *op, const char *slot_name, const int i);
+int   BMO_slot_int_get(BMOperator *op, const char *slot_name);
+void  BMO_slot_bool_set(BMOperator *op, const char *slot_name, const int i);
+int   BMO_slot_bool_get(BMOperator *op, const char *slot_name);
 
 /* don't pass in arrays that are supposed to map to elements this way.
  *
  * so, e.g. passing in list of floats per element in another slot is bad.
  * passing in, e.g. pointer to an editmesh for the conversion operator is fine
  * though. */
-void  BMO_slot_ptr_set(BMOperator *op, const char *slotname, void *p);
-void *BMO_slot_ptr_get(BMOperator *op, const char *slotname);
-void  BMO_slot_vec_set(BMOperator *op, const char *slotname, const float vec[3]);
-void  BMO_slot_vec_get(BMOperator *op, const char *slotname, float r_vec[3]);
+void  BMO_slot_ptr_set(BMOperator *op, const char *slot_name, void *p);
+void *BMO_slot_ptr_get(BMOperator *op, const char *slot_name);
+void  BMO_slot_vec_set(BMOperator *op, const char *slot_name, const float vec[3]);
+void  BMO_slot_vec_get(BMOperator *op, const char *slot_name, float r_vec[3]);
 
 /* only supports square mats */
 /* size must be 3 or 4; this api is meant only for transformation matrices.
  * note that internally the matrix is stored in 4x4 form, and it's safe to
  * call whichever BMO_Get_Mat* function you want. */
-void BMO_slot_mat_set(BMOperator *op, const char *slotname, const float *mat, int size);
-void BMO_slot_mat4_get(BMOperator *op, const char *slotname, float r_mat[4][4]);
-void BMO_slot_mat3_set(BMOperator *op, const char *slotname, float r_mat[3][3]);
+void BMO_slot_mat_set(BMOperator *op, const char *slot_name, const float *mat, int size);
+void BMO_slot_mat4_get(BMOperator *op, const char *slot_name, float r_mat[4][4]);
+void BMO_slot_mat3_set(BMOperator *op, const char *slot_name, float r_mat[3][3]);
 
 void BMO_mesh_flag_disable_all(BMesh *bm, BMOperator *op, const char htype, const short oflag);
 
@@ -303,47 +300,47 @@
 
 /* puts every element of type 'type' (which is a bitmask) with tool
  * flag 'flag', into a slot. */
-void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_from_enabled_flag(BMesh *bm, BMOperator *op, const char *slot_name,
                                        const char htype, const short oflag);
 
 /* puts every element of type 'type' (which is a bitmask) without tool
  * flag 'flag', into a slot. */
-void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_from_disabled_flag(BMesh *bm, BMOperator *op, const char *slot_name,
                                         const char htype, const short oflag);
 
 /* tool-flags all elements inside an element slot array with flag flag. */
-void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_flag_enable(BMesh *bm, BMOperator *op, const char *slot_name,
                                  const char htype, const short oflag);
 /* clears tool-flag flag from all elements inside a slot array. */
-void BMO_slot_buffer_flag_disable(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_flag_disable(BMesh *bm, BMOperator *op, const char *slot_name,
                                   const char htype, const short oflag);
 
 /* tool-flags all elements inside an element slot array with flag flag. */
-void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_hflag_enable(BMesh *bm, BMOperator *op, const char *slot_name,
                                   const char htype, const char hflag, const char do_flush);
 /* clears tool-flag flag from all elements inside a slot array. */
-void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_buffer_hflag_disable(BMesh *bm, BMOperator *op, const char *slot_name,
                                    const char htype, const char hflag, const char do_flush);
 
 /* puts every element of type 'type' (which is a bitmask) with header
  * flag 'flag', into a slot.  note: ignores hidden elements
  * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
 void BMO_slot_buffer_from_enabled_hflag(BMesh *bm, BMOperator *op,
-                                        const char *slotname,
+                                        const char *slot_name,
                                         const char htype, const char hflag);
 
 /* puts every element of type 'type' (which is a bitmask) without
  * header flag 'flag', into a slot.  note: ignores hidden elements
  * (e.g. elements with header flag BM_ELEM_HIDDEN set).*/
 void BMO_slot_buffer_from_disabled_hflag(BMesh *bm, BMOperator *op,
-                                         const char *slotname,
+                                         const char *slot_name,
                                          const char htype, const char hflag);
 
 /* counts number of elements inside a slot array. */
-int BMO_slot_buffer_count(BMesh *bm, BMOperator *op, const char *slotname);
-int BMO_slot_map_count(BMesh *bm, BMOperator *op, const char *slotname);
+int BMO_slot_buffer_count(BMesh *bm, BMOperator *op, const char *slot_name);
+int BMO_slot_map_count(BMesh *bm, BMOperator *op, const char *slot_name);
 
-void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slotname,
+void BMO_slot_map_insert(BMesh *UNUSED(bm), BMOperator *op, const char *slot_name,
                          void *element, void *data, int len);
 
 /* Counts the number of edges with tool flag toolflag around
@@ -352,7 +349,7 @@
 
 /* flags all elements in a mapping.  note that the mapping must only have
  * bmesh elements in it.*/
-void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, const char *slotname,
+void BMO_slot_map_to_flag(BMesh *bm, BMOperator *op, const char *slot_name,
                           const char hflag, const short oflag);
 
 /* this part of the API is used to iterate over element buffer or
@@ -363,7 +360,7 @@
  *    BMOIter oiter;
  *    BMFace *f;
  *
- *    f = BMO_iter_new(&oiter, bm, some_operator, "slotname", BM_FACE);
+ *    f = BMO_iter_new(&oiter, bm, some_operator, "slot_name", BM_FACE);
  *    for (; f; f = BMO_iter_step(&oiter)) {
  *        /do something with the face
  *    }
@@ -373,7 +370,7 @@
  *    void *key;
  *    void *val;
  *
- *    key = BMO_iter_new(&oiter, bm, some_operator, "slotname", 0);
+ *    key = BMO_iter_new(&oiter, bm, some_operator, "slot_name", 0);
  *    for (; key; key = BMO_iter_step(&oiter)) {
  *        val = BMO_iter_map_value(&oiter);
  *        //do something with the key/val pair
@@ -396,10 +393,10 @@
 	char restrictmask; /* bitwise '&' with BMHeader.htype */
 } BMOIter;
 
-void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slotname);
+void *BMO_slot_buffer_elem_first(BMOperator *op, const char *slot_name);
 
 void *BMO_iter_new(BMOIter *iter, BMesh *bm, BMOperator *op,
-                   const char *slotname, const char restrictmask);
+                   const char *slot_name, const char restrictmask);
 void *BMO_iter_step(BMOIter *iter);
 
 /* returns a pointer to the key value when iterating over mappings.
@@ -412,8 +409,8 @@
 /* use this for float mappings */
 float BMO_iter_map_value_f(BMOIter *iter);
 
-#define BMO_ITER(ele, iter, bm, op, slotname, restrict)   \

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list