A patch set from Bastien Montagne (thanks!) for silencing build warnings (from gcc...
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Fri, 18 Jan 2013 02:13:36 +0000 (02:13 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Fri, 18 Jan 2013 02:13:36 +0000 (02:13 +0000)
mostly by commenting out unused variables, or using the BLI's SET_UINT_IN_POINTER macro.

12 files changed:
source/blender/freestyle/intern/application/AppView.cpp
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
source/blender/freestyle/intern/geometry/Grid.h
source/blender/freestyle/intern/scene_graph/NodeGroup.cpp
source/blender/freestyle/intern/stroke/AdvancedFunctions1D.cpp
source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp
source/blender/freestyle/intern/stroke/StrokeRep.cpp
source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp
source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
source/blender/freestyle/intern/view_map/ViewMapIO.cpp

index cbe0742f8433fac176d7ff1e1999e48e329c4142..e09d958d564204e2fc5c96063bb6f2bbb821260f 100644 (file)
@@ -105,10 +105,10 @@ AppView::AppView(const char *iName)
 
 AppView::~AppView()
 {
-       int ref = _RootNode.destroy();
+       /*int ref =*/ /* UNUSED */ _RootNode.destroy();
 
        _Light.destroy();
-       ref = _p2DNode.destroy();
+       /*ref =*/ /* UNUSED */ _p2DNode.destroy();
 }
 
 real AppView::distanceToSceneCenter()
index 11124b60b067a07340770fb46cb620200df251db..e9586e347a24d58508fdb41a4819e23e8fb34245 100644 (file)
@@ -106,7 +106,7 @@ NodeGroup* BlenderFileLoader::Load()
 int BlenderFileLoader::countClippedFaces(float v1[3], float v2[3], float v3[3], int clip[3])
 {
        float *v[3];
-       int numClipped, sum, numTris;
+       int numClipped, sum, numTris = 0;
 
        v[0] = v1;
        v[1] = v2;
@@ -356,7 +356,7 @@ void BlenderFileLoader::insertShapeNode(ObjectInstanceRen *obi, int id)
        // We parse vlak nodes and count the number of faces after the clipping by
        // the near and far view planes is applied (Note: mesh vertices are in the
        // camera coordinate system).
-       VlakRen *vlr;
+       VlakRen *vlr = NULL;
        unsigned numFaces = 0;
        float v1[3], v2[3], v3[3], v4[3];
        float n1[3], n2[3], n3[3], n4[3], facenormal[3];
index f80761c3cc71aca7e449da9538e8d48558d45d7c..ca4cbd35edcb7503af6e3039011f85461d19af53 100644 (file)
@@ -117,6 +117,10 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render* re, int render_count) : Str
        freestyle_scene->r.im_format.imtype = R_IMF_IMTYPE_PNG;
        BKE_scene_disable_color_management(freestyle_scene);
 
+       if (G.debug & G_DEBUG_FREESTYLE) {
+               printf("%s: %d threads\n", __func__, freestyle_scene->r.threads);
+       }
+
        // Render layer
        SceneRenderLayer *srl = (SceneRenderLayer *)freestyle_scene->r.layers.first;
        srl->layflag = SCE_LAY_SOLID | SCE_LAY_ZTRA;
@@ -221,7 +225,7 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
        vector<Strip*>& strips = iStrokeRep->getStrips();
        Strip::vertex_container::iterator v[3];
        StrokeVertexRep *svRep[3];
-       Vec3r color[3];
+       /* Vec3r color[3]; */ /* UNUSED */
        unsigned int vertex_index, edge_index, loop_index;
        Vec2r p;
 
@@ -481,6 +485,8 @@ Object *BlenderStrokeRenderer::NewMesh() const
 #if 0
        BKE_scene_base_deselect_all(scene);
        BKE_scene_base_select(scene, base);
+#else
+       (void)base;
 #endif
        ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME;
 
index d1c82e7a3b478e69e0ddc439b63b2a0f05e00c98..89bb20b4bedf455e62a66a2b1f9705a88a3d72ca 100644 (file)
@@ -25,8 +25,8 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-#ifndef __BLENDERSTROKERENDERER_H__
-#define __BLENDERSTROKERENDERER_H__
+#ifndef __BLENDER_STROKE_RENDERER_H__
+#define __BLENDER_STROKE_RENDERER_H__
 
 /** \file blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
  *  \ingroup freestyle
@@ -73,4 +73,4 @@ protected:
        float get_stroke_vertex_z(void) const;
 };
 
-#endif // __BLENDERSTROKERENDERER_H__
+#endif // __BLENDER_STROKE_RENDERER_H__
index 40bd0911c9c1a46de5f58a2921d64943d1954bf6..8b237673b8afe754777f30f713896a730e71efee 100644 (file)
@@ -37,6 +37,9 @@
 
 #include <cstring> // for memset
 #include <float.h>
+#ifndef _MSC_VER
+#include <stdint.h> // For SET_UINT_IN_POINTER, i.e. uintptr_t.
+#endif
 #include <vector>
 
 #include "Geom.h"
 
 #include "../system/FreestyleConfig.h"
 
+extern "C" {
+       #include "BLI_utildefines.h"
+}
+
 using namespace std;
 using namespace Geometry;
 
@@ -325,8 +332,8 @@ protected:
                                visitor.discoverCell(current_cell);
                                OccludersSet& occluders = current_cell->getOccluders(); // FIXME: I had forgotten the ref &
                                for (OccludersSet::iterator it = occluders.begin(); it != occluders.end(); it++) {
-                                       if ((unsigned long)(*it)->userdata2 != _timestamp) {
-                                               (*it)->userdata2 = (void*)_timestamp;
+                                       if (GET_UINT_FROM_POINTER((*it)->userdata2) != _timestamp) {
+                                               (*it)->userdata2 = SET_UINT_IN_POINTER(_timestamp);
                                                visitor.examineOccluder(*it);
                                        }
                                }
index 5426c60d3e135e5507211504971b6befe9033ec6..3ac9cbbcbdcf2d66cc36df4a814d97c2b2950c3e 100644 (file)
@@ -96,14 +96,14 @@ void NodeGroup::DetachChildren()
 
 void NodeGroup::DetachChild(Node *iChild)
 {
-       int found = 0;
+       /* int found = 0; */ /* UNUSED */
        vector<Node*>::iterator node;
 
        for (node = _Children.begin(); node != _Children.end(); ++node) {
                if ((*node) == iChild) {
                        (*node)->release();
                        _Children.erase(node);
-                       found = 1;
+                       /* found = 1; */ /* UNUSED */
                        break;
                }
        }
index f757f6ced825925541cd4ba546d41bf372218f1f..2df4d19195ee3a94bcf4f87b3c94d77f1f736dc0 100644 (file)
@@ -124,7 +124,7 @@ int GetDirectionalViewMapDensityF1D::operator()(Interface1D& inter)
 int GetCompleteViewMapDensityF1D::operator()(Interface1D& inter)
 {
        //soc unsigned size;
-       Id id = inter.getId();
+       /* Id id = inter.getId(); */ /* UNUSED */
        result = integrate(_fun, inter.pointsBegin(_sampling), inter.pointsEnd(_sampling), _integration);
        return 0;
 }
index 245f4cfb3de945028cb78e258d3b9579661c6d26..fd070a5969926a3ffb4d540e9c1452329ab5efbf 100644 (file)
@@ -226,10 +226,10 @@ ThicknessVariationPatternShader::ThicknessVariationPatternShader(const string pa
 int ThicknessVariationPatternShader::shade(Stroke& stroke) const
 {
        StrokeInternal::StrokeVertexIterator v, vend;
-       float *array = 0;
-       int size;
+       float *array = NULL;
+       /* int size; */ /* UNUSED */
        array = _aThickness;
-       size = _size;
+       /* size = _size; */ /* UNUSED */
        int vert_size = stroke.strokeVerticesSize();
        int sig = 0;
        unsigned index;
index e69b4dab7126d4aa757193502d8dcf004ca53514..bc117925a4cd5cd3b338e401aca30e43a3922ed1 100644 (file)
@@ -292,10 +292,10 @@ void Strip::createStrip (const vector<StrokeVertex*>& iStrokeVertices)
        _vertices.push_back(new StrokeVertexRep(sv->getPoint() + thicknessLast[1] * stripDirLast));
        ++i;
        _vertices.push_back(new StrokeVertexRep(sv->getPoint() - thicknessLast[0] * stripDirLast));
-       int n = i;
        ++i;
 
 #if 0
+       int n = i - 1;
        // check whether the orientation of the extremity was user defined
        userDir = _stroke->getEndingOrientation();
        if (userDir != Vec2r(0, 0)) {
index f3ab3c6d94aa5a09388cbcb018f8151bdc437e35..56c32d8e134cdd24110057084e423c0296c5495a 100644 (file)
@@ -67,7 +67,7 @@ void ViewEdgeXBuilder::BuildViewEdges(WXShape *iWShape, ViewShape *oVShape, vect
        // Reinit structures
        Init(oVShape);
 
-       ViewEdge *vedge;
+       /* ViewEdge *vedge; */ /* UNUSED */
        // Let us build the smooth stuff
        //----------------------------------------
        // We parse all faces to find the ones that contain smooth edges
@@ -87,7 +87,7 @@ void ViewEdgeXBuilder::BuildViewEdges(WXShape *iWShape, ViewShape *oVShape, vect
                                continue;
                        // here we know that we're dealing with a face layer that has not been processed yet and that contains
                        // a smooth edge.
-                       vedge = BuildSmoothViewEdge(OWXFaceLayer(*sl, true));
+                       /* vedge =*/ /* UNUSED */ BuildSmoothViewEdge(OWXFaceLayer(*sl, true));
                }
        }
 
@@ -225,7 +225,7 @@ ViewEdge *ViewEdgeXBuilder::BuildSharpViewEdge(const OWXEdge& iWEdge)
 
        // Find first edge:
        OWXEdge firstWEdge = iWEdge;
-       OWXEdge previousWEdge = firstWEdge;
+       /* OWXEdge previousWEdge = firstWEdge; */ /* UNUSED */
        OWXEdge currentWEdge = firstWEdge;
        list<OWXEdge> edgesChain;
 #if 0 /* TK 02-Sep-2012 Experimental fix for incorrect view edge visibility. */
index fc7da724e8f2fa91c837f8c7395a09baf859149a..ea959bfd81dcea18c0f9eac9d4218925f7a224ad 100644 (file)
@@ -573,6 +573,8 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, G& grid, real epsilo
                        if (_global.debug & G_DEBUG_FREESTYLE) {
                                cout << "\tConclusion: QI = " << maxIndex << ", " << (*ve)->occluders_size() << " occluders." << endl;
                        }
+               #else
+                       (void)maxIndex;
                #endif
                // occludee --
                if (!wFaces.empty()) {
index 978272848eca27d43d53966b21fb6804454790a8..0e0e02dcaee109da98ac55b6c648cd2b2905ae46 100644 (file)
@@ -1101,17 +1101,17 @@ int save(ostream& out, ViewMap *vm, ProgressBar *pb)
 
        // For every object, initialize its userdata member to its index in the ViewMap list
        for (unsigned int i0 = 0; i0 < vm->ViewShapes().size(); i0++) {
-               vm->ViewShapes()[i0]->userdata = (void *)i0;
-               vm->ViewShapes()[i0]->sshape()->userdata = (void *)i0;
+               vm->ViewShapes()[i0]->userdata = SET_UINT_IN_POINTER(i0);
+               vm->ViewShapes()[i0]->sshape()->userdata = SET_UINT_IN_POINTER(i0);
        }
        for (unsigned int i1 = 0; i1 < vm->FEdges().size(); i1++)
-               vm->FEdges()[i1]->userdata = (void *)i1;
+               vm->FEdges()[i1]->userdata = SET_UINT_IN_POINTER(i1);
        for (unsigned int i2 = 0; i2 < vm->SVertices().size(); i2++)
-               vm->SVertices()[i2]->userdata = (void *)i2;
+               vm->SVertices()[i2]->userdata = SET_UINT_IN_POINTER(i2);
        for (unsigned int i3 = 0; i3 < vm->ViewEdges().size(); i3++)
-               vm->ViewEdges()[i3]->userdata = (void *)i3;
+               vm->ViewEdges()[i3]->userdata = SET_UINT_IN_POINTER(i3);
        for (unsigned int i4 = 0; i4 < vm->ViewVertices().size(); i4++)
-               vm->ViewVertices()[i4]->userdata = (void *)i4;
+               vm->ViewVertices()[i4]->userdata = SET_UINT_IN_POINTER(i4);
 
        // Write the current options
        unsigned char flags = Options::getFlags();