From c0bbc4abf53b406c947b3a0caa1b6a0898eba9c1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 15 Feb 2018 12:38:21 +0100 Subject: Cleanup: Remove BLI_ prefix from listbase macro This is kind of doesn't matter where macro itself is defined. We should stick to the following: - If some macro is actually more an inline function, follow regular function name conventions. - If macro is a macro, type it in capitals. Use module prefix if that helps readability or it if helps avoiding accidents. --- source/blender/blenlib/BLI_listbase.h | 14 ++++----- .../depsgraph/intern/builder/deg_builder_nodes.cc | 12 ++++---- .../intern/builder/deg_builder_nodes_rig.cc | 6 ++-- .../intern/builder/deg_builder_nodes_scene.cc | 8 ++--- .../intern/builder/deg_builder_relations.cc | 36 +++++++++++----------- .../intern/builder/deg_builder_relations_rig.cc | 8 ++--- .../intern/builder/deg_builder_relations_scene.cc | 6 ++-- source/blender/depsgraph/intern/depsgraph.cc | 2 +- source/blender/depsgraph/intern/depsgraph_tag.cc | 6 ++-- source/blender/editors/animation/anim_markers.c | 4 +-- 10 files changed, 51 insertions(+), 51 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index 2a0f4e6f814..92fb18bfe43 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -103,32 +103,32 @@ struct LinkData *BLI_genericNodeN(void *data); * * \code{.c} * - * BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) { + * LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) { * ...operate on marker... * } - * BLI_LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init); + * LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init); * * \endcode */ -#define BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init) \ +#define LISTBASE_CIRCULAR_FORWARD_BEGIN(lb, lb_iter, lb_init) \ if ((lb)->first && (lb_init || (lb_init = (lb)->first))) { \ lb_iter = lb_init; \ do { -#define BLI_LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init) \ +#define LISTBASE_CIRCULAR_FORWARD_END(lb, lb_iter, lb_init) \ } while ((lb_iter = (lb_iter)->next ? (lb_iter)->next : (lb)->first), \ (lb_iter != lb_init)); \ } -#define BLI_LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init) \ +#define LISTBASE_CIRCULAR_BACKWARD_BEGIN(lb, lb_iter, lb_init) \ if ((lb)->last && (lb_init || (lb_init = (lb)->last))) { \ lb_iter = lb_init; \ do { -#define BLI_LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init) \ +#define LISTBASE_CIRCULAR_BACKWARD_END(lb, lb_iter, lb_init) \ } while ((lb_iter = (lb_iter)->prev ? (lb_iter)->prev : (lb)->last), \ (lb_iter != lb_init)); \ } -#define BLI_LISTBASE_FOREACH(type, var, list) \ +#define LISTBASE_FOREACH(type, var, list) \ for (type var = (type)((list)->first); \ var != NULL; \ var = (type)(((Link*)(var))->next)) diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 1d18d6def8d..27bcc224ef5 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -305,7 +305,7 @@ void DepsgraphNodeBuilder::build_group(Base *base, Group *group) } group_id->tag |= LIB_TAG_DOIT; - BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) { + LISTBASE_FOREACH (GroupObject *, go, &group->gobject) { build_object(base, go->ob); } } @@ -524,7 +524,7 @@ void DepsgraphNodeBuilder::build_animdata(ID *id) } /* drivers */ - BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { + LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { /* create driver */ build_driver(id, fcu); } @@ -630,7 +630,7 @@ void DepsgraphNodeBuilder::build_rigidbody(Scene *scene) /* objects - simulation participants */ if (rbw->group) { - BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) { + LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) { Object *object = go->ob; if (!object || (object->type != OB_MESH)) @@ -671,7 +671,7 @@ void DepsgraphNodeBuilder::build_particles(Object *object) object), DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT); /* Build all particle systems. */ - BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { + LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { ParticleSettings *part = psys->part; /* Particle settings. */ // XXX: what if this is used more than once! @@ -766,7 +766,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Object *object) // TODO: "Done" operation /* Cloth modifier. */ - BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { + LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { if (md->type == eModifierType_Cloth) { build_cloth(object); } @@ -970,7 +970,7 @@ void DepsgraphNodeBuilder::build_nodetree(bNodeTree *ntree) op_node->set_as_exit(); /* nodetree's nodes... */ - BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { + LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { ID *id = bnode->id; if (id == NULL) { continue; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index 29cd72c13fd..1a6b3f89f26 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -195,7 +195,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object) op_node->set_as_exit(); /* bones */ - BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { /* Node for bone evaluation. */ op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, NULL, DEG_OPCODE_BONE_LOCAL); @@ -236,7 +236,7 @@ void DepsgraphNodeBuilder::build_rig(Object *object) * - Care is needed to ensure that multi-headed trees work out the same as in ik-tree building * - Animated chain-lengths are a problem... */ - BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { + LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { switch (con->type) { case CONSTRAINT_TYPE_KINEMATIC: build_ik_pose(object, pchan, con); @@ -275,7 +275,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object) op_node->set_as_entry(); - BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, NULL, DEG_OPCODE_BONE_LOCAL); op_node->set_as_entry(); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc index 4a487f13c3a..4bb15350f3a 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_scene.cc @@ -78,7 +78,7 @@ void DepsgraphNodeBuilder::build_scene(Scene *scene) /* Setup currently building context. */ scene_ = scene; /* scene objects */ - BLI_LISTBASE_FOREACH (Base *, base, &scene->base) { + LISTBASE_FOREACH (Base *, base, &scene->base) { Object *object = base->object; build_object(base, object); } @@ -103,15 +103,15 @@ void DepsgraphNodeBuilder::build_scene(Scene *scene) build_gpencil(scene->gpd); } /* Cache file. */ - BLI_LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) { + LISTBASE_FOREACH (CacheFile *, cachefile, &bmain_->cachefiles) { build_cachefile(cachefile); } /* Masks. */ - BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { + LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { build_mask(mask); } /* Movie clips. */ - BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { + LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { build_movieclip(clip); } /* Parameters evaluation for scene relations mainly. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 65f45186ba4..e01d5e53311 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -193,7 +193,7 @@ static bool particle_system_depends_on_time(ParticleSystem *psys) static bool object_particles_depends_on_time(Object *object) { - BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { + LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { if (particle_system_depends_on_time(psys)) { return true; } @@ -349,7 +349,7 @@ void DepsgraphRelationBuilder::add_forcefield_relations( { ListBase *effectors = pdInitEffectors(scene, object, psys, eff, false); if (effectors != NULL) { - BLI_LISTBASE_FOREACH(EffectorCache *, eff, effectors) { + LISTBASE_FOREACH(EffectorCache *, eff, effectors) { if (eff->ob != object) { ComponentKey eff_key(&eff->ob->id, DEG_NODE_TYPE_TRANSFORM); add_relation(eff_key, key, name); @@ -429,7 +429,7 @@ void DepsgraphRelationBuilder::build_group(Object *object, Group *group) OperationKey object_local_transform_key(object != NULL ? &object->id : NULL, DEG_NODE_TYPE_TRANSFORM, DEG_OPCODE_TRANSFORM_LOCAL); - BLI_LISTBASE_FOREACH (GroupObject *, go, &group->gobject) { + LISTBASE_FOREACH (GroupObject *, go, &group->gobject) { if (!group_done) { build_object(go->ob); } @@ -755,7 +755,7 @@ void DepsgraphRelationBuilder::build_constraints(ID *id, else if (cti->get_constraint_targets) { ListBase targets = {NULL, NULL}; cti->get_constraint_targets(con, &targets); - BLI_LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { + LISTBASE_FOREACH (bConstraintTarget *, ct, &targets) { if (ct->tar == NULL) { continue; } @@ -932,7 +932,7 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id) operation_from, &adt->action->curves); } - BLI_LISTBASE_FOREACH(NlaTrack *, nlt, &adt->nla_tracks) { + LISTBASE_FOREACH(NlaTrack *, nlt, &adt->nla_tracks) { build_animdata_nlastrip_targets(id, adt_key, operation_from, &nlt->strips); @@ -947,7 +947,7 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets( /* Iterate over all curves and build relations. */ PointerRNA id_ptr; RNA_id_pointer_create(id, &id_ptr); - BLI_LISTBASE_FOREACH(FCurve *, fcu, curves) { + LISTBASE_FOREACH(FCurve *, fcu, curves) { PointerRNA ptr; PropertyRNA *prop; int index; @@ -983,7 +983,7 @@ void DepsgraphRelationBuilder::build_animdata_nlastrip_targets( OperationDepsNode *operation_from, ListBase *strips) { - BLI_LISTBASE_FOREACH(NlaStrip *, strip, strips) { + LISTBASE_FOREACH(NlaStrip *, strip, strips) { if (strip->act != NULL) { build_animdata_curves_targets(id, adt_key, operation_from, @@ -1004,7 +1004,7 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id) return; } ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION); - BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { + LISTBASE_FOREACH (FCurve *, fcu, &adt->drivers) { OperationKey driver_key(id, DEG_NODE_TYPE_PARAMETERS, DEG_OPCODE_DRIVER, @@ -1028,7 +1028,7 @@ void DepsgraphRelationBuilder::build_animdata_drivers(ID *id) */ if (fcu->array_index > 0) { FCurve *fcu_prev = NULL; - BLI_LISTBASE_FOREACH (FCurve *, fcu_candidate, &adt->drivers) { + LISTBASE_FOREACH (FCurve *, fcu_candidate, &adt->drivers) { /* Writing to different RNA paths is */ const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; if (!STREQ(fcu_candidate->rna_path, rna_path)) { @@ -1158,7 +1158,7 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) const char *rna_path = fcu->rna_path ? fcu->rna_path : ""; const RNAPathKey self_key(id, rna_path); - BLI_LISTBASE_FOREACH (DriverVar *, dvar, &driver->variables) { + LISTBASE_FOREACH (DriverVar *, dvar, &driver->variables) { /* Only used targets. */ DRIVER_TARGETS_USED_LOOPER(dvar) { @@ -1273,7 +1273,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* objects - simulation participants */ if (rbw->group) { - BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) { + LISTBASE_FOREACH (GroupObject *, go, &rbw->group->gobject) { Object *object = go->ob; if (object == NULL || object->type != OB_MESH) { continue; @@ -1327,7 +1327,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) /* constraints */ if (rbw->constraints) { - BLI_LISTBASE_FOREACH (GroupObject *, go, &rbw->constraints->gobject) { + LISTBASE_FOREACH (GroupObject *, go, &rbw->constraints->gobject) { Object *object = go->ob; if (object == NULL || !object->rigidbody_constraint) { continue; @@ -1363,7 +1363,7 @@ void DepsgraphRelationBuilder::build_particles(Object *object) DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT); /* Particle systems. */ - BLI_LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { + LISTBASE_FOREACH (ParticleSystem *, psys, &object->particlesystem) { ParticleSettings *part = psys->part; /* Animation of particle settings, */ build_animdata(&part->id); @@ -1409,8 +1409,8 @@ void DepsgraphRelationBuilder::build_particles(Object *object) "Particle Field"); /* Boids. */ if (part->boids) { - BLI_LISTBASE_FOREACH (BoidState *, state, &part->boids->states) { - BLI_LISTBASE_FOREACH (BoidRule *, rule, &state->rules) { + LISTBASE_FOREACH (BoidState *, state, &part->boids->states) { + LISTBASE_FOREACH (BoidRule *, rule, &state->rules) { Object *ruleob = NULL; if (rule->type == eBoidRuleType_Avoid) { ruleob = ((BoidRuleGoalAvoid *)rule)->ob; @@ -1441,7 +1441,7 @@ void DepsgraphRelationBuilder::build_particles(Object *object) case PART_DRAW_GR: if (part->dup_group != NULL) { build_group(NULL, part->dup_group); - BLI_LISTBASE_FOREACH (GroupObject *, go, &part->dup_group->gobject) { + LISTBASE_FOREACH (GroupObject *, go, &part->dup_group->gobject) { build_particles_visualization_object(object, psys, go->ob); @@ -1563,7 +1563,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *object) DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_UBEREVAL); - BLI_LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { + LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { const ModifierTypeInfo *mti = modifierType_getInfo((ModifierType)md->type); if (mti->updateDepsgraph) { DepsNodeHandle handle = create_node_handle(obdata_ubereval_key); @@ -1756,7 +1756,7 @@ void DepsgraphRelationBuilder::build_nodetree(bNodeTree *ntree) DEG_OPCODE_PARAMETERS_EVAL); /* nodetree's nodes... */ - BLI_LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { + LISTBASE_FOREACH (bNode *, bnode, &ntree->nodes) { ID *id = bnode->id; if (id == NULL) { continue; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 4a822fe7477..30d77a968eb 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -341,8 +341,8 @@ void DepsgraphRelationBuilder::build_rig(Object *object) */ RootPChanMap root_map; bool pose_depends_on_local_transform = false; - BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { - BLI_LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { + LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + LISTBASE_FOREACH (bConstraint *, con, &pchan->constraints) { switch (con->type) { case CONSTRAINT_TYPE_KINEMATIC: build_ik_pose(object, pchan, con, &root_map); @@ -382,7 +382,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object) } /* links between operations for each bone */ - BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); OperationKey bone_pose_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT); OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY); @@ -451,7 +451,7 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object) OperationKey pose_done_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE); - BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { + LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc index 93b4f77bb6e..c51addbd206 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_scene.cc @@ -76,7 +76,7 @@ void DepsgraphRelationBuilder::build_scene(Scene *scene) /* Setup currently building context. */ scene_ = scene; /* Scene objects. */ - BLI_LISTBASE_FOREACH (Base *, base, &scene->base) { + LISTBASE_FOREACH (Base *, base, &scene->base) { Object *object = base->object; build_object(object); } @@ -101,11 +101,11 @@ void DepsgraphRelationBuilder::build_scene(Scene *scene) build_gpencil(scene->gpd); } /* Masks. */ - BLI_LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { + LISTBASE_FOREACH (Mask *, mask, &bmain_->mask) { build_mask(mask); } /* Movie clips. */ - BLI_LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { + LISTBASE_FOREACH (MovieClip *, clip, &bmain_->movieclip) { build_movieclip(clip); } for (Depsgraph::OperationNodes::const_iterator it_op = graph_->operations.begin(); diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index a016d623ea9..997e7ad1d40 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -155,7 +155,7 @@ static bool pointer_to_component_node_criteria( return true; } else if (object->pose != NULL) { - BLI_LISTBASE_FOREACH(bPoseChannel *, pchan, &object->pose->chanbase) { + LISTBASE_FOREACH(bPoseChannel *, pchan, &object->pose->chanbase) { if (BLI_findindex(&pchan->constraints, con) != -1) { /* bone transforms */ *type = DEG_NODE_TYPE_BONE; diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index d9f6fb07ae3..3ee7ef83320 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -328,12 +328,12 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene) return; } /* Special trick to get local view to work. */ - BLI_LISTBASE_FOREACH (Base *, base, &scene->base) { + LISTBASE_FOREACH (Base *, base, &scene->base) { Object *object = base->object; DEG::IDDepsNode *id_node = graph->find_id_node(&object->id); id_node->layers = 0; } - BLI_LISTBASE_FOREACH (Base *, base, &scene->base) { + LISTBASE_FOREACH (Base *, base, &scene->base) { Object *object = base->object; DEG::IDDepsNode *id_node = graph->find_id_node(&object->id); id_node->layers |= base->lay; @@ -343,7 +343,7 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene) } } DEG::deg_graph_build_flush_layers(graph); - BLI_LISTBASE_FOREACH (Base *, base, &scene->base) { + LISTBASE_FOREACH (Base *, base, &scene->base) { Object *object = base->object; DEG::IDDepsNode *id_node = graph->find_id_node(&object->id); GHASH_FOREACH_BEGIN(DEG::ComponentDepsNode *, comp, id_node->components) diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 04398e88499..fd943109732 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1095,14 +1095,14 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, bool exte } } - BLI_LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_first) { + LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_first) { /* this way a not-extend select will always give 1 selected marker */ if (marker->frame == frame) { marker->flag ^= SELECT; break; } } - BLI_LISTBASE_CIRCULAR_FORWARD_END (markers, marker, marker_first); + LISTBASE_CIRCULAR_FORWARD_END (markers, marker, marker_first); } static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool camera) -- cgit v1.2.3 From 4da6c496137042d4c90292f5567a6702a3df3323 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 15 Feb 2018 12:41:35 +0100 Subject: Cleanup: Style, braces with macros See https://wiki.blender.org/index.php/Dev:Doc/Code_Style#Braces_with_Macros --- source/blender/blenlib/BLI_listbase.h | 3 ++- source/blender/editors/animation/anim_markers.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenlib/BLI_listbase.h b/source/blender/blenlib/BLI_listbase.h index 92fb18bfe43..6be9408ac1e 100644 --- a/source/blender/blenlib/BLI_listbase.h +++ b/source/blender/blenlib/BLI_listbase.h @@ -103,7 +103,8 @@ struct LinkData *BLI_genericNodeN(void *data); * * \code{.c} * - * LISTBASE_CIRCULAR_FORWARD_BEGIN (listbase, item, item_init) { + * LISTBASE_CIRCULAR_FORWARD_BEGIN(listbase, item, item_init) + * { * ...operate on marker... * } * LISTBASE_CIRCULAR_FORWARD_END (listbase, item, item_init); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index fd943109732..031102c9f35 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1095,14 +1095,15 @@ static void select_timeline_marker_frame(ListBase *markers, int frame, bool exte } } - LISTBASE_CIRCULAR_FORWARD_BEGIN (markers, marker, marker_first) { + LISTBASE_CIRCULAR_FORWARD_BEGIN(markers, marker, marker_first) + { /* this way a not-extend select will always give 1 selected marker */ if (marker->frame == frame) { marker->flag ^= SELECT; break; } } - LISTBASE_CIRCULAR_FORWARD_END (markers, marker, marker_first); + LISTBASE_CIRCULAR_FORWARD_END(markers, marker, marker_first); } static int ed_marker_select(bContext *C, const wmEvent *event, bool extend, bool camera) -- cgit v1.2.3 From ccdacf1c9b31b15e188aa9e9adb044ffd0ca0da4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 15 Feb 2018 23:36:11 +1100 Subject: Cleanup: use '_len' instead of '_size' w/ BLI API - When returning the number of items in a collection use BLI_*_len() - Keep _size() for size in bytes. - Keep _count() for data structures that don't store length (hint this isn't a simple getter). See P611 to apply instead of manually resolving conflicts. --- source/blender/blenkernel/intern/bvhutils.c | 12 ++++----- source/blender/blenkernel/intern/cdderivedmesh.c | 4 +-- source/blender/blenkernel/intern/colorband.c | 2 +- source/blender/blenkernel/intern/curve_decimate.c | 2 +- source/blender/blenkernel/intern/library.c | 2 +- source/blender/blenkernel/intern/mesh.c | 2 +- source/blender/blenkernel/intern/mesh_validate.c | 2 +- source/blender/blenkernel/intern/node.c | 2 +- source/blender/blenkernel/intern/object_deform.c | 4 +-- .../blender/blenkernel/intern/outliner_treehash.c | 4 +-- source/blender/blenkernel/intern/pbvh.c | 6 ++--- source/blender/blenkernel/intern/pbvh_bmesh.c | 30 +++++++++++----------- source/blender/blenlib/BLI_edgehash.h | 4 +-- source/blender/blenlib/BLI_ghash.h | 8 +++--- source/blender/blenlib/BLI_gsqueue.h | 4 +-- source/blender/blenlib/BLI_heap.h | 4 +-- source/blender/blenlib/BLI_kdopbvh.h | 2 +- source/blender/blenlib/BLI_linklist_stack.h | 2 +- source/blender/blenlib/BLI_mempool.h | 2 +- source/blender/blenlib/BLI_smallhash.h | 2 +- source/blender/blenlib/BLI_threads.h | 2 +- source/blender/blenlib/intern/BLI_ghash.c | 16 ++++++------ source/blender/blenlib/intern/BLI_heap.c | 6 ++--- source/blender/blenlib/intern/BLI_kdopbvh.c | 2 +- source/blender/blenlib/intern/BLI_mempool.c | 2 +- source/blender/blenlib/intern/array_store.c | 6 ++--- source/blender/blenlib/intern/astar.c | 2 +- source/blender/blenlib/intern/edgehash.c | 10 ++++---- source/blender/blenlib/intern/gsqueue.c | 4 +-- .../blender/blenlib/intern/polyfill2d_beautify.c | 2 +- source/blender/blenlib/intern/smallhash.c | 2 +- source/blender/blenlib/intern/task.c | 2 +- source/blender/blenlib/intern/threads.c | 4 +-- source/blender/blenloader/intern/writefile.c | 2 +- source/blender/blentranslation/msgfmt/msgfmt.c | 2 +- source/blender/bmesh/intern/bmesh_iterators.c | 4 +-- source/blender/bmesh/intern/bmesh_log.c | 4 +-- source/blender/bmesh/intern/bmesh_operators.c | 2 +- source/blender/bmesh/operators/bmo_connect_pair.c | 4 +-- source/blender/bmesh/operators/bmo_rotate_edges.c | 2 +- .../bmesh/operators/bmo_subdivide_edgering.c | 4 +-- source/blender/bmesh/operators/bmo_triangulate.c | 2 +- source/blender/bmesh/tools/bmesh_beautify.c | 2 +- .../blender/bmesh/tools/bmesh_decimate_collapse.c | 4 +-- source/blender/bmesh/tools/bmesh_edgenet.c | 4 +-- source/blender/bmesh/tools/bmesh_intersect.c | 6 ++--- source/blender/bmesh/tools/bmesh_path.c | 6 ++--- source/blender/bmesh/tools/bmesh_region_match.c | 14 +++++----- .../intern/debug/deg_debug_relations_graphviz.cc | 4 +-- source/blender/depsgraph/intern/depsgraph_eval.cc | 2 +- source/blender/depsgraph/intern/eval/deg_eval.cc | 2 +- .../depsgraph/intern/eval/deg_eval_flush.cc | 2 +- .../depsgraph/intern/nodes/deg_node_component.cc | 6 ++--- .../blender/editors/armature/editarmature_sketch.c | 2 +- source/blender/editors/armature/reeb.c | 10 ++++---- source/blender/editors/curve/editcurve.c | 2 +- source/blender/editors/curve/editcurve_paint.c | 12 ++++----- source/blender/editors/curve/editcurve_select.c | 2 +- source/blender/editors/mesh/editmesh_knife.c | 2 +- source/blender/editors/sculpt_paint/sculpt_uv.c | 4 +-- .../blender/editors/space_outliner/outliner_tree.c | 6 ++--- .../blender/editors/uvedit/uvedit_parametrizer.c | 4 +-- .../blender/editors/uvedit/uvedit_smart_stitch.c | 2 +- source/blender/gpu/intern/gpu_buffers.c | 2 +- source/blender/imbuf/intern/moviecache.c | 2 +- source/blender/modifiers/intern/MOD_build.c | 14 +++++----- source/blender/modifiers/intern/MOD_skin.c | 2 +- source/blender/python/bmesh/bmesh_py_ops_call.c | 8 +++--- source/blender/python/intern/bpy_operator.c | 2 +- source/blender/python/intern/bpy_rna.c | 6 ++--- 70 files changed, 160 insertions(+), 160 deletions(-) (limited to 'source/blender') diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c index 775499304d4..cd2c7194237 100644 --- a/source/blender/blenkernel/intern/bvhutils.c +++ b/source/blender/blenkernel/intern/bvhutils.c @@ -411,7 +411,7 @@ static BVHTree *bvhtree_from_editmesh_verts_create_tree( BMVert *eve = BM_vert_at_index(em->bm, i); BLI_bvhtree_insert(tree, i, eve->co, 1); } - BLI_assert(BLI_bvhtree_get_size(tree) == verts_num_active); + BLI_assert(BLI_bvhtree_get_len(tree) == verts_num_active); BLI_bvhtree_balance(tree); } @@ -440,7 +440,7 @@ static BVHTree *bvhtree_from_mesh_verts_create_tree( } BLI_bvhtree_insert(tree, i, vert[i].co, 1); } - BLI_assert(BLI_bvhtree_get_size(tree) == verts_num_active); + BLI_assert(BLI_bvhtree_get_len(tree) == verts_num_active); BLI_bvhtree_balance(tree); } @@ -612,7 +612,7 @@ static BVHTree *bvhtree_from_editmesh_edges_create_tree( BLI_bvhtree_insert(tree, i, co[0], 2); } - BLI_assert(BLI_bvhtree_get_size(tree) == edges_num_active); + BLI_assert(BLI_bvhtree_get_len(tree) == edges_num_active); BLI_bvhtree_balance(tree); } @@ -829,7 +829,7 @@ static BVHTree *bvhtree_from_mesh_faces_create_tree( BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3); } } - BLI_assert(BLI_bvhtree_get_size(tree) == faces_num_active); + BLI_assert(BLI_bvhtree_get_len(tree) == faces_num_active); BLI_bvhtree_balance(tree); } } @@ -990,7 +990,7 @@ static BVHTree *bvhtree_from_editmesh_looptri_create_tree( } } } - BLI_assert(BLI_bvhtree_get_size(tree) == looptri_num_active); + BLI_assert(BLI_bvhtree_get_len(tree) == looptri_num_active); BLI_bvhtree_balance(tree); } } @@ -1032,7 +1032,7 @@ static BVHTree *bvhtree_from_mesh_looptri_create_tree( BLI_bvhtree_insert(tree, i, co[0], 3); } } - BLI_assert(BLI_bvhtree_get_size(tree) == looptri_num_active); + BLI_assert(BLI_bvhtree_get_len(tree) == looptri_num_active); BLI_bvhtree_balance(tree); } } diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index d3b106835ef..d65427a861b 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -3435,7 +3435,7 @@ void CDDM_calc_edges_tessface(DerivedMesh *dm) } } - numEdges = BLI_edgeset_size(eh); + numEdges = BLI_edgeset_len(eh); /* write new edges into a temporary CustomData */ CustomData_reset(&edgeData); @@ -3504,7 +3504,7 @@ void CDDM_calc_edges(DerivedMesh *dm) } } - numEdges = BLI_edgehash_size(eh); + numEdges = BLI_edgehash_len(eh); /* write new edges into a temporary CustomData */ CustomData_reset(&edgeData); diff --git a/source/blender/blenkernel/intern/colorband.c b/source/blender/blenkernel/intern/colorband.c index d35e797ddac..f72d4df725a 100644 --- a/source/blender/blenkernel/intern/colorband.c +++ b/source/blender/blenkernel/intern/colorband.c @@ -210,7 +210,7 @@ static void colorband_init_from_table_rgba_resample( while ((carr_len > 1 && !BLI_heap_is_empty(heap)) && ((carr_len >= MAXCOLORBAND) || (BLI_heap_node_value(BLI_heap_top(heap)) <= eps_2x))) { - c = BLI_heap_popmin(heap); + c = BLI_heap_pop_min(heap); struct ColorResampleElem *c_next = c->next, *c_prev = c->prev; c_prev->next = c_next; c_next->prev = c_prev; diff --git a/source/blender/blenkernel/intern/curve_decimate.c b/source/blender/blenkernel/intern/curve_decimate.c index 7983c63c99d..1a6c4714afd 100644 --- a/source/blender/blenkernel/intern/curve_decimate.c +++ b/source/blender/blenkernel/intern/curve_decimate.c @@ -159,7 +159,7 @@ static void curve_decimate( struct Knot *k; { - struct Removal *r = BLI_heap_popmin(heap); + struct Removal *r = BLI_heap_pop_min(heap); k = &knots[r->knot_index]; k->heap_node = NULL; k->prev->handles[1] = r->handles[0]; diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 46f8e637cf8..99423ee26a6 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -2026,7 +2026,7 @@ void BKE_library_make_local( GSet *loop_tags = BLI_gset_ptr_new(__func__); for (LinkNode *it = todo_ids; it; it = it->next) { library_make_local_copying_check(it->link, loop_tags, bmain->relations, done_ids); - BLI_assert(BLI_gset_size(loop_tags) == 0); + BLI_assert(BLI_gset_len(loop_tags) == 0); } BLI_gset_free(loop_tags, NULL); BLI_gset_free(done_ids, NULL); diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index bf937267b83..689ebc7e909 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -1003,7 +1003,7 @@ static void make_edges_mdata_extend(MEdge **r_alledge, int *r_totedge, BKE_mesh_poly_edgehash_insert(eh, mp, mloop + mp->loopstart); } - totedge_new = BLI_edgehash_size(eh); + totedge_new = BLI_edgehash_len(eh); #ifdef DEBUG /* ensure that theres no overlap! */ diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c index 4aeddbb4c45..62c9210b8f5 100644 --- a/source/blender/blenkernel/intern/mesh_validate.c +++ b/source/blender/blenkernel/intern/mesh_validate.c @@ -1486,7 +1486,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, bool update, const bool select) } } - totedge = BLI_edgehash_size(eh); + totedge = BLI_edgehash_len(eh); /* write new edges into a temporary CustomData */ CustomData_reset(&edata); diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c index 74766bec9a8..00f5f0f84b6 100644 --- a/source/blender/blenkernel/intern/node.c +++ b/source/blender/blenkernel/intern/node.c @@ -2787,7 +2787,7 @@ int BKE_node_instance_hash_haskey(bNodeInstanceHash *hash, bNodeInstanceKey key) int BKE_node_instance_hash_size(bNodeInstanceHash *hash) { - return BLI_ghash_size(hash->ghash); + return BLI_ghash_len(hash->ghash); } void BKE_node_instance_hash_clear_tags(bNodeInstanceHash *hash) diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c index 4f92509827f..2726064d634 100644 --- a/source/blender/blenkernel/intern/object_deform.c +++ b/source/blender/blenkernel/intern/object_deform.c @@ -539,7 +539,7 @@ bool *BKE_object_defgroup_validmap_get(Object *ob, const int defbase_tot) BLI_ghash_insert(gh, dg->name, NULL); } - BLI_assert(BLI_ghash_size(gh) == defbase_tot); + BLI_assert(BLI_ghash_len(gh) == defbase_tot); /* now loop through the armature modifiers and identify deform bones */ for (md = ob->modifiers.first; md; md = !md->next && step1 ? (step1 = 0), modifiers_getVirtualModifierList(ob, &virtualModifierData) : md->next) { @@ -574,7 +574,7 @@ bool *BKE_object_defgroup_validmap_get(Object *ob, const int defbase_tot) defgroup_validmap[i] = (BLI_ghash_lookup(gh, dg->name) != NULL); } - BLI_assert(i == BLI_ghash_size(gh)); + BLI_assert(i == BLI_ghash_len(gh)); BLI_ghash_free(gh, NULL, NULL); diff --git a/source/blender/blenkernel/intern/outliner_treehash.c b/source/blender/blenkernel/intern/outliner_treehash.c index 4d97121e2a3..9db9b2ddf54 100644 --- a/source/blender/blenkernel/intern/outliner_treehash.c +++ b/source/blender/blenkernel/intern/outliner_treehash.c @@ -112,7 +112,7 @@ static void fill_treehash(void *treehash, BLI_mempool *treestore) void *BKE_outliner_treehash_create_from_treestore(BLI_mempool *treestore) { - GHash *treehash = BLI_ghash_new_ex(tse_hash, tse_cmp, "treehash", BLI_mempool_count(treestore)); + GHash *treehash = BLI_ghash_new_ex(tse_hash, tse_cmp, "treehash", BLI_mempool_len(treestore)); fill_treehash(treehash, treestore); return treehash; } @@ -126,7 +126,7 @@ void *BKE_outliner_treehash_rebuild_from_treestore(void *treehash, BLI_mempool * { BLI_assert(treehash); - BLI_ghash_clear_ex(treehash, NULL, free_treehash_group, BLI_mempool_count(treestore)); + BLI_ghash_clear_ex(treehash, NULL, free_treehash_group, BLI_mempool_len(treestore)); fill_treehash(treehash, treestore); return treehash; } diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index d926c96c0d8..51d50b061de 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -1294,7 +1294,7 @@ void BKE_pbvh_get_grid_updates(PBVH *bvh, bool clear, void ***r_gridfaces, int * pbvh_iter_end(&iter); - const int tot = BLI_gset_size(face_set); + const int tot = BLI_gset_len(face_set); if (tot == 0) { *r_totface = 0; *r_gridfaces = NULL; @@ -1433,8 +1433,8 @@ void BKE_pbvh_node_num_verts( if (r_uniquevert) *r_uniquevert = node->uniq_verts; break; case PBVH_BMESH: - tot = BLI_gset_size(node->bm_unique_verts); - if (r_totvert) *r_totvert = tot + BLI_gset_size(node->bm_other_verts); + tot = BLI_gset_len(node->bm_unique_verts); + if (r_totvert) *r_totvert = tot + BLI_gset_len(node->bm_other_verts); if (r_uniquevert) *r_uniquevert = tot; break; } diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 587cc787057..6b6f2605dc3 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -255,7 +255,7 @@ static void pbvh_bmesh_node_split(PBVH *bvh, const BBC *bbc_array, int node_inde const int cd_face_node_offset = bvh->cd_face_node_offset; PBVHNode *n = &bvh->nodes[node_index]; - if (BLI_gset_size(n->bm_faces) <= bvh->leaf_limit) { + if (BLI_gset_len(n->bm_faces) <= bvh->leaf_limit) { /* Node limit not exceeded */ pbvh_bmesh_node_finalize(bvh, node_index, cd_vert_node_offset, cd_face_node_offset); return; @@ -289,8 +289,8 @@ static void pbvh_bmesh_node_split(PBVH *bvh, const BBC *bbc_array, int node_inde *c2 = &bvh->nodes[children + 1]; c1->flag |= PBVH_Leaf; c2->flag |= PBVH_Leaf; - c1->bm_faces = BLI_gset_ptr_new_ex("bm_faces", BLI_gset_size(n->bm_faces) / 2); - c2->bm_faces = BLI_gset_ptr_new_ex("bm_faces", BLI_gset_size(n->bm_faces) / 2); + c1->bm_faces = BLI_gset_ptr_new_ex("bm_faces", BLI_gset_len(n->bm_faces) / 2); + c2->bm_faces = BLI_gset_ptr_new_ex("bm_faces", BLI_gset_len(n->bm_faces) / 2); /* Partition the parent node's faces between the two children */ GSET_ITER (gs_iter, n->bm_faces) { @@ -305,11 +305,11 @@ static void pbvh_bmesh_node_split(PBVH *bvh, const BBC *bbc_array, int node_inde /* Enforce at least one primitive in each node */ GSet *empty = NULL, *other; - if (BLI_gset_size(c1->bm_faces) == 0) { + if (BLI_gset_len(c1->bm_faces) == 0) { empty = c1->bm_faces; other = c2->bm_faces; } - else if (BLI_gset_size(c2->bm_faces) == 0) { + else if (BLI_gset_len(c2->bm_faces) == 0) { empty = c2->bm_faces; other = c1->bm_faces; } @@ -375,7 +375,7 @@ static void pbvh_bmesh_node_split(PBVH *bvh, const BBC *bbc_array, int node_inde static bool pbvh_bmesh_node_limit_ensure(PBVH *bvh, int node_index) { GSet *bm_faces = bvh->nodes[node_index].bm_faces; - const int bm_faces_size = BLI_gset_size(bm_faces); + const int bm_faces_size = BLI_gset_len(bm_faces); if (bm_faces_size <= bvh->leaf_limit) { /* Node limit not exceeded */ return false; @@ -1238,7 +1238,7 @@ static bool pbvh_bmesh_subdivide_long_edges( bool any_subdivided = false; while (!BLI_heap_is_empty(eq_ctx->q->heap)) { - BMVert **pair = BLI_heap_popmin(eq_ctx->q->heap); + BMVert **pair = BLI_heap_pop_min(eq_ctx->q->heap); BMVert *v1 = pair[0], *v2 = pair[1]; BMEdge *e; @@ -1455,7 +1455,7 @@ static bool pbvh_bmesh_collapse_short_edges( GHash *deleted_verts = BLI_ghash_ptr_new("deleted_verts"); while (!BLI_heap_is_empty(eq_ctx->q->heap)) { - BMVert **pair = BLI_heap_popmin(eq_ctx->q->heap); + BMVert **pair = BLI_heap_pop_min(eq_ctx->q->heap); BMVert *v1 = pair[0], *v2 = pair[1]; BLI_mempool_free(eq_ctx->pool, pair); pair = NULL; @@ -2011,10 +2011,10 @@ void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node) if (node->bm_orco) return; - const int totvert = BLI_gset_size(node->bm_unique_verts) + - BLI_gset_size(node->bm_other_verts); + const int totvert = BLI_gset_len(node->bm_unique_verts) + + BLI_gset_len(node->bm_other_verts); - const int tottri = BLI_gset_size(node->bm_faces); + const int tottri = BLI_gset_len(node->bm_faces); node->bm_orco = MEM_mallocN(sizeof(*node->bm_orco) * totvert, __func__); node->bm_ortri = MEM_mallocN(sizeof(*node->bm_ortri) * tottri, __func__); @@ -2189,12 +2189,12 @@ static void pbvh_bmesh_verify(PBVH *bvh) int totface = 0, totvert = 0; for (int i = 0; i < bvh->totnode; i++) { PBVHNode *n = &bvh->nodes[i]; - totface += n->bm_faces ? BLI_gset_size(n->bm_faces) : 0; - totvert += n->bm_unique_verts ? BLI_gset_size(n->bm_unique_verts) : 0; + totface += n->bm_faces ? BLI_gset_len(n->bm_faces) : 0; + totvert += n->bm_unique_verts ? BLI_gset_len(n->bm_unique_verts) : 0; } - BLI_assert(totface == BLI_gset_size(faces_all)); - BLI_assert(totvert == BLI_gset_size(verts_all)); + BLI_assert(totface == BLI_gset_len(faces_all)); + BLI_assert(totvert == BLI_gset_len(verts_all)); } { diff --git a/source/blender/blenlib/BLI_edgehash.h b/source/blender/blenlib/BLI_edgehash.h index 20272dd97cd..41789201265 100644 --- a/source/blender/blenlib/BLI_edgehash.h +++ b/source/blender/blenlib/BLI_edgehash.h @@ -59,7 +59,7 @@ bool BLI_edgehash_remove(EdgeHash *eh, unsigned int v0, unsigned int void *BLI_edgehash_popkey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; bool BLI_edgehash_haskey(EdgeHash *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; -int BLI_edgehash_size(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT; +int BLI_edgehash_len(EdgeHash *eh) ATTR_WARN_UNUSED_RESULT; void BLI_edgehash_clear_ex(EdgeHash *eh, EdgeHashFreeFP valfreefp, const unsigned int nentries_reserve); void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp); @@ -104,7 +104,7 @@ typedef struct EdgeSetIterator EdgeSetIterator; EdgeSet *BLI_edgeset_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; EdgeSet *BLI_edgeset_new(const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; -int BLI_edgeset_size(EdgeSet *es) ATTR_WARN_UNUSED_RESULT; +int BLI_edgeset_len(EdgeSet *es) ATTR_WARN_UNUSED_RESULT; bool BLI_edgeset_add(EdgeSet *es, unsigned int v0, unsigned int v1); void BLI_edgeset_insert(EdgeSet *es, unsigned int v0, unsigned int v1); bool BLI_edgeset_haskey(EdgeSet *eh, unsigned int v0, unsigned int v1) ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/BLI_ghash.h b/source/blender/blenlib/BLI_ghash.h index b4819ff4e55..7a2d9924904 100644 --- a/source/blender/blenlib/BLI_ghash.h +++ b/source/blender/blenlib/BLI_ghash.h @@ -110,7 +110,7 @@ void BLI_ghash_clear_ex( void *BLI_ghash_popkey(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp) ATTR_WARN_UNUSED_RESULT; bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT; bool BLI_ghash_pop(GHash *gh, GHashIterState *state, void **r_key, void **r_val) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -unsigned int BLI_ghash_size(GHash *gh) ATTR_WARN_UNUSED_RESULT; +unsigned int BLI_ghash_len(GHash *gh) ATTR_WARN_UNUSED_RESULT; void BLI_ghash_flag_set(GHash *gh, unsigned int flag); void BLI_ghash_flag_clear(GHash *gh, unsigned int flag); @@ -261,7 +261,7 @@ GSet *BLI_gset_new_ex( const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; GSet *BLI_gset_new(GSetHashFP hashfp, GSetCmpFP cmpfp, const char *info) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; GSet *BLI_gset_copy(GSet *gs, GSetKeyCopyFP keycopyfp) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT; -unsigned int BLI_gset_size(GSet *gs) ATTR_WARN_UNUSED_RESULT; +unsigned int BLI_gset_len(GSet *gs) ATTR_WARN_UNUSED_RESULT; void BLI_gset_flag_set(GSet *gs, unsigned int flag); void BLI_gset_flag_clear(GSet *gs, unsigned int flag); void BLI_gset_free(GSet *gs, GSetKeyFreeFP keyfreefp); @@ -309,8 +309,8 @@ BLI_INLINE bool BLI_gsetIterator_done(GSetIterator *gsi) { return BLI_ghashItera /* For testing, debugging only */ #ifdef GHASH_INTERNAL_API -int BLI_ghash_buckets_size(GHash *gh); -int BLI_gset_buckets_size(GSet *gs); +int BLI_ghash_buckets_len(GHash *gh); +int BLI_gset_buckets_len(GSet *gs); double BLI_ghash_calc_quality_ex( GHash *gh, double *r_load, double *r_variance, diff --git a/source/blender/blenlib/BLI_gsqueue.h b/source/blender/blenlib/BLI_gsqueue.h index 4600d6f6325..ef0e0f3ab31 100644 --- a/source/blender/blenlib/BLI_gsqueue.h +++ b/source/blender/blenlib/BLI_gsqueue.h @@ -36,11 +36,11 @@ typedef struct _GSQueue GSQueue; GSQueue *BLI_gsqueue_new(size_t elem_size); bool BLI_gsqueue_is_empty(GSQueue *gq); -int BLI_gsqueue_size(GSQueue *gq); +int BLI_gsqueue_len(GSQueue *gq); void BLI_gsqueue_peek(GSQueue *gq, void *r_item); void BLI_gsqueue_pop(GSQueue *gq, void *r_item); void BLI_gsqueue_push(GSQueue *gq, const void *item); -void BLI_gsqueue_pushback(GSQueue *gq, const void *item); +void BLI_gsqueue_push_back(GSQueue *gq, const void *item); void BLI_gsqueue_free(GSQueue *gq); #endif /* __BLI_GSQUEUE_H__ */ diff --git a/source/blender/blenlib/BLI_heap.h b/source/blender/blenlib/BLI_heap.h index d3f6d44e164..19e162d777f 100644 --- a/source/blender/blenlib/BLI_heap.h +++ b/source/blender/blenlib/BLI_heap.h @@ -41,9 +41,9 @@ HeapNode *BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL void BLI_heap_insert_or_update(Heap *heap, HeapNode **node_p, float value, void *ptr) ATTR_NONNULL(1, 2); void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1, 2); bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1); -unsigned int BLI_heap_size(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); +unsigned int BLI_heap_len(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); HeapNode *BLI_heap_top(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); -void *BLI_heap_popmin(Heap *heap) ATTR_NONNULL(1); +void *BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1); void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1, 2); void BLI_heap_node_value_update_ptr(Heap *heap, HeapNode *node, float value, void *ptr) ATTR_NONNULL(1, 2); diff --git a/source/blender/blenlib/BLI_kdopbvh.h b/source/blender/blenlib/BLI_kdopbvh.h index 564659ad21e..db53035dc7b 100644 --- a/source/blender/blenlib/BLI_kdopbvh.h +++ b/source/blender/blenlib/BLI_kdopbvh.h @@ -129,7 +129,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap( const BVHTree *tree1, const BVHTree *tree2, unsigned int *r_overlap_tot, BVHTree_OverlapCallback callback, void *userdata); -int BLI_bvhtree_get_size(const BVHTree *tree); +int BLI_bvhtree_get_len(const BVHTree *tree); float BLI_bvhtree_get_epsilon(const BVHTree *tree); diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index dd92dcec936..dd6d737f111 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -60,7 +60,7 @@ } (void)0 #define BLI_LINKSTACK_SIZE(var) \ - BLI_mempool_count(var##_pool_) + BLI_mempool_len(var##_pool_) /* check for typeof() */ #ifdef __GNUC__ diff --git a/source/blender/blenlib/BLI_mempool.h b/source/blender/blenlib/BLI_mempool.h index b68ca6b1f2b..45efb8d7ef1 100644 --- a/source/blender/blenlib/BLI_mempool.h +++ b/source/blender/blenlib/BLI_mempool.h @@ -53,7 +53,7 @@ void BLI_mempool_clear_ex(BLI_mempool *pool, const int totelem_reserve) ATTR_NONNULL(1); void BLI_mempool_clear(BLI_mempool *pool) ATTR_NONNULL(1); void BLI_mempool_destroy(BLI_mempool *pool) ATTR_NONNULL(1); -int BLI_mempool_count(BLI_mempool *pool) ATTR_NONNULL(1); +int BLI_mempool_len(BLI_mempool *pool) ATTR_NONNULL(1); void *BLI_mempool_findelem(BLI_mempool *pool, unsigned int index) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1); void BLI_mempool_as_table(BLI_mempool *pool, void **data) ATTR_NONNULL(1, 2); diff --git a/source/blender/blenlib/BLI_smallhash.h b/source/blender/blenlib/BLI_smallhash.h index e096354e5b1..495fc94a53c 100644 --- a/source/blender/blenlib/BLI_smallhash.h +++ b/source/blender/blenlib/BLI_smallhash.h @@ -66,7 +66,7 @@ bool BLI_smallhash_remove(SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); void *BLI_smallhash_lookup(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; void **BLI_smallhash_lookup_p(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) ATTR_NONNULL(1); -int BLI_smallhash_count(const SmallHash *sh) ATTR_NONNULL(1); +int BLI_smallhash_len(const SmallHash *sh) ATTR_NONNULL(1); void *BLI_smallhash_iternext(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; void **BLI_smallhash_iternext_p(SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; void *BLI_smallhash_iternew(const SmallHash *sh, SmallHashIter *iter, uintptr_t *key) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; diff --git a/source/blender/blenlib/BLI_threads.h b/source/blender/blenlib/BLI_threads.h index 60da6b39cbe..84e25daa348 100644 --- a/source/blender/blenlib/BLI_threads.h +++ b/source/blender/blenlib/BLI_threads.h @@ -177,7 +177,7 @@ void BLI_thread_queue_free(ThreadQueue *queue); void BLI_thread_queue_push(ThreadQueue *queue, void *work); void *BLI_thread_queue_pop(ThreadQueue *queue); void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms); -int BLI_thread_queue_size(ThreadQueue *queue); +int BLI_thread_queue_len(ThreadQueue *queue); bool BLI_thread_queue_is_empty(ThreadQueue *queue); void BLI_thread_queue_wait_finish(ThreadQueue *queue); diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index bf2f25fae69..edfbccca660 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -741,7 +741,7 @@ void BLI_ghash_reserve(GHash *gh, const uint nentries_reserve) /** * \return size of the GHash. */ -uint BLI_ghash_size(GHash *gh) +uint BLI_ghash_len(GHash *gh) { return gh->nentries; } @@ -1010,7 +1010,7 @@ void BLI_ghash_clear(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfree */ void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp) { - BLI_assert((int)gh->nentries == BLI_mempool_count(gh->entrypool)); + BLI_assert((int)gh->nentries == BLI_mempool_len(gh->entrypool)); if (keyfreefp || valfreefp) ghash_free_cb(gh, keyfreefp, valfreefp); @@ -1044,7 +1044,7 @@ void BLI_ghash_flag_clear(GHash *gh, uint flag) /** * Create a new GHashIterator. The hash table must not be mutated * while the iterator is in use, and the iterator will step exactly - * BLI_ghash_size(gh) times before becoming done. + * BLI_ghash_len(gh) times before becoming done. * * \param gh The GHash to iterate over. * \return Pointer to a new DynStr. @@ -1059,7 +1059,7 @@ GHashIterator *BLI_ghashIterator_new(GHash *gh) /** * Init an already allocated GHashIterator. The hash table must not * be mutated while the iterator is in use, and the iterator will - * step exactly BLI_ghash_size(gh) times before becoming done. + * step exactly BLI_ghash_len(gh) times before becoming done. * * \param ghi The GHashIterator to initialize. * \param gh The GHash to iterate over. @@ -1398,7 +1398,7 @@ GSet *BLI_gset_copy(GSet *gs, GHashKeyCopyFP keycopyfp) return (GSet *)ghash_copy((GHash *)gs, keycopyfp, NULL); } -uint BLI_gset_size(GSet *gs) +uint BLI_gset_len(GSet *gs) { return ((GHash *)gs)->nentries; } @@ -1618,13 +1618,13 @@ GSet *BLI_gset_pair_new(const char *info) /** * \return number of buckets in the GHash. */ -int BLI_ghash_buckets_size(GHash *gh) +int BLI_ghash_buckets_len(GHash *gh) { return (int)gh->nbuckets; } -int BLI_gset_buckets_size(GSet *gs) +int BLI_gset_buckets_len(GSet *gs) { - return BLI_ghash_buckets_size((GHash *)gs); + return BLI_ghash_buckets_len((GHash *)gs); } /** diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 7c249344541..0c71e75e40f 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -303,7 +303,7 @@ bool BLI_heap_is_empty(const Heap *heap) return (heap->size == 0); } -uint BLI_heap_size(const Heap *heap) +uint BLI_heap_len(const Heap *heap) { return heap->size; } @@ -320,7 +320,7 @@ HeapNode *BLI_heap_top(const Heap *heap) /** * Pop the top node off the heap and return it's pointer. */ -void *BLI_heap_popmin(Heap *heap) +void *BLI_heap_pop_min(Heap *heap) { BLI_assert(heap->size != 0); @@ -348,7 +348,7 @@ void BLI_heap_remove(Heap *heap, HeapNode *node) i = p; } - BLI_heap_popmin(heap); + BLI_heap_pop_min(heap); } /** diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index 9c055a227a9..d6c58780603 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -1147,7 +1147,7 @@ void BLI_bvhtree_update_tree(BVHTree *tree) * Number of times #BLI_bvhtree_insert has been called. * mainly useful for asserts functions to check we added the correct number. */ -int BLI_bvhtree_get_size(const BVHTree *tree) +int BLI_bvhtree_get_len(const BVHTree *tree) { return tree->totleaf; } diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 5b13f129ad4..3a65e6c42ca 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -474,7 +474,7 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) } } -int BLI_mempool_count(BLI_mempool *pool) +int BLI_mempool_len(BLI_mempool *pool) { return (int)pool->totused; } diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index 5b1715bbb3d..acf15b1c892 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -1759,7 +1759,7 @@ bool BLI_array_store_is_valid( goto user_finally; } } - if (!(BLI_mempool_count(bs->memory.chunk_list) == (int)BLI_ghash_size(chunk_list_map))) { + if (!(BLI_mempool_len(bs->memory.chunk_list) == (int)BLI_ghash_len(chunk_list_map))) { ok = false; goto user_finally; } @@ -1772,11 +1772,11 @@ bool BLI_array_store_is_valid( totrefs += 1; } } - if (!(BLI_mempool_count(bs->memory.chunk) == (int)BLI_ghash_size(chunk_map))) { + if (!(BLI_mempool_len(bs->memory.chunk) == (int)BLI_ghash_len(chunk_map))) { ok = false; goto user_finally; } - if (!(BLI_mempool_count(bs->memory.chunk_ref) == totrefs)) { + if (!(BLI_mempool_len(bs->memory.chunk_ref) == totrefs)) { ok = false; goto user_finally; } diff --git a/source/blender/blenlib/intern/astar.c b/source/blender/blenlib/intern/astar.c index 0020dbe4612..1b57dc5a683 100644 --- a/source/blender/blenlib/intern/astar.c +++ b/source/blender/blenlib/intern/astar.c @@ -231,7 +231,7 @@ bool BLI_astar_graph_solve( SET_INT_IN_POINTER(node_index_src)); while (!BLI_heap_is_empty(todo_nodes)) { - const int node_curr_idx = GET_INT_FROM_POINTER(BLI_heap_popmin(todo_nodes)); + const int node_curr_idx = GET_INT_FROM_POINTER(BLI_heap_pop_min(todo_nodes)); BLI_AStarGNode *node_curr = &as_graph->nodes[node_curr_idx]; LinkData *ld; diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 772c8bd6247..7074a776aaf 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -527,7 +527,7 @@ bool BLI_edgehash_haskey(EdgeHash *eh, uint v0, uint v1) /** * Return number of keys in hash. */ -int BLI_edgehash_size(EdgeHash *eh) +int BLI_edgehash_len(EdgeHash *eh) { return (int)eh->nentries; } @@ -565,7 +565,7 @@ void BLI_edgehash_clear(EdgeHash *eh, EdgeHashFreeFP valfreefp) void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP valfreefp) { - BLI_assert((int)eh->nentries == BLI_mempool_count(eh->epool)); + BLI_assert((int)eh->nentries == BLI_mempool_len(eh->epool)); if (valfreefp) edgehash_free_cb(eh, valfreefp); @@ -599,7 +599,7 @@ void BLI_edgehash_flag_clear(EdgeHash *eh, uint flag) /** * Create a new EdgeHashIterator. The hash table must not be mutated * while the iterator is in use, and the iterator will step exactly - * BLI_edgehash_size(eh) times before becoming done. + * BLI_edgehash_len(eh) times before becoming done. */ EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) { @@ -611,7 +611,7 @@ EdgeHashIterator *BLI_edgehashIterator_new(EdgeHash *eh) /** * Init an already allocated EdgeHashIterator. The hash table must not * be mutated while the iterator is in use, and the iterator will - * step exactly BLI_edgehash_size(eh) times before becoming done. + * step exactly BLI_edgehash_len(eh) times before becoming done. * * \param ehi The EdgeHashIterator to initialize. * \param eh The EdgeHash to iterate over. @@ -729,7 +729,7 @@ EdgeSet *BLI_edgeset_new(const char *info) return BLI_edgeset_new_ex(info, 0); } -int BLI_edgeset_size(EdgeSet *es) +int BLI_edgeset_len(EdgeSet *es) { return (int)((EdgeHash *)es)->nentries; } diff --git a/source/blender/blenlib/intern/gsqueue.c b/source/blender/blenlib/intern/gsqueue.c index 25da7701924..5c8c43ab92a 100644 --- a/source/blender/blenlib/intern/gsqueue.c +++ b/source/blender/blenlib/intern/gsqueue.c @@ -81,7 +81,7 @@ bool BLI_gsqueue_is_empty(GSQueue *gq) /** * Query number elements in the queue */ -int BLI_gsqueue_size(GSQueue *gq) +int BLI_gsqueue_len(GSQueue *gq) { GSQueueElem *elem; int size = 0; @@ -162,7 +162,7 @@ void BLI_gsqueue_push(GSQueue *gq, const void *item) * \param item A pointer to an appropriately * sized structure (the size passed to BLI_gsqueue_new). */ -void BLI_gsqueue_pushback(GSQueue *gq, const void *item) +void BLI_gsqueue_push_back(GSQueue *gq, const void *item) { GSQueueElem *elem = MEM_mallocN(sizeof(*elem) + gq->elem_size, "gqueue_push"); memcpy(elem->data, item, gq->elem_size); diff --git a/source/blender/blenlib/intern/polyfill2d_beautify.c b/source/blender/blenlib/intern/polyfill2d_beautify.c index c0c95da5c63..625c54d0e9b 100644 --- a/source/blender/blenlib/intern/polyfill2d_beautify.c +++ b/source/blender/blenlib/intern/polyfill2d_beautify.c @@ -401,7 +401,7 @@ void BLI_polyfill_beautify( } while (BLI_heap_is_empty(eheap) == false) { - struct HalfEdge *e = BLI_heap_popmin(eheap); + struct HalfEdge *e = BLI_heap_pop_min(eheap); eheap_table[e->base_index] = NULL; polyedge_rotate(half_edges, e); diff --git a/source/blender/blenlib/intern/smallhash.c b/source/blender/blenlib/intern/smallhash.c index 1b862ffe005..56d77abed24 100644 --- a/source/blender/blenlib/intern/smallhash.c +++ b/source/blender/blenlib/intern/smallhash.c @@ -310,7 +310,7 @@ bool BLI_smallhash_haskey(const SmallHash *sh, uintptr_t key) return (e != NULL); } -int BLI_smallhash_count(const SmallHash *sh) +int BLI_smallhash_len(const SmallHash *sh) { return (int)sh->nentries; } diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c index 05cfe4f3972..c892ffbfd4a 100644 --- a/source/blender/blenlib/intern/task.c +++ b/source/blender/blenlib/intern/task.c @@ -1329,7 +1329,7 @@ void BLI_task_parallel_mempool( ParallelMempoolState state; int i, num_threads, num_tasks; - if (BLI_mempool_count(mempool) == 0) { + if (BLI_mempool_len(mempool) == 0) { return; } diff --git a/source/blender/blenlib/intern/threads.c b/source/blender/blenlib/intern/threads.c index 2f961701801..9dc458fa0b9 100644 --- a/source/blender/blenlib/intern/threads.c +++ b/source/blender/blenlib/intern/threads.c @@ -773,12 +773,12 @@ void *BLI_thread_queue_pop_timeout(ThreadQueue *queue, int ms) return work; } -int BLI_thread_queue_size(ThreadQueue *queue) +int BLI_thread_queue_len(ThreadQueue *queue) { int size; pthread_mutex_lock(&queue->mutex); - size = BLI_gsqueue_size(queue->queue); + size = BLI_gsqueue_len(queue->queue); pthread_mutex_unlock(&queue->mutex); return size; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 5941f96041c..5afab804929 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2826,7 +2826,7 @@ static void write_soops(WriteData *wd, SpaceOops *so) if (ts) { SpaceOops so_flat = *so; - int elems = BLI_mempool_count(ts); + int elems = BLI_mempool_len(ts); /* linearize mempool to array */ TreeStoreElem *data = elems ? BLI_mempool_as_arrayN(ts, "TreeStoreElem") : NULL; diff --git a/source/blender/blentranslation/msgfmt/msgfmt.c b/source/blender/blentranslation/msgfmt/msgfmt.c index 49f850f200c..a155cce53a5 100644 --- a/source/blender/blentranslation/msgfmt/msgfmt.c +++ b/source/blender/blentranslation/msgfmt/msgfmt.c @@ -186,7 +186,7 @@ typedef struct Offset { /* Return the generated binary output. */ static char *generate(GHash *messages, size_t *r_output_size) { - const uint32_t num_keys = BLI_ghash_size(messages); + const uint32_t num_keys = BLI_ghash_len(messages); /* Get list of sorted keys. */ char **keys = get_keys_sorted(messages, num_keys); diff --git a/source/blender/bmesh/intern/bmesh_iterators.c b/source/blender/bmesh/intern/bmesh_iterators.c index 96154f051f9..9fe28561b93 100644 --- a/source/blender/bmesh/intern/bmesh_iterators.c +++ b/source/blender/bmesh/intern/bmesh_iterators.c @@ -430,7 +430,7 @@ int BM_iter_mesh_count_flag(const char itype, BMesh *bm, const char hflag, const void bmiter__elem_of_mesh_begin(struct BMIter__elem_of_mesh *iter) { #ifdef USE_IMMUTABLE_ASSERT - ((BMIter *)iter)->count = BLI_mempool_count(iter->pooliter.pool); + ((BMIter *)iter)->count = BLI_mempool_len(iter->pooliter.pool); #endif BLI_mempool_iternew(iter->pooliter.pool, &iter->pooliter); } @@ -438,7 +438,7 @@ void bmiter__elem_of_mesh_begin(struct BMIter__elem_of_mesh *iter) void *bmiter__elem_of_mesh_step(struct BMIter__elem_of_mesh *iter) { #ifdef USE_IMMUTABLE_ASSERT - BLI_assert(((BMIter *)iter)->count <= BLI_mempool_count(iter->pooliter.pool)); + BLI_assert(((BMIter *)iter)->count <= BLI_mempool_len(iter->pooliter.pool)); #endif return BLI_mempool_iterstep(&iter->pooliter); } diff --git a/source/blender/bmesh/intern/bmesh_log.c b/source/blender/bmesh/intern/bmesh_log.c index 1d16dbc1836..5ae72851c7e 100644 --- a/source/blender/bmesh/intern/bmesh_log.c +++ b/source/blender/bmesh/intern/bmesh_log.c @@ -990,11 +990,11 @@ void BM_log_all_added(BMesh *bm, BMLog *log) BMFace *f; /* avoid unnecessary resizing on initialization */ - if (BLI_ghash_size(log->current_entry->added_verts) == 0) { + if (BLI_ghash_len(log->current_entry->added_verts) == 0) { BLI_ghash_reserve(log->current_entry->added_verts, (uint)bm->totvert); } - if (BLI_ghash_size(log->current_entry->added_faces) == 0) { + if (BLI_ghash_len(log->current_entry->added_faces) == 0) { BLI_ghash_reserve(log->current_entry->added_faces, (uint)bm->totface); } diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index 0f672a9ff2a..f814767a200 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -673,7 +673,7 @@ int BMO_slot_map_count(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], const char *slot_na { BMOpSlot *slot = BMO_slot_get(slot_args, slot_name); BLI_assert(slot->slot_type == BMO_OP_SLOT_MAPPING); - return BLI_ghash_size(slot->data.ghash); + return BLI_ghash_len(slot->data.ghash); } /* inserts a key/value mapping into a mapping slot. note that it copies the diff --git a/source/blender/bmesh/operators/bmo_connect_pair.c b/source/blender/bmesh/operators/bmo_connect_pair.c index 60fd9808fcb..b9e5cd927c3 100644 --- a/source/blender/bmesh/operators/bmo_connect_pair.c +++ b/source/blender/bmesh/operators/bmo_connect_pair.c @@ -662,11 +662,11 @@ void bmo_connect_vert_pair_exec(BMesh *bm, BMOperator *op) while (!BLI_heap_is_empty(pc.states)) { #ifdef DEBUG_PRINT - printf("\n%s: stepping %u\n", __func__, BLI_heap_size(pc.states)); + printf("\n%s: stepping %u\n", __func__, BLI_heap_len(pc.states)); #endif while (!BLI_heap_is_empty(pc.states)) { - PathLinkState *state = BLI_heap_popmin(pc.states); + PathLinkState *state = BLI_heap_pop_min(pc.states); /* either we insert this into 'pc.states' or its freed */ bool continue_search; diff --git a/source/blender/bmesh/operators/bmo_rotate_edges.c b/source/blender/bmesh/operators/bmo_rotate_edges.c index 9832fdb57d3..75e31c68dae 100644 --- a/source/blender/bmesh/operators/bmo_rotate_edges.c +++ b/source/blender/bmesh/operators/bmo_rotate_edges.c @@ -180,7 +180,7 @@ static void bm_rotate_edges_shared( const int edges_len_rotate_prev = edges_len_rotate; while (!BLI_heap_is_empty(heap)) { - BMEdge *e_best = BLI_heap_popmin(heap); + BMEdge *e_best = BLI_heap_pop_min(heap); eheap_table[BM_elem_index_get(e_best)] = NULL; /* No problem if this fails, re-evaluate if faces connected to this edge are touched. */ diff --git a/source/blender/bmesh/operators/bmo_subdivide_edgering.c b/source/blender/bmesh/operators/bmo_subdivide_edgering.c index adcc0c71629..e6881f6d8b1 100644 --- a/source/blender/bmesh/operators/bmo_subdivide_edgering.c +++ b/source/blender/bmesh/operators/bmo_subdivide_edgering.c @@ -269,7 +269,7 @@ static GSet *bm_edgering_pair_calc(BMesh *bm, ListBase *eloops_rim) BLI_ghash_free(vert_eloop_gh, NULL, NULL); - if (BLI_gset_size(eloop_pair_gs) == 0) { + if (BLI_gset_len(eloop_pair_gs) == 0) { BLI_gset_free(eloop_pair_gs, NULL); eloop_pair_gs = NULL; } @@ -1193,7 +1193,7 @@ void bmo_subdivide_edgering_exec(BMesh *bm, BMOperator *op) goto cleanup; } - lpair_arr = BLI_array_alloca(lpair_arr, BLI_gset_size(eloop_pairs_gs)); + lpair_arr = BLI_array_alloca(lpair_arr, BLI_gset_len(eloop_pairs_gs)); /* first cache pairs */ GSET_ITER_INDEX (gs_iter, eloop_pairs_gs, i) { diff --git a/source/blender/bmesh/operators/bmo_triangulate.c b/source/blender/bmesh/operators/bmo_triangulate.c index 4e8bace59e0..2cdc2646649 100644 --- a/source/blender/bmesh/operators/bmo_triangulate.c +++ b/source/blender/bmesh/operators/bmo_triangulate.c @@ -106,7 +106,7 @@ void bmo_triangle_fill_exec(BMesh *bm, BMOperator *op) /* sf_edge = */ BLI_scanfill_edge_add(&sf_ctx, UNPACK2(sf_verts)); /* sf_edge->tmp.p = e; */ /* UNUSED */ } - nors_tot = BLI_ghash_size(sf_vert_map); + nors_tot = BLI_ghash_len(sf_vert_map); BLI_ghash_free(sf_vert_map, NULL, NULL); diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c index 6e6242fc9f9..81f0b4822a2 100644 --- a/source/blender/bmesh/tools/bmesh_beautify.c +++ b/source/blender/bmesh/tools/bmesh_beautify.c @@ -392,7 +392,7 @@ void BM_mesh_beautify_fill( bm->elem_index_dirty |= BM_EDGE; while (BLI_heap_is_empty(eheap) == false) { - BMEdge *e = BLI_heap_popmin(eheap); + BMEdge *e = BLI_heap_pop_min(eheap); i = BM_elem_index_get(e); eheap_table[i] = NULL; diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c index 0a1271c2aa9..3aa9e5278bc 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c +++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c @@ -1357,7 +1357,7 @@ void BM_mesh_decimate_collapse( (BLI_heap_node_value(BLI_heap_top(eheap)) != COST_INVALID)) { // const float value = BLI_heap_node_value(BLI_heap_top(eheap)); - BMEdge *e = BLI_heap_popmin(eheap); + BMEdge *e = BLI_heap_pop_min(eheap); float optimize_co[3]; BLI_assert(BM_elem_index_get(e) < tot_edge_orig); /* handy to detect corruptions elsewhere */ @@ -1388,7 +1388,7 @@ void BM_mesh_decimate_collapse( * - edges sharing a vertex are ignored, so the pivot vertex isnt moved to one side. */ - BMEdge *e = BLI_heap_popmin(eheap); + BMEdge *e = BLI_heap_pop_min(eheap); const int e_index = BM_elem_index_get(e); const int e_index_mirr = edge_symmetry_map[e_index]; BMEdge *e_mirr = NULL; diff --git a/source/blender/bmesh/tools/bmesh_edgenet.c b/source/blender/bmesh/tools/bmesh_edgenet.c index 193a032b46e..df9d07036af 100644 --- a/source/blender/bmesh/tools/bmesh_edgenet.c +++ b/source/blender/bmesh/tools/bmesh_edgenet.c @@ -335,7 +335,7 @@ static LinkNode *bm_edgenet_path_calc( BLI_linklist_free_pool(v_ls_next, NULL, path_pool); BLI_linklist_free_pool(v_ls_prev, NULL, path_pool); - // BLI_assert(BLI_mempool_count(path_pool) == 0); + // BLI_assert(BLI_mempool_len(path_pool) == 0); path_len = bm_edgenet_path_from_pass(e_found->v1, &path, vnet_info, path_pool); BLI_linklist_reverse(&path); @@ -505,7 +505,7 @@ void BM_mesh_edgenet( } BLI_linklist_free_pool(path, NULL, path_pool); - BLI_assert(BLI_mempool_count(path_pool) == 0); + BLI_assert(BLI_mempool_len(path_pool) == 0); } bm->elem_index_dirty |= BM_FACE | BM_LOOP; diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c index 9d1b20cb4d2..acadb663810 100644 --- a/source/blender/bmesh/tools/bmesh_intersect.c +++ b/source/blender/bmesh/tools/bmesh_intersect.c @@ -1275,8 +1275,8 @@ bool BM_mesh_intersect( } } - splice_ls = MEM_mallocN(BLI_gset_size(s.wire_edges) * sizeof(*splice_ls), __func__); - STACK_INIT(splice_ls, BLI_gset_size(s.wire_edges)); + splice_ls = MEM_mallocN(BLI_gset_len(s.wire_edges) * sizeof(*splice_ls), __func__); + STACK_INIT(splice_ls, BLI_gset_len(s.wire_edges)); for (node = s.vert_dissolve; node; node = node->next) { BMEdge *e_pair[2]; @@ -1690,7 +1690,7 @@ bool BM_mesh_intersect( } } - has_edit_isect = (BLI_ghash_size(s.face_edges) != 0); + has_edit_isect = (BLI_ghash_len(s.face_edges) != 0); /* cleanup */ BLI_ghash_free(s.edgetri_cache, NULL, NULL); diff --git a/source/blender/bmesh/tools/bmesh_path.c b/source/blender/bmesh/tools/bmesh_path.c index 85c591b6684..cc5ac6dd8ce 100644 --- a/source/blender/bmesh/tools/bmesh_path.c +++ b/source/blender/bmesh/tools/bmesh_path.c @@ -174,7 +174,7 @@ LinkNode *BM_mesh_calc_path_vert( cost[BM_elem_index_get(v_src)] = 0.0f; while (!BLI_heap_is_empty(heap)) { - v = BLI_heap_popmin(heap); + v = BLI_heap_pop_min(heap); if (v == v_dst) break; @@ -346,7 +346,7 @@ LinkNode *BM_mesh_calc_path_edge( cost[BM_elem_index_get(e_src)] = 0.0f; while (!BLI_heap_is_empty(heap)) { - e = BLI_heap_popmin(heap); + e = BLI_heap_pop_min(heap); if (e == e_dst) break; @@ -532,7 +532,7 @@ LinkNode *BM_mesh_calc_path_face( cost[BM_elem_index_get(f_src)] = 0.0f; while (!BLI_heap_is_empty(heap)) { - f = BLI_heap_popmin(heap); + f = BLI_heap_pop_min(heap); if (f == f_dst) break; diff --git a/source/blender/bmesh/tools/bmesh_region_match.c b/source/blender/bmesh/tools/bmesh_region_match.c index 2abf8f2c46e..e83ba73ad01 100644 --- a/source/blender/bmesh/tools/bmesh_region_match.c +++ b/source/blender/bmesh/tools/bmesh_region_match.c @@ -421,8 +421,8 @@ static void bm_uuidwalk_rehash( UUID_Int *uuid_store; uint i; - uint rehash_store_len_new = MAX2(BLI_ghash_size(uuidwalk->verts_uuid), - BLI_ghash_size(uuidwalk->faces_uuid)); + uint rehash_store_len_new = MAX2(BLI_ghash_len(uuidwalk->verts_uuid), + BLI_ghash_len(uuidwalk->faces_uuid)); bm_uuidwalk_rehash_reserve(uuidwalk, rehash_store_len_new); uuid_store = uuidwalk->cache.rehash_store; @@ -520,8 +520,8 @@ static void bm_uuidwalk_pass_add( verts_uuid_pass = uuidwalk->cache.verts_uuid; faces_step_next = uuidwalk->cache.faces_step; - BLI_assert(BLI_ghash_size(verts_uuid_pass) == 0); - BLI_assert(BLI_gset_size(faces_step_next) == 0); + BLI_assert(BLI_ghash_len(verts_uuid_pass) == 0); + BLI_assert(BLI_gset_len(faces_step_next) == 0); /* Add the face_step data from connected faces, creating new passes */ fstep = BLI_mempool_alloc(uuidwalk->step_pool); @@ -659,7 +659,7 @@ static bool bm_uuidwalk_facestep_begin( LinkNode *f_link, *f_link_next, **f_link_prev_p; bool ok = false; - BLI_assert(BLI_ghash_size(uuidwalk->cache.faces_from_uuid) == 0); + BLI_assert(BLI_ghash_len(uuidwalk->cache.faces_from_uuid) == 0); BLI_assert(BLI_listbase_is_empty(&fstep->items)); f_link_prev_p = &fstep->faces; @@ -864,7 +864,7 @@ static BMFace **bm_mesh_region_match_pair( break; } - found = (BLI_ghash_size(w_dst->faces_uuid) == faces_src_region_len); + found = (BLI_ghash_len(w_dst->faces_uuid) == faces_src_region_len); if (found) { break; } @@ -877,7 +877,7 @@ static BMFace **bm_mesh_region_match_pair( if (found) { GHashIterator gh_iter; - const uint faces_result_len = BLI_ghash_size(w_dst->faces_uuid); + const uint faces_result_len = BLI_ghash_len(w_dst->faces_uuid); uint i; faces_result = MEM_mallocN(sizeof(*faces_result) * (faces_result_len + 1), __func__); diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc index b76cd9eaadd..7b93434710b 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -355,7 +355,7 @@ static void deg_debug_graphviz_node(const DebugContext &ctx, case DEG_NODE_TYPE_ID_REF: { const IDDepsNode *id_node = (const IDDepsNode *)node; - if (BLI_ghash_size(id_node->components) == 0) { + if (BLI_ghash_len(id_node->components) == 0) { deg_debug_graphviz_node_single(ctx, node); } else { @@ -406,7 +406,7 @@ static bool deg_debug_graphviz_is_cluster(const DepsNode *node) case DEG_NODE_TYPE_ID_REF: { const IDDepsNode *id_node = (const IDDepsNode *)node; - return BLI_ghash_size(id_node->components) > 0; + return BLI_ghash_len(id_node->components) > 0; } case DEG_NODE_TYPE_PARAMETERS: case DEG_NODE_TYPE_ANIMATION: diff --git a/source/blender/depsgraph/intern/depsgraph_eval.cc b/source/blender/depsgraph/intern/depsgraph_eval.cc index 0448dbe2c8d..a6bdcdca19d 100644 --- a/source/blender/depsgraph/intern/depsgraph_eval.cc +++ b/source/blender/depsgraph/intern/depsgraph_eval.cc @@ -155,5 +155,5 @@ void DEG_evaluate_on_framechange(EvaluationContext *eval_ctx, bool DEG_needs_eval(Depsgraph *graph) { DEG::Depsgraph *deg_graph = reinterpret_cast(graph); - return BLI_gset_size(deg_graph->entry_tags) != 0; + return BLI_gset_len(deg_graph->entry_tags) != 0; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index c29a0708cef..8ee66eddad6 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -253,7 +253,7 @@ void deg_evaluate_on_refresh(EvaluationContext *eval_ctx, const unsigned int layers) { /* Nothing to update, early out. */ - if (BLI_gset_size(graph->entry_tags) == 0) { + if (BLI_gset_len(graph->entry_tags) == 0) { return; } DEG_DEBUG_PRINTF("%s: layers:%u, graph->layers:%u\n", diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index daf008ddb7d..4033e1325e6 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -264,7 +264,7 @@ void deg_graph_flush_updates(Main *bmain, Depsgraph *graph) BLI_assert(bmain != NULL); BLI_assert(graph != NULL); /* Nothing to update, early out. */ - if (BLI_gset_size(graph->entry_tags) == 0) { + if (BLI_gset_len(graph->entry_tags) == 0) { return; } /* Reset all flags, get ready for the flush. */ diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc index 9450ed7f17d..8ebf7424c42 100644 --- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc +++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc @@ -305,7 +305,7 @@ OperationDepsNode *ComponentDepsNode::get_entry_operation() if (entry_operation) { return entry_operation; } - else if (operations_map != NULL && BLI_ghash_size(operations_map) == 1) { + else if (operations_map != NULL && BLI_ghash_len(operations_map) == 1) { OperationDepsNode *op_node = NULL; /* TODO(sergey): This is somewhat slow. */ GHASH_FOREACH_BEGIN(OperationDepsNode *, tmp, operations_map) @@ -328,7 +328,7 @@ OperationDepsNode *ComponentDepsNode::get_exit_operation() if (exit_operation) { return exit_operation; } - else if (operations_map != NULL && BLI_ghash_size(operations_map) == 1) { + else if (operations_map != NULL && BLI_ghash_len(operations_map) == 1) { OperationDepsNode *op_node = NULL; /* TODO(sergey): This is somewhat slow. */ GHASH_FOREACH_BEGIN(OperationDepsNode *, tmp, operations_map) @@ -348,7 +348,7 @@ OperationDepsNode *ComponentDepsNode::get_exit_operation() void ComponentDepsNode::finalize_build() { - operations.reserve(BLI_ghash_size(operations_map)); + operations.reserve(BLI_ghash_len(operations_map)); GHASH_FOREACH_BEGIN(OperationDepsNode *, op_node, operations_map) { operations.push_back(op_node); diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index bba486bc65c..86d5f75888d 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -172,7 +172,7 @@ const char *BIF_listTemplates(const bContext *UNUSED(C)) GHashIterator ghi; const char *menu_header = IFACE_("Template %t|None %x0|"); char *p; - const size_t template_size = (BLI_ghash_size(TEMPLATES_HASH) * 32 + 30); + const size_t template_size = (BLI_ghash_len(TEMPLATES_HASH) * 32 + 30); if (TEMPLATES_MENU != NULL) { MEM_freeN(TEMPLATES_MENU); diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 2bcf3099104..63a255806b8 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -546,7 +546,7 @@ void verifyFaces(ReebGraph *rg) int total = 0; ReebArc *arc = NULL; for (arc = rg->arcs.first; arc; arc = arc->next) { - total += BLI_ghash_size(arc->faces); + total += BLI_ghash_len(arc->faces); } #endif @@ -1656,7 +1656,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) { GHashIterator ghi; int merging = 0; - int total = BLI_ghash_size(arc->faces); + int total = BLI_ghash_len(arc->faces); float avg_angle = 0; float avg_vec[3] = {0, 0, 0}; @@ -1932,7 +1932,7 @@ void REEB_exportGraph(ReebGraph *rg, int count) add_v3_v3v3(p, arc->tail->p, arc->head->p); mul_v3_fl(p, 0.5f); - fprintf(f, "angle %0.3f %0.3f %0.3f %0.3f %i\n", p[0], p[1], p[2], arc->angle, BLI_ghash_size(arc->faces)); + fprintf(f, "angle %0.3f %0.3f %0.3f %0.3f %i\n", p[0], p[1], p[2], arc->angle, BLI_ghash_len(arc->faces)); exportNode(f, "v2", arc->tail); } @@ -2678,7 +2678,7 @@ static void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeInd eed->f1 = 0; } - while (BLI_heap_size(edge_heap) > 0) { + while (BLI_heap_len(edge_heap) > 0) { float current_weight; current_eve->f1 = 1; /* mark vertex as selected */ @@ -2695,7 +2695,7 @@ static void shortestPathsFromVert(EditMesh *em, EditVert *starting_vert, EdgeInd /* Find next shortest edge with unselected verts */ do { current_weight = BLI_heap_node_value(BLI_heap_top(edge_heap)); - select_eed = BLI_heap_popmin(edge_heap); + select_eed = BLI_heap_pop_min(edge_heap); } while (select_eed != NULL && select_eed->v1->f1 != 0 && select_eed->v2->f1); if (select_eed != NULL) { diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index f4ee05636c7..6e059342a6b 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -527,7 +527,7 @@ static GHash *dupli_keyIndexHash(GHash *keyindex) GHash *gh; GHashIterator gh_iter; - gh = BLI_ghash_ptr_new_ex("dupli_keyIndex gh", BLI_ghash_size(keyindex)); + gh = BLI_ghash_ptr_new_ex("dupli_keyIndex gh", BLI_ghash_len(keyindex)); GHASH_ITER (gh_iter, keyindex) { void *cv = BLI_ghashIterator_getKey(&gh_iter); diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index 4602945d11c..5bba21f6252 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -359,7 +359,7 @@ static void curve_draw_stroke_3d(const struct bContext *UNUSED(C), ARegion *UNUS wmOperator *op = arg; struct CurveDrawData *cdd = op->customdata; - const int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + const int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); if (stroke_len == 0) { return; @@ -677,7 +677,7 @@ static void curve_draw_exec_precalc(wmOperator *op) if (!RNA_property_is_set(op->ptr, prop)) { bool use_cyclic = false; - if (BLI_mempool_count(cdd->stroke_elem_pool) > 2) { + if (BLI_mempool_len(cdd->stroke_elem_pool) > 2) { BLI_mempool_iter iter; const struct StrokeElem *selem, *selem_first, *selem_last; @@ -703,7 +703,7 @@ static void curve_draw_exec_precalc(wmOperator *op) (cps->radius_taper_end != 0.0f)) { /* note, we could try to de-duplicate the length calculations above */ - const int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + const int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); BLI_mempool_iter iter; struct StrokeElem *selem, *selem_prev; @@ -763,14 +763,14 @@ static int curve_draw_exec(bContext *C, wmOperator *op) Curve *cu = obedit->data; ListBase *nurblist = object_editcurve_get(obedit); - int stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + int stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); const bool is_3d = (cu->flag & CU_3D) != 0; invert_m4_m4(obedit->imat, obedit->obmat); - if (BLI_mempool_count(cdd->stroke_elem_pool) == 0) { + if (BLI_mempool_len(cdd->stroke_elem_pool) == 0) { curve_draw_stroke_from_operator(op); - stroke_len = BLI_mempool_count(cdd->stroke_elem_pool); + stroke_len = BLI_mempool_len(cdd->stroke_elem_pool); } ED_curve_deselect_all(cu->editnurb); diff --git a/source/blender/editors/curve/editcurve_select.c b/source/blender/editors/curve/editcurve_select.c index 02b8970731c..4a4b13d0d1b 100644 --- a/source/blender/editors/curve/editcurve_select.c +++ b/source/blender/editors/curve/editcurve_select.c @@ -1607,7 +1607,7 @@ static void curve_select_shortest_path_surf(Nurb *nu, int vert_src, int vert_dst int axis, sign; int u, v; - vert_curr = *((int *)BLI_heap_popmin(heap)); + vert_curr = *((int *)BLI_heap_pop_min(heap)); if (vert_curr == vert_dst) { break; } diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 658f8b3958b..76a0d874a0b 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2284,7 +2284,7 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMFace *f, ListBase *kfe /* point to knife edges we've created edges in, edge_array aligned */ KnifeEdge **kfe_array = BLI_array_alloca(kfe_array, edge_array_len); - BLI_assert(BLI_gset_size(kcd->edgenet.edge_visit) == 0); + BLI_assert(BLI_gset_len(kcd->edgenet.edge_visit) == 0); i = 0; for (ref = kfedges->first; ref; ref = ref->next) { diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index abc4b28ee50..5ef9d4a6499 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -759,7 +759,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm MEM_freeN(uniqueUv); /* Allocate connectivity data, we allocate edges once */ - data->uvedges = MEM_mallocN(sizeof(*data->uvedges) * BLI_ghash_size(edgeHash), "uv_brush_edge_connectivity_data"); + data->uvedges = MEM_mallocN(sizeof(*data->uvedges) * BLI_ghash_len(edgeHash), "uv_brush_edge_connectivity_data"); if (!data->uvedges) { BLI_ghash_free(edgeHash, NULL, NULL); MEM_freeN(edges); @@ -772,7 +772,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm GHASH_ITER (gh_iter, edgeHash) { data->uvedges[i++] = *((UvEdge *)BLI_ghashIterator_getKey(&gh_iter)); } - data->totalUvEdges = BLI_ghash_size(edgeHash); + data->totalUvEdges = BLI_ghash_len(edgeHash); /* cleanup temporary stuff */ BLI_ghash_free(edgeHash, NULL, NULL); diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index cf77afa32c4..051605b1079 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -113,7 +113,7 @@ static void outliner_storage_cleanup(SpaceOops *soops) } if (unused) { - if (BLI_mempool_count(ts) == unused) { + if (BLI_mempool_len(ts) == unused) { BLI_mempool_destroy(ts); soops->treestore = NULL; if (soops->treehash) { @@ -123,7 +123,7 @@ static void outliner_storage_cleanup(SpaceOops *soops) } else { TreeStoreElem *tsenew; - BLI_mempool *new_ts = BLI_mempool_create(sizeof(TreeStoreElem), BLI_mempool_count(ts) - unused, + BLI_mempool *new_ts = BLI_mempool_create(sizeof(TreeStoreElem), BLI_mempool_len(ts) - unused, 512, BLI_MEMPOOL_ALLOW_ITER); BLI_mempool_iternew(ts, &iter); while ((tselem = BLI_mempool_iterstep(&iter))) { @@ -1635,7 +1635,7 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) Base *base; TreeElement *te = NULL, *ten; TreeStoreElem *tselem; - int show_opened = !soops->treestore || !BLI_mempool_count(soops->treestore); /* on first view, we open scenes */ + int show_opened = !soops->treestore || !BLI_mempool_len(soops->treestore); /* on first view, we open scenes */ /* Are we looking for something - we want to tag parents to filter child matches * - NOT in datablocks view - searching all datablocks takes way too long to be useful diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 2a3a2b84223..f8a93bd2ce3 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -1291,7 +1291,7 @@ static void p_chart_fill_boundary(PChart *chart, PEdge *be, int nedges) while (nedges > 2) { PEdge *ne, *ne1, *ne2; - e = (PEdge *)BLI_heap_popmin(heap); + e = (PEdge *)BLI_heap_pop_min(heap); e1 = p_boundary_edge_prev(e); e2 = p_boundary_edge_next(e); @@ -2190,7 +2190,7 @@ static void p_chart_simplify_compute(PChart *chart) break; HeapNode *link = BLI_heap_top(heap); - PEdge *edge = (PEdge *)BLI_heap_popmin(heap), *pair = edge->pair; + PEdge *edge = (PEdge *)BLI_heap_pop_min(heap), *pair = edge->pair; PVert *oldv, *keepv; PEdge *wheele, *nexte; diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index c2a38a90621..da36170310a 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -1782,7 +1782,7 @@ static int stitch_init(bContext *C, wmOperator *op) } } - total_edges = BLI_ghash_size(edge_hash); + total_edges = BLI_ghash_len(edge_hash); state->edges = edges = MEM_mallocN(sizeof(*edges) * total_edges, "stitch_edges"); /* I assume any system will be able to at least allocate an iterator :p */ diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index d6e01b6765a..ea8f7516726 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -2009,7 +2009,7 @@ bool GPU_pbvh_buffers_diffuse_changed( } else if (buffers->use_bmesh) { /* due to dynamic nature of dyntopo, only get first material */ - if (BLI_gset_size(bm_faces) > 0) { + if (BLI_gset_len(bm_faces) > 0) { GSetIterator gs_iter; BMFace *f; diff --git a/source/blender/imbuf/intern/moviecache.c b/source/blender/imbuf/intern/moviecache.c index 89955711384..daf062f5499 100644 --- a/source/blender/imbuf/intern/moviecache.c +++ b/source/blender/imbuf/intern/moviecache.c @@ -513,7 +513,7 @@ void IMB_moviecache_get_cache_segments(MovieCache *cache, int proxy, int render_ *points_r = cache->points; } else { - int totframe = BLI_ghash_size(cache->hash); + int totframe = BLI_ghash_len(cache->hash); int *frames = MEM_callocN(totframe * sizeof(int), "movieclip cache frames"); int a, totseg = 0; GHashIterator gh_iter; diff --git a/source/blender/modifiers/intern/MOD_build.c b/source/blender/modifiers/intern/MOD_build.c index 62da8b8ffea..f71d14efb2b 100644 --- a/source/blender/modifiers/intern/MOD_build.c +++ b/source/blender/modifiers/intern/MOD_build.c @@ -154,7 +154,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), numLoops_dst += mp->totloop; } - BLI_assert(hash_num == BLI_ghash_size(vertHash)); + BLI_assert(hash_num == BLI_ghash_len(vertHash)); /* get the set of edges that will be in the new mesh (i.e. all edges * that have both verts in the new mesh) @@ -187,7 +187,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), */ medge = medge_src; hash_num = 0; - BLI_assert(hash_num == BLI_ghash_size(vertHash)); + BLI_assert(hash_num == BLI_ghash_len(vertHash)); for (i = 0; i < numEdges_dst; i++) { void **val_p; me = medge + edgeMap[i]; @@ -201,11 +201,11 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), hash_num++; } } - BLI_assert(hash_num == BLI_ghash_size(vertHash)); + BLI_assert(hash_num == BLI_ghash_len(vertHash)); /* get the set of edges that will be in the new mesh */ for (i = 0; i < numEdges_dst; i++) { - j = BLI_ghash_size(edgeHash); + j = BLI_ghash_len(edgeHash); BLI_ghash_insert(edgeHash, SET_INT_IN_POINTER(j), SET_INT_IN_POINTER(edgeMap[i])); @@ -232,8 +232,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), /* now we know the number of verts, edges and faces, we can create * the mesh */ - result = CDDM_from_template(dm, BLI_ghash_size(vertHash), - BLI_ghash_size(edgeHash), 0, numLoops_dst, numFaces_dst); + result = CDDM_from_template(dm, BLI_ghash_len(vertHash), + BLI_ghash_len(edgeHash), 0, numLoops_dst, numFaces_dst); /* copy the vertices across */ GHASH_ITER (gh_iter, vertHash) { @@ -250,7 +250,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob), } /* copy the edges across, remapping indices */ - for (i = 0; i < BLI_ghash_size(edgeHash); i++) { + for (i = 0; i < BLI_ghash_len(edgeHash); i++) { MEdge source; MEdge *dest; int oldIndex = GET_INT_FROM_POINTER(BLI_ghash_lookup(edgeHash, SET_INT_IN_POINTER(i))); diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 6006b486280..5a13f92f237 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -1470,7 +1470,7 @@ static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd) while (!BLI_heap_is_empty(heap)) { BMFace *adj[2]; - e = BLI_heap_popmin(heap); + e = BLI_heap_pop_min(heap); if (BM_edge_face_pair(e, &adj[0], &adj[1])) { /* If both triangles still free, and if they don't already diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c index 6598d402f72..4dce0dc2a22 100644 --- a/source/blender/python/bmesh/bmesh_py_ops_call.c +++ b/source/blender/python/bmesh/bmesh_py_ops_call.c @@ -566,7 +566,7 @@ static PyObject *bpy_slot_to_py(BMesh *bm, BMOpSlot *slot) switch (slot->slot_subtype.map) { case BMO_OP_SLOT_SUBTYPE_MAP_ELEM: { - item = _PyDict_NewPresized(slot_hash ? BLI_ghash_size(slot_hash) : 0); + item = _PyDict_NewPresized(slot_hash ? BLI_ghash_len(slot_hash) : 0); if (slot_hash) { GHASH_ITER (hash_iter, slot_hash) { BMHeader *ele_key = BLI_ghashIterator_getKey(&hash_iter); @@ -584,7 +584,7 @@ static PyObject *bpy_slot_to_py(BMesh *bm, BMOpSlot *slot) } case BMO_OP_SLOT_SUBTYPE_MAP_FLT: { - item = _PyDict_NewPresized(slot_hash ? BLI_ghash_size(slot_hash) : 0); + item = _PyDict_NewPresized(slot_hash ? BLI_ghash_len(slot_hash) : 0); if (slot_hash) { GHASH_ITER (hash_iter, slot_hash) { BMHeader *ele_key = BLI_ghashIterator_getKey(&hash_iter); @@ -602,7 +602,7 @@ static PyObject *bpy_slot_to_py(BMesh *bm, BMOpSlot *slot) } case BMO_OP_SLOT_SUBTYPE_MAP_INT: { - item = _PyDict_NewPresized(slot_hash ? BLI_ghash_size(slot_hash) : 0); + item = _PyDict_NewPresized(slot_hash ? BLI_ghash_len(slot_hash) : 0); if (slot_hash) { GHASH_ITER (hash_iter, slot_hash) { BMHeader *ele_key = BLI_ghashIterator_getKey(&hash_iter); @@ -620,7 +620,7 @@ static PyObject *bpy_slot_to_py(BMesh *bm, BMOpSlot *slot) } case BMO_OP_SLOT_SUBTYPE_MAP_BOOL: { - item = _PyDict_NewPresized(slot_hash ? BLI_ghash_size(slot_hash) : 0); + item = _PyDict_NewPresized(slot_hash ? BLI_ghash_len(slot_hash) : 0); if (slot_hash) { GHASH_ITER (hash_iter, slot_hash) { BMHeader *ele_key = BLI_ghashIterator_getKey(&hash_iter); diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 5b84a7cf73c..0cadbc30a9f 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -384,7 +384,7 @@ static PyObject *pyop_dir(PyObject *UNUSED(self)) int i; WM_operatortype_iter(&iter); - list = PyList_New(BLI_ghash_size(iter.gh)); + list = PyList_New(BLI_ghash_len(iter.gh)); for (i = 0; !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter), i++) { wmOperatorType *ot = BLI_ghashIterator_getValue(&iter); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index a197d0813e7..87260d6e786 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -223,7 +223,7 @@ static PyObject *id_free_weakref_cb(PyObject *weakinfo_capsule, PyObject *weakre GHash *weakinfo_hash = PyCapsule_GetPointer(weakinfo_capsule, NULL); - if (BLI_ghash_size(weakinfo_hash) > 1) { + if (BLI_ghash_len(weakinfo_hash) > 1) { BLI_ghash_remove(weakinfo_hash, weakref, NULL, NULL); } else { /* get the last id and free it */ @@ -243,7 +243,7 @@ static void id_release_weakref_list(struct ID *id, GHash *weakinfo_hash) BLI_ghashIterator_init(&weakinfo_hash_iter, weakinfo_hash); #ifdef DEBUG_RNA_WEAKREF - fprintf(stdout, "id_release_weakref: '%s', %d items\n", id->name, BLI_ghash_size(weakinfo_hash)); + fprintf(stdout, "id_release_weakref: '%s', %d items\n", id->name, BLI_ghash_len(weakinfo_hash)); #endif while (!BLI_ghashIterator_done(&weakinfo_hash_iter)) { @@ -266,7 +266,7 @@ static void id_release_weakref_list(struct ID *id, GHash *weakinfo_hash) BLI_ghash_remove(id_weakref_pool, (void *)id, NULL, NULL); BLI_ghash_free(weakinfo_hash, NULL, NULL); - if (BLI_ghash_size(id_weakref_pool) == 0) { + if (BLI_ghash_len(id_weakref_pool) == 0) { BLI_ghash_free(id_weakref_pool, NULL, NULL); id_weakref_pool = NULL; #ifdef DEBUG_RNA_WEAKREF -- cgit v1.2.3