diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 09:48:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-06-04 09:49:47 +0300 |
commit | 854db8951bc15a7545eea3ff2219a28897698ead (patch) | |
tree | d4cfda4e24ef81faa442d09f4f91559898146581 /source/blender/bmesh/intern/bmesh_operators.c | |
parent | ba65f7093b39a8e5f1fb869cbc347fb810a05ab9 (diff) |
Cleanup: strip trailing space in bmesh module
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_operators.c')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operators.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index f814767a200..62d892712fd 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -65,10 +65,10 @@ BLI_STATIC_ASSERT(ARRAY_SIZE(bmo_error_messages) + 1 == BMERR_TOTAL, "message mi /* operator slot type information - size of one element of the type given. */ const int BMO_OPSLOT_TYPEINFO[BMO_OP_SLOT_TOTAL_TYPES] = { 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(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 */ @@ -185,7 +185,7 @@ void BMO_op_init(BMesh *bm, BMOperator *op, const int flag, const char *opname) op->type = opcode; op->type_flag = bmo_opdefines[opcode]->type_flag; op->flag = flag; - + /* initialize the operator slot types */ bmo_op_slots_init(bmo_opdefines[opcode]->slot_types_in, op->slots_in); bmo_op_slots_init(bmo_opdefines[opcode]->slot_types_out, op->slots_out); @@ -217,10 +217,10 @@ void BMO_op_exec(BMesh *bm, BMOperator *op) if (bm->toolflag_index == 1) bmesh_edit_begin(bm, op->type_flag); op->exec(bm, op); - + if (bm->toolflag_index == 1) bmesh_edit_end(bm, op->type_flag); - + BMO_pop(bm); } @@ -406,7 +406,7 @@ void BMO_slot_mat_set(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS], cons slot->len = 4; slot->data.p = BLI_memarena_alloc(op->arena, sizeof(float) * 4 * 4); - + if (size == 4) { copy_m4_m4(slot->data.p, (float (*)[4])mat); } @@ -661,7 +661,7 @@ int BMO_slot_buffer_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot { BMOpSlot *slot = BMO_slot_get(slot_args, slot_name); BLI_assert(slot->slot_type == BMO_OP_SLOT_ELEMENT_BUF); - + /* check if its actually a buffer */ if (slot->slot_type != BMO_OP_SLOT_ELEMENT_BUF) return 0; @@ -697,7 +697,7 @@ void *bmo_slot_buffer_grow(BMesh *bm, BMOperator *op, int slot_code, int totadd) BMOpSlot *slot = &op->slots[slot_code]; void *tmp; ssize_t allocsize; - + BLI_assert(slot->slottype == BMO_OP_SLOT_ELEMENT_BUF); /* check if its actually a buffer */ @@ -760,7 +760,7 @@ void *BMO_slot_buffer_alloc(BMOperator *op, BMOpSlot slot_args[BMO_OP_MAX_SLOTS] /* check if its actually a buffer */ if (slot->slot_type != BMO_OP_SLOT_ELEMENT_BUF) return NULL; - + slot->len = len; if (len) { slot->data.buf = BLI_memarena_alloc(op->arena, BMO_OPSLOT_TYPEINFO[slot->slot_type] * len); @@ -783,7 +783,7 @@ void BMO_slot_buffer_from_all( { BMOpSlot *output = BMO_slot_get(slot_args, slot_name); int totelement = 0, i = 0; - + BLI_assert(output->slot_type == BMO_OP_SLOT_ELEMENT_BUF); BLI_assert(((output->slot_subtype.elem & BM_ALL_NOLOOP) & htype) == htype); @@ -1365,7 +1365,7 @@ static void bmo_flag_layer_clear(BMesh *bm) void *BMO_slot_buffer_get_first(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_name) { BMOpSlot *slot = BMO_slot_get(slot_args, slot_name); - + if (slot->slot_type != BMO_OP_SLOT_ELEMENT_BUF) return NULL; @@ -1505,14 +1505,14 @@ void BMO_error_clear(BMesh *bm) void BMO_error_raise(BMesh *bm, BMOperator *owner, int errcode, const char *msg) { BMOpError *err = MEM_callocN(sizeof(BMOpError), "bmop_error"); - + err->errorcode = errcode; if (!msg) { msg = bmo_error_messages[errcode]; } err->msg = msg; err->op = owner; - + BLI_addhead(&bm->errorstack, err); } @@ -1531,17 +1531,17 @@ int BMO_error_get(BMesh *bm, const char **msg, BMOperator **op) if (msg) *msg = err->msg; if (op) *op = err->op; - + return err->errorcode; } int BMO_error_pop(BMesh *bm, const char **msg, BMOperator **op) { int errorcode = BMO_error_get(bm, msg, op); - + if (errorcode) { BMOpError *err = bm->errorstack.first; - + BLI_remlink(&bm->errorstack, bm->errorstack.first); MEM_freeN(err); } @@ -1680,7 +1680,7 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, /* we muck around in here, so dup it */ fmt = ofmt = BLI_strdup(_fmt); - + /* find operator name */ i = strcspn(fmt, " "); @@ -1689,7 +1689,7 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, opname[i] = '\0'; fmt += i + (noslot ? 0 : 1); - + i = BMO_opcode_from_opname_check(opname); if (i == -1) { @@ -1700,7 +1700,7 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, BMO_op_init(bm, op, flag, opname); // def = bmo_opdefines[i]; - + i = 0; state = true; /* false: not inside slot_code name, true: inside slot_code name */ @@ -1709,7 +1709,7 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, /* jump past leading whitespace */ i = strspn(fmt, " "); fmt += i; - + /* ignore trailing whitespace */ if (!fmt[i]) break; @@ -1725,9 +1725,9 @@ bool BMO_op_vinitf(BMesh *bm, BMOperator *op, const int flag, const char *_fmt, if (bmo_name_to_slotcode_check(op->slots_in, fmt) < 0) { GOTO_ERROR("name to slot code check failed"); } - + BLI_strncpy(slot_name, fmt, sizeof(slot_name)); - + state = false; fmt += i; } |