Fix a few warnings. One was an actual bug in freestyle where stroke attributes
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 15 Apr 2013 23:12:49 +0000 (23:12 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 15 Apr 2013 23:12:49 +0000 (23:12 +0000)
were not properly interpolated.

source/blender/editors/space_node/node_add.c
source/blender/editors/space_node/node_group.c
source/blender/freestyle/intern/image/GaussianFilter.h
source/blender/freestyle/intern/stroke/Stroke.cpp

index 975a29851dbfcf33d4ffa3f36ae573a909f9246a..0425ec58f834c5466b877d0e8ab7d1f79d2dc047 100644 (file)
@@ -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);
index 30ba41081433fc6c9a5fa2b1af2e82ec67b58db7..f5f0493e9c9623f3d9e26106a7cdc39c471c6aa0 100644 (file)
@@ -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); */
                        }
index b300ec009896607e182ab74f278bd64b1f769f47..02c2a917bded4de7d2004f8886788d84cf2595c4 100644 (file)
@@ -125,10 +125,6 @@ protected:
   
 */
 
-#ifdef __MACH__
-# define sqrtf(x) (sqrt(x))
-#endif
-
 template<class Map>
 float GaussianFilter::getSmoothedPixel(Map *map, int x, int y)
 {
index a0b75241066943ccde87cc2eb99858fb3dbde0a9..79443742573e78ba42764cff991903bfbdbf219b 100644 (file)
@@ -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();