From f4fe1b8e77e443b899466acd951628a2f68e5049 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 15 Apr 2013 23:12:49 +0000 Subject: Fix a few warnings. One was an actual bug in freestyle where stroke attributes were not properly interpolated. --- source/blender/editors/space_node/node_add.c | 2 ++ source/blender/editors/space_node/node_group.c | 8 ++++---- source/blender/freestyle/intern/image/GaussianFilter.h | 4 ---- source/blender/freestyle/intern/stroke/Stroke.cpp | 14 ++++++-------- 4 files changed, 12 insertions(+), 16 deletions(-) (limited to 'source') diff --git a/source/blender/editors/space_node/node_add.c b/source/blender/editors/space_node/node_add.c index 975a29851db..0425ec58f83 100644 --- a/source/blender/editors/space_node/node_add.c +++ b/source/blender/editors/space_node/node_add.c @@ -445,6 +445,8 @@ static int new_node_tree_exec(bContext *C, wmOperator *op) } else if (snode) idname = snode->tree_idname; + else + return OPERATOR_CANCELLED; if (RNA_struct_property_is_set(op->ptr, "name")) { RNA_string_get(op->ptr, "name", treename); diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 30ba4108143..f5f0493e9c9 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -338,8 +338,8 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode) /* if group output is not externally linked, * convert the constant input value to ensure somewhat consistent behavior */ if (num_external_links == 0) { - bNodeSocket *sock = node_group_find_input_socket(gnode, identifier); - BLI_assert(sock); + /* XXX TODO bNodeSocket *sock = node_group_find_input_socket(gnode, identifier); + BLI_assert(sock);*/ /* XXX TODO nodeSocketCopy(ntree, link->tosock->new_sock, link->tonode->new_node, ntree, sock, gnode);*/ } @@ -366,8 +366,8 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode) /* if group output is not internally linked, * convert the constant output value to ensure somewhat consistent behavior */ if (num_internal_links == 0) { - bNodeSocket *sock = node_group_find_output_socket(gnode, identifier); - BLI_assert(sock); + /* XXX TODO bNodeSocket *sock = node_group_find_output_socket(gnode, identifier); + BLI_assert(sock);*/ /* XXX TODO nodeSocketCopy(ntree, link->tosock, link->tonode, ntree, sock, gnode); */ } diff --git a/source/blender/freestyle/intern/image/GaussianFilter.h b/source/blender/freestyle/intern/image/GaussianFilter.h index b300ec00989..02c2a917bde 100644 --- a/source/blender/freestyle/intern/image/GaussianFilter.h +++ b/source/blender/freestyle/intern/image/GaussianFilter.h @@ -125,10 +125,6 @@ protected: */ -#ifdef __MACH__ -# define sqrtf(x) (sqrt(x)) -#endif - template float GaussianFilter::getSmoothedPixel(Map *map, int x, int y) { diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp index a0b75241066..79443742573 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.cpp +++ b/source/blender/freestyle/intern/stroke/Stroke.cpp @@ -113,8 +113,8 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute& a1, const StrokeAttribut if (a1._userAttributesReal->size() == a2._userAttributesReal->size()) { _userAttributesReal = new realMap; realMap::iterator it1 = a1._userAttributesReal->begin(), it1end = a1._userAttributesReal->end(); - realMap::iterator it2 = a2._userAttributesReal->begin(), it2end = a2._userAttributesReal->end(); - for (; it1 != it1end; ++it1) { + realMap::iterator it2 = a2._userAttributesReal->begin(); + for (; it1 != it1end; ++it1, ++it2) { (*_userAttributesReal)[(*it1).first] = ((1 - t) * (*it1).second + t * (*it2).second); } } @@ -126,8 +126,8 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute& a1, const StrokeAttribut if (a1._userAttributesVec2f->size() == a2._userAttributesVec2f->size()) { _userAttributesVec2f = new Vec2fMap; Vec2fMap::iterator it1 = a1._userAttributesVec2f->begin(), it1end = a1._userAttributesVec2f->end(); - Vec2fMap::iterator it2 = a2._userAttributesVec2f->begin(), it2end = a2._userAttributesVec2f->end(); - for (; it1 != it1end; ++it1) { + Vec2fMap::iterator it2 = a2._userAttributesVec2f->begin(); + for (; it1 != it1end; ++it1, ++it2) { (*_userAttributesVec2f)[(*it1).first] = ((1 - t) * (*it1).second + t * (*it2).second); } } @@ -139,8 +139,8 @@ StrokeAttribute::StrokeAttribute(const StrokeAttribute& a1, const StrokeAttribut if (a1._userAttributesVec3f->size() == a2._userAttributesVec3f->size()) { _userAttributesVec3f = new Vec3fMap; Vec3fMap::iterator it1 = a1._userAttributesVec3f->begin(), it1end = a1._userAttributesVec3f->end(); - Vec3fMap::iterator it2 = a2._userAttributesVec3f->begin(), it2end = a2._userAttributesVec3f->end(); - for (; it1 != it1end; ++it1) { + Vec3fMap::iterator it2 = a2._userAttributesVec3f->begin(); + for (; it1 != it1end; ++it1, ++it2) { (*_userAttributesVec3f)[(*it1).first] = ((1 - t) * (*it1).second + t * (*it2).second); } } @@ -659,8 +659,6 @@ void Stroke::RemoveVertex(StrokeVertex *iVertex) void Stroke::InsertVertex(StrokeVertex *iVertex, StrokeInternal::StrokeVertexIterator next) { - vertex_container::iterator it = _Vertices.begin(), itend = _Vertices.end(); - vertex_container::iterator itnext = next.getIt(); _Vertices.insert(itnext, iVertex); UpdateLength(); -- cgit v1.2.3