Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-01 06:47:59 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2012-12-01 06:47:59 +0400
commited0e2fbd9f4edd55e11df694b34e233cb38cb953 (patch)
tree70a0d0fc080339b87cbeb73ebab6d4eda91ca5ba /source/blender/blenlib
parent129a29873e552d769339c2b7d3b99a0afbbf2ae0 (diff)
parent75cce01a614e686530e26dbd186a88d75dc4e7b5 (diff)
Merged changes in the trunk up to revision 52690.
Conflicts resolved: release/datafiles/startup.blend source/blender/blenlib/intern/bpath.c
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/BLI_array.h27
-rw-r--r--source/blender/blenlib/BLI_endian_switch.h3
-rw-r--r--source/blender/blenlib/BLI_rect.h14
-rw-r--r--source/blender/blenlib/BLI_scanfill.h13
-rw-r--r--source/blender/blenlib/BLI_utildefines.h10
-rw-r--r--source/blender/blenlib/intern/bpath.c67
-rw-r--r--source/blender/blenlib/intern/scanfill.c145
-rw-r--r--source/blender/blenlib/intern/string.c6
-rw-r--r--source/blender/blenlib/intern/string_utf8.c32
9 files changed, 191 insertions, 126 deletions
diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h
index 84cfe89f1b8..a21778307c1 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -77,11 +77,13 @@
MEM_allocN_len(arr) / sizeof(*arr) \
)
+#define _bli_array_totalsize_static(arr) \
+ (sizeof(_##arr##_static) / sizeof(*arr))
#define BLI_array_totalsize(arr) ( \
(size_t) \
(((void *)(arr) == (void *)_##arr##_static && (void *)(arr) != NULL) ? \
- (sizeof(_##arr##_static) / sizeof(*arr)) : \
+ _bli_array_totalsize_static(arr) : \
BLI_array_totalsize_dyn(arr)) \
)
@@ -93,8 +95,18 @@
*
* Allow for a large 'num' value when the new size is more then double
* to allocate the exact sized array. */
-#define _bli_array_grow_items(arr, num) ( \
- (BLI_array_totalsize(arr) >= _##arr##_count + num) ? \
+
+/* grow an array by a specified number of items */
+#define BLI_array_grow_items(arr, num) ( \
+ (((void *)(arr) == NULL) && \
+ ((void *)(_##arr##_static) != NULL) && \
+ /* dont add _##arr##_count below because it must be zero */ \
+ (_bli_array_totalsize_static(arr) >= _##arr##_count + num)) ? \
+ /* we have an empty array and a static var big enough */ \
+ ((arr = (void *)_##arr##_static), (_##arr##_count += (num))) \
+ : \
+ /* use existing static array or allocate */ \
+ ((BLI_array_totalsize(arr) >= _##arr##_count + num) ? \
(_##arr##_count += num) : \
( \
(void) (_##arr##_tmp = MEM_callocN( \
@@ -115,14 +127,7 @@
(void) (arr = _##arr##_tmp \
), \
(_##arr##_count += num) \
- ) \
-)
-
-/* grow an array by a specified number of items */
-#define BLI_array_grow_items(arr, num) ( \
- ((void *)(arr) == NULL && (void *)(_##arr##_static) != NULL) ? \
- ((arr = (void *)_##arr##_static), (_##arr##_count += num)) : \
- _bli_array_grow_items(arr, num) \
+ )) \
)
/* returns length of array */
diff --git a/source/blender/blenlib/BLI_endian_switch.h b/source/blender/blenlib/BLI_endian_switch.h
index 7cb2790525d..f48b1b072c3 100644
--- a/source/blender/blenlib/BLI_endian_switch.h
+++ b/source/blender/blenlib/BLI_endian_switch.h
@@ -29,8 +29,7 @@
#ifdef __GNUC__
# define ATTR_ENDIAN_SWITCH \
- __attribute__((nonnull(1))) \
- __attribute__((pure))
+ __attribute__((nonnull(1)))
#else
# define ATTR_ENDIAN_SWITCH
#endif
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index f84820e94f3..f2e26093711 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -33,6 +33,9 @@
* \ingroup bli
*/
+#include "DNA_vec_types.h"
+#include "BLI_utildefines.h"
+
struct rctf;
struct rcti;
@@ -75,17 +78,6 @@ void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
void print_rctf(const char *str, const struct rctf *rect);
void print_rcti(const char *str, const struct rcti *rect);
-/* hrmf, we need to work out this inline stuff */
-#if defined(_MSC_VER)
-# define BLI_INLINE static __forceinline
-#elif defined(__GNUC__)
-# define BLI_INLINE static inline __attribute((always_inline))
-#else
-/* #warning "MSC/GNUC defines not found, inline non-functional" */
-# define BLI_INLINE static
-#endif
-
-#include "DNA_vec_types.h"
BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct) { return (float)(rct->xmin + rct->xmax) / 2.0f; }
BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct) { return (float)(rct->ymin + rct->ymax) / 2.0f; }
BLI_INLINE int BLI_rcti_cent_x(const struct rcti *rct) { return (rct->xmin + rct->xmax) / 2; }
diff --git a/source/blender/blenlib/BLI_scanfill.h b/source/blender/blenlib/BLI_scanfill.h
index 892afdd0b27..c8fd72bbbd2 100644
--- a/source/blender/blenlib/BLI_scanfill.h
+++ b/source/blender/blenlib/BLI_scanfill.h
@@ -94,9 +94,18 @@ typedef struct ScanFillFace {
struct ScanFillVert *BLI_scanfill_vert_add(ScanFillContext *sf_ctx, const float vec[3]);
struct ScanFillEdge *BLI_scanfill_edge_add(ScanFillContext *sf_ctx, struct ScanFillVert *v1, struct ScanFillVert *v2);
+enum {
+ BLI_SCANFILL_CALC_QUADTRI_FASTPATH = (1 << 0),
+
+ /* note: using BLI_SCANFILL_CALC_REMOVE_DOUBLES
+ * Assumes ordered edges, otherwise we risk an eternal loop
+ * removing double verts. - campbell */
+ BLI_SCANFILL_CALC_REMOVE_DOUBLES = (1 << 1),
+};
+
int BLI_scanfill_begin(ScanFillContext *sf_ctx);
-int BLI_scanfill_calc(ScanFillContext *sf_ctx, const short do_quad_tri_speedup);
-int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup,
+int BLI_scanfill_calc(ScanFillContext *sf_ctx, const int flag);
+int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag,
const float nor_proj[3]);
void BLI_scanfill_end(ScanFillContext *sf_ctx);
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index a22aa0c13d7..7c3b70545d6 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -324,11 +324,13 @@
/*little macro so inline keyword works*/
#if defined(_MSC_VER)
# define BLI_INLINE static __forceinline
-#elif defined(__GNUC__)
-# define BLI_INLINE static inline __attribute((always_inline))
#else
-/* #warning "MSC/GNUC defines not found, inline non-functional" */
-# define BLI_INLINE static
+# if (defined(__APPLE__) && defined(__ppc__))
+/* static inline __attribute__ here breaks osx ppc gcc42 build */
+# define BLI_INLINE static __attribute__((always_inline))
+# else
+# define BLI_INLINE static inline __attribute__((always_inline))
+# endif
#endif
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index d725a0a9417..8b63a94951d 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -64,6 +64,8 @@
#include "DNA_sequence_types.h"
#include "DNA_sound_types.h"
#include "DNA_text_types.h"
+#include "DNA_material_types.h"
+#include "DNA_node_types.h"
#include "DNA_texture_types.h"
#include "DNA_vfont_types.h"
#include "DNA_scene_types.h"
@@ -77,6 +79,7 @@
#include "BKE_font.h"
#include "BKE_library.h"
#include "BKE_main.h"
+#include "BKE_node.h"
#include "BKE_report.h"
#include "BKE_sequencer.h"
#include "BKE_image.h" /* so we can check the image's type */
@@ -383,7 +386,6 @@ static int rewrite_path_alloc(char **path, BPathVisitor visit_cb, const char *ab
/* Run visitor function 'visit' on all paths contained in 'id'. */
void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int flag, void *bpath_user_data)
{
- Image *ima;
const char *absbase = (flag & BLI_BPATH_TRAVERSE_ABS) ? ID_BLEND_PATH(bmain, id) : NULL;
if ((flag & BLI_BPATH_TRAVERSE_SKIP_LIBRARY) && id->lib) {
@@ -392,6 +394,8 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
switch (GS(id->name)) {
case ID_IM:
+ {
+ Image *ima;
ima = (Image *)id;
if (ima->packedfile == NULL || (flag & BLI_BPATH_TRAVERSE_SKIP_PACKED) == 0) {
if (ELEM3(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE)) {
@@ -399,15 +403,20 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
}
}
break;
+ }
case ID_BR:
{
Brush *brush = (Brush *)id;
if (brush->icon_filepath[0]) {
rewrite_path_fixed(brush->icon_filepath, visit_cb, absbase, bpath_user_data);
}
+ break;
}
- break;
case ID_OB:
+ {
+ Object *ob = (Object *)id;
+ ModifierData *md;
+ ParticleSystem *psys;
#define BPATH_TRAVERSE_POINTCACHE(ptcaches) \
{ \
@@ -422,12 +431,6 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
} \
} (void)0
-
- {
- Object *ob = (Object *)id;
- ModifierData *md;
- ParticleSystem *psys;
-
/* do via modifiers instead */
#if 0
if (ob->fluidsimSettings) {
@@ -465,19 +468,19 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
for (psys = ob->particlesystem.first; psys; psys = psys->next) {
BPATH_TRAVERSE_POINTCACHE(psys->ptcaches);
}
- }
#undef BPATH_TRAVERSE_POINTCACHE
break;
+ }
case ID_SO:
{
bSound *sound = (bSound *)id;
if (sound->packedfile == NULL || (flag & BLI_BPATH_TRAVERSE_SKIP_PACKED) == 0) {
rewrite_path_fixed(sound->name, visit_cb, absbase, bpath_user_data);
}
+ break;
}
- break;
case ID_TXT:
if (((Text *)id)->name) {
rewrite_path_alloc(&((Text *)id)->name, visit_cb, absbase, bpath_user_data);
@@ -491,17 +494,49 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
rewrite_path_fixed(((VFont *)id)->name, visit_cb, absbase, bpath_user_data);
}
}
+ break;
}
+ case ID_MA:
+ {
+ Material *ma = (Material *)id;
+ bNodeTree *ntree = ma->nodetree;
+
+ if(ntree) {
+ bNode *node;
+
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == SH_NODE_SCRIPT) {
+ NodeShaderScript *nss = (NodeShaderScript *)node->storage;
+ rewrite_path_fixed(nss->filepath, visit_cb, absbase, bpath_user_data);
+ }
+ }
+ }
break;
+ }
+ case ID_NT:
+ {
+ bNodeTree *ntree = (bNodeTree *)id;
+ bNode *node;
+
+ if (ntree->type == NTREE_SHADER) {
+ /* same as lines above */
+ for (node = ntree->nodes.first; node; node = node->next) {
+ if (node->type == SH_NODE_SCRIPT) {
+ NodeShaderScript *nss = (NodeShaderScript *)node->storage;
+ rewrite_path_fixed(nss->filepath, visit_cb, absbase, bpath_user_data);
+ }
+ }
+ }
+ break;
+ }
case ID_TE:
{
Tex *tex = (Tex *)id;
if (tex->type == TEX_VOXELDATA && TEX_VD_IS_SOURCE_PATH(tex->vd->file_format)) {
rewrite_path_fixed(tex->vd->source_path, visit_cb, absbase, bpath_user_data);
}
+ break;
}
- break;
-
case ID_SCE:
{
Scene *scene = (Scene *)id;
@@ -547,30 +582,30 @@ void BLI_bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int
rewrite_path_fixed(module->module_path, visit_cb, absbase, bpath_user_data);
}
}
+ break;
}
- break;
case ID_ME:
{
Mesh *me = (Mesh *)id;
if (me->ldata.external) {
rewrite_path_fixed(me->ldata.external->filename, visit_cb, absbase, bpath_user_data);
}
+ break;
}
- break;
case ID_LI:
{
Library *lib = (Library *)id;
if (rewrite_path_fixed(lib->name, visit_cb, absbase, bpath_user_data)) {
BKE_library_filepath_set(lib, lib->name);
}
+ break;
}
- break;
case ID_MC:
{
MovieClip *clip = (MovieClip *)id;
rewrite_path_fixed(clip->name, visit_cb, absbase, bpath_user_data);
+ break;
}
- break;
default:
/* Nothing to do for other IDs that don't contain file paths. */
break;
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index 1b7858f7f88..defe500cb21 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -503,8 +503,7 @@ static void splitlist(ScanFillContext *sf_ctx, ListBase *tempve, ListBase *tempe
}
}
-
-static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf)
+static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf, const int flag)
{
ScanFillVertLink *sc = NULL, *sc1;
ScanFillVert *eve, *v1, *v2, *v3;
@@ -530,26 +529,28 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf)
#endif
/* STEP 0: remove zero sized edges */
- eed = sf_ctx->filledgebase.first;
- while (eed) {
- if (equals_v2v2(eed->v1->xy, eed->v2->xy)) {
- if (eed->v1->f == SF_VERT_ZERO_LEN && eed->v2->f != SF_VERT_ZERO_LEN) {
- eed->v2->f = SF_VERT_ZERO_LEN;
- eed->v2->tmp.v = eed->v1->tmp.v;
- }
- else if (eed->v2->f == SF_VERT_ZERO_LEN && eed->v1->f != SF_VERT_ZERO_LEN) {
- eed->v1->f = SF_VERT_ZERO_LEN;
- eed->v1->tmp.v = eed->v2->tmp.v;
- }
- else if (eed->v2->f == SF_VERT_ZERO_LEN && eed->v1->f == SF_VERT_ZERO_LEN) {
- eed->v1->tmp.v = eed->v2->tmp.v;
- }
- else {
- eed->v2->f = SF_VERT_ZERO_LEN;
- eed->v2->tmp.v = eed->v1;
+ if (flag & BLI_SCANFILL_CALC_REMOVE_DOUBLES) {
+ eed = sf_ctx->filledgebase.first;
+ while (eed) {
+ if (equals_v2v2(eed->v1->xy, eed->v2->xy)) {
+ if (eed->v1->f == SF_VERT_ZERO_LEN && eed->v2->f != SF_VERT_ZERO_LEN) {
+ eed->v2->f = SF_VERT_ZERO_LEN;
+ eed->v2->tmp.v = eed->v1->tmp.v;
+ }
+ else if (eed->v2->f == SF_VERT_ZERO_LEN && eed->v1->f != SF_VERT_ZERO_LEN) {
+ eed->v1->f = SF_VERT_ZERO_LEN;
+ eed->v1->tmp.v = eed->v2->tmp.v;
+ }
+ else if (eed->v2->f == SF_VERT_ZERO_LEN && eed->v1->f == SF_VERT_ZERO_LEN) {
+ eed->v1->tmp.v = eed->v2->tmp.v;
+ }
+ else {
+ eed->v2->f = SF_VERT_ZERO_LEN;
+ eed->v2->tmp.v = eed->v1;
+ }
}
+ eed = eed->next;
}
- eed = eed->next;
}
/* STEP 1: make using FillVert and FillEdge lists a sorted
@@ -572,28 +573,42 @@ static int scanfill(ScanFillContext *sf_ctx, PolyFill *pf)
qsort(sf_ctx->_scdata, verts, sizeof(ScanFillVertLink), vergscdata);
- eed = sf_ctx->filledgebase.first;
- while (eed) {
- nexted = eed->next;
- BLI_remlink(&sf_ctx->filledgebase, eed);
- /* This code is for handling zero-length edges that get
- * collapsed in step 0. It was removed for some time to
- * fix trunk bug #4544, so if that comes back, this code
- * may need some work, or there will have to be a better
- * fix to #4544. */
- if (eed->v1->f == SF_VERT_ZERO_LEN) {
- v1 = eed->v1;
- while ((eed->v1->f == SF_VERT_ZERO_LEN) && (eed->v1->tmp.v != v1) && (eed->v1 != eed->v1->tmp.v))
- eed->v1 = eed->v1->tmp.v;
+ if (flag & BLI_SCANFILL_CALC_REMOVE_DOUBLES) {
+ for (eed = sf_ctx->filledgebase.first; eed; eed = nexted) {
+ nexted = eed->next;
+ BLI_remlink(&sf_ctx->filledgebase, eed);
+ /* This code is for handling zero-length edges that get
+ * collapsed in step 0. It was removed for some time to
+ * fix trunk bug #4544, so if that comes back, this code
+ * may need some work, or there will have to be a better
+ * fix to #4544.
+ *
+ * warning, this can hang on un-ordered edges, see: [#33281]
+ * for now disable 'BLI_SCANFILL_CALC_REMOVE_DOUBLES' for ngons.
+ */
+ if (eed->v1->f == SF_VERT_ZERO_LEN) {
+ v1 = eed->v1;
+ while ((eed->v1->f == SF_VERT_ZERO_LEN) && (eed->v1->tmp.v != v1) && (eed->v1 != eed->v1->tmp.v))
+ eed->v1 = eed->v1->tmp.v;
+ }
+ if (eed->v2->f == SF_VERT_ZERO_LEN) {
+ v2 = eed->v2;
+ while ((eed->v2->f == SF_VERT_ZERO_LEN) && (eed->v2->tmp.v != v2) && (eed->v2 != eed->v2->tmp.v))
+ eed->v2 = eed->v2->tmp.v;
+ }
+ if (eed->v1 != eed->v2) {
+ addedgetoscanlist(sf_ctx, eed, verts);
+ }
}
- if (eed->v2->f == SF_VERT_ZERO_LEN) {
- v2 = eed->v2;
- while ((eed->v2->f == SF_VERT_ZERO_LEN) && (eed->v2->tmp.v != v2) && (eed->v2 != eed->v2->tmp.v))
- eed->v2 = eed->v2->tmp.v;
+ }
+ else {
+ for (eed = sf_ctx->filledgebase.first; eed; eed = nexted) {
+ nexted = eed->next;
+ BLI_remlink(&sf_ctx->filledgebase, eed);
+ if (eed->v1 != eed->v2) {
+ addedgetoscanlist(sf_ctx, eed, verts);
+ }
}
- if (eed->v1 != eed->v2) addedgetoscanlist(sf_ctx, eed, verts);
-
- eed = nexted;
}
#if 0
sc = scdata;
@@ -775,12 +790,12 @@ int BLI_scanfill_begin(ScanFillContext *sf_ctx)
return 1;
}
-int BLI_scanfill_calc(ScanFillContext *sf_ctx, const short do_quad_tri_speedup)
+int BLI_scanfill_calc(ScanFillContext *sf_ctx, const int flag)
{
- return BLI_scanfill_calc_ex(sf_ctx, do_quad_tri_speedup, NULL);
+ return BLI_scanfill_calc_ex(sf_ctx, flag, NULL);
}
-int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedup, const float nor_proj[3])
+int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float nor_proj[3])
{
/*
* - fill works with its own lists, so create that first (no faces!)
@@ -810,30 +825,32 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedu
a += 1;
}
- if (do_quad_tri_speedup && (a == 3)) {
- eve = sf_ctx->fillvertbase.first;
+ if (flag & BLI_SCANFILL_CALC_QUADTRI_FASTPATH) {
+ if (a == 3) {
+ eve = sf_ctx->fillvertbase.first;
- addfillface(sf_ctx, eve, eve->next, eve->next->next);
- return 1;
- }
- else if (do_quad_tri_speedup && (a == 4)) {
- float vec1[3], vec2[3];
-
- eve = sf_ctx->fillvertbase.first;
- /* no need to check 'eve->next->next->next' is valid, already counted */
- /* use shortest diagonal for quad */
- sub_v3_v3v3(vec1, eve->co, eve->next->next->co);
- sub_v3_v3v3(vec2, eve->next->co, eve->next->next->next->co);
-
- if (dot_v3v3(vec1, vec1) < dot_v3v3(vec2, vec2)) {
addfillface(sf_ctx, eve, eve->next, eve->next->next);
- addfillface(sf_ctx, eve->next->next, eve->next->next->next, eve);
+ return 1;
}
- else {
- addfillface(sf_ctx, eve->next, eve->next->next, eve->next->next->next);
- addfillface(sf_ctx, eve->next->next->next, eve, eve->next);
+ else if (a == 4) {
+ float vec1[3], vec2[3];
+
+ eve = sf_ctx->fillvertbase.first;
+ /* no need to check 'eve->next->next->next' is valid, already counted */
+ /* use shortest diagonal for quad */
+ sub_v3_v3v3(vec1, eve->co, eve->next->next->co);
+ sub_v3_v3v3(vec2, eve->next->co, eve->next->next->next->co);
+
+ if (dot_v3v3(vec1, vec1) < dot_v3v3(vec2, vec2)) {
+ addfillface(sf_ctx, eve, eve->next, eve->next->next);
+ addfillface(sf_ctx, eve->next->next, eve->next->next->next, eve);
+ }
+ else {
+ addfillface(sf_ctx, eve->next, eve->next->next, eve->next->next->next);
+ addfillface(sf_ctx, eve->next->next->next, eve, eve->next);
+ }
+ return 2;
}
- return 2;
}
/* first test vertices if they are in edges */
@@ -1091,7 +1108,7 @@ int BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const short do_quad_tri_speedu
for (a = 0; a < poly; a++) {
if (pf->edges > 1) {
splitlist(sf_ctx, &tempve, &temped, pf->nr);
- totfaces += scanfill(sf_ctx, pf);
+ totfaces += scanfill(sf_ctx, pf, flag);
}
pf++;
}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 14e0dc2f049..f23f75f69d9 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -85,6 +85,10 @@ size_t BLI_vsnprintf(char *__restrict buffer, size_t count, const char *__restri
{
size_t n;
+ BLI_assert(buffer != NULL);
+ BLI_assert(count > 0);
+ BLI_assert(format != NULL);
+
n = vsnprintf(buffer, count, format, arg);
if (n != -1 && n < count) {
@@ -115,6 +119,8 @@ char *BLI_sprintfN(const char *__restrict format, ...)
va_list arg;
char *n;
+ BLI_assert(format != NULL);
+
va_start(arg, format);
ds = BLI_dynstr_new();
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index 16a5f03095d..bf98f2ae77c 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -394,10 +394,10 @@ int BLI_str_utf8_size_safe(const char *p)
/* was g_utf8_get_char */
/**
* BLI_str_utf8_as_unicode:
- * @p a pointer to Unicode character encoded as UTF-8
+ * \param p a pointer to Unicode character encoded as UTF-8
*
* Converts a sequence of bytes encoded as UTF-8 to a Unicode character.
- * If @p does not point to a valid UTF-8 encoded character, results are
+ * If \a p does not point to a valid UTF-8 encoded character, results are
* undefined. If you are not sure that the bytes are complete
* valid Unicode characters, you should use g_utf8_get_char_validated()
* instead.
@@ -536,14 +536,14 @@ size_t BLI_str_utf8_from_unicode(unsigned int c, char *outbuf)
/* was g_utf8_find_prev_char */
/**
* BLI_str_find_prev_char_utf8:
- * @str: pointer to the beginning of a UTF-8 encoded string
- * @p pointer to some position within @str
+ * \param str pointer to the beginning of a UTF-8 encoded string
+ * \param p pointer to some position within \a str
*
- * Given a position @p with a UTF-8 encoded string @str, find the start
- * of the previous UTF-8 character starting before. @p Returns %NULL if no
- * UTF-8 characters are present in @str before @p
+ * Given a position \a p with a UTF-8 encoded string \a str, find the start
+ * of the previous UTF-8 character starting before. \a p Returns %NULL if no
+ * UTF-8 characters are present in \a str before \a p
*
- * @p does not have to be at the beginning of a UTF-8 character. No check
+ * \a p does not have to be at the beginning of a UTF-8 character. No check
* is made to see if the character found is actually valid other than
* it starts with an appropriate byte.
*
@@ -562,13 +562,13 @@ char * BLI_str_find_prev_char_utf8(const char *str, const char *p)
/* was g_utf8_find_next_char */
/**
* BLI_str_find_next_char_utf8:
- * @p a pointer to a position within a UTF-8 encoded string
- * @end a pointer to the byte following the end of the string,
+ * \param p a pointer to a position within a UTF-8 encoded string
+ * \param end a pointer to the byte following the end of the string,
* or %NULL to indicate that the string is nul-terminated.
*
- * Finds the start of the next UTF-8 character in the string after @p
+ * Finds the start of the next UTF-8 character in the string after \a p
*
- * @p does not have to be at the beginning of a UTF-8 character. No check
+ * \a p does not have to be at the beginning of a UTF-8 character. No check
* is made to see if the character found is actually valid other than
* it starts with an appropriate byte.
*
@@ -594,13 +594,13 @@ char *BLI_str_find_next_char_utf8(const char *p, const char *end)
/* was g_utf8_prev_char */
/**
* BLI_str_prev_char_utf8:
- * @p a pointer to a position within a UTF-8 encoded string
+ * \param p a pointer to a position within a UTF-8 encoded string
*
- * Finds the previous UTF-8 character in the string before @p
+ * Finds the previous UTF-8 character in the string before \a p
*
- * @p does not have to be at the beginning of a UTF-8 character. No check
+ * \a p does not have to be at the beginning of a UTF-8 character. No check
* is made to see if the character found is actually valid other than
- * it starts with an appropriate byte. If @p might be the first
+ * it starts with an appropriate byte. If \a p might be the first
* character of the string, you must use g_utf8_find_prev_char() instead.
*
* Return value: a pointer to the found character.