- The number of gcc-4.0 warnings has significantly decreases.
authoralpar
Thu, 18 Aug 2005 13:33:49 +0000
changeset 16439285f3777553
parent 1642 a2dda876316f
child 1644 62548b317e65
- The number of gcc-4.0 warnings has significantly decreases.
- Some code clean-up in gui
gui/all_include.h
gui/graph_displayer_canvas-edge.cc
gui/graph_displayer_canvas-event.cc
gui/graph_displayer_canvas-node.cc
gui/graph_displayer_canvas.h
gui/map_win.cc
gui/mapstorage.cc
lemon/concept/graph.h
lemon/concept/path.h
lemon/concept/undir_graph.h
lemon/full_graph.h
     1.1 --- a/gui/all_include.h	Thu Aug 18 12:22:44 2005 +0000
     1.2 +++ b/gui/all_include.h	Thu Aug 18 13:33:49 2005 +0000
     1.3 @@ -40,6 +40,7 @@
     1.4  typedef ListGraph Graph;
     1.5  typedef Graph::NodeMap<Coordinates> CoordinatesMap;
     1.6  typedef Graph::Node Node;
     1.7 +typedef Graph::Edge Edge;
     1.8  typedef Graph::EdgeIt EdgeIt;
     1.9  typedef Graph::NodeIt NodeIt;
    1.10  
     2.1 --- a/gui/graph_displayer_canvas-edge.cc	Thu Aug 18 12:22:44 2005 +0000
     2.2 +++ b/gui/graph_displayer_canvas-edge.cc	Thu Aug 18 13:33:49 2005 +0000
     2.3 @@ -3,7 +3,7 @@
     2.4  #include <cmath>
     2.5  
     2.6  
     2.7 -int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Graph::Edge edge)
     2.8 +int GraphDisplayerCanvas::changeEdgeWidth (std::string mapname, Edge edge)
     2.9  {
    2.10    Graph::EdgeMap<double> * actual_map;
    2.11    double min, max;
    2.12 @@ -49,7 +49,7 @@
    2.13    return 0;
    2.14  };
    2.15  
    2.16 -int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Graph::Edge edge)
    2.17 +int GraphDisplayerCanvas::changeEdgeColor (std::string mapname, Edge edge)
    2.18  {  
    2.19  
    2.20    //function maps the range of the maximum and
    2.21 @@ -116,7 +116,7 @@
    2.22    return 0;
    2.23  };
    2.24  
    2.25 -int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Graph::Edge edge)
    2.26 +int GraphDisplayerCanvas::changeEdgeText (std::string mapname, Edge edge)
    2.27  {
    2.28    //the number in the map will be written on the edge
    2.29    //EXCEPT when the name of the map is Default, because
     3.1 --- a/gui/graph_displayer_canvas-event.cc	Thu Aug 18 12:22:44 2005 +0000
     3.2 +++ b/gui/graph_displayer_canvas-event.cc	Thu Aug 18 13:33:49 2005 +0000
     3.3 @@ -225,7 +225,7 @@
     3.4  
     3.5        isbutton=1;
     3.6  
     3.7 -      active_node=NodeIt(mapstorage.graph,mapstorage.graph.addNode());
     3.8 +      active_node=mapstorage.graph.addNode();
     3.9  
    3.10        //initiating values corresponding to new node in maps
    3.11  
    3.12 @@ -339,7 +339,7 @@
    3.13  	    {
    3.14  	      window_to_world (e->button.x, e->button.y, clicked_x, clicked_y);
    3.15  	      target_item=(get_item_at(clicked_x, clicked_y));
    3.16 -	      Graph::NodeIt target_node=INVALID;
    3.17 +	      Node target_node=INVALID;
    3.18  	      for (NodeIt i(mapstorage.graph); i!=INVALID; ++i)
    3.19  		{
    3.20  		  if(nodesmap[i]==target_item)
    3.21 @@ -354,14 +354,17 @@
    3.22  		    {
    3.23            mapstorage.modified = true;
    3.24  
    3.25 -		      *(nodesmap[target_node]) << Gnome::Canvas::Properties::fill_color("red");
    3.26 +		      *(nodesmap[target_node]) <<
    3.27 +			Gnome::Canvas::Properties::fill_color("red");
    3.28  
    3.29  		      //creating new edge
    3.30 -		      active_edge=EdgeIt(mapstorage.graph,mapstorage.graph.addEdge(active_node, target_node));
    3.31 +		      active_edge=mapstorage.graph.addEdge(active_node,
    3.32 +							   target_node);
    3.33  
    3.34  		      //initiating values corresponding to new edge in maps
    3.35  		      mapstorage.initMapsForEdge(active_edge);
    3.36 -                      (*mapstorage.edgemap_storage["id"])[active_edge] = mapstorage.graph.id(active_edge);
    3.37 +                      (*mapstorage.edgemap_storage["id"])[active_edge] = 
    3.38 +			mapstorage.graph.id(active_edge);
    3.39  	  
    3.40  		      //calculating coordinates of new edge
    3.41  		      Gnome::Canvas::Points coos;
    3.42 @@ -555,7 +558,7 @@
    3.43  	  //If the click happened on an edge we place the entrywidget there and fill in the value of the activated map at that edge.
    3.44  	  {
    3.45  	    //for determine, whether it was an edge
    3.46 -	    Graph::EdgeIt clicked_edge=INVALID;
    3.47 +	    Edge clicked_edge=INVALID;
    3.48  
    3.49  	    //find the activated item between texts
    3.50  	    active_item=(get_item_at(e->button.x, e->button.y));
    3.51 @@ -677,7 +680,7 @@
    3.52  	  //If the click happened on an edge we place the entrywidget there and fill in the value of the activated map at that edge.
    3.53  	  {
    3.54  	    //for determine, whether it was a node
    3.55 -	    Graph::NodeIt clicked_node=INVALID;
    3.56 +	    Node clicked_node=INVALID;
    3.57  
    3.58  	    //find the activated item between texts
    3.59  	    active_item=(get_item_at(e->button.x, e->button.y));
    3.60 @@ -849,21 +852,14 @@
    3.61    return false;
    3.62  }
    3.63  
    3.64 -void GraphDisplayerCanvas::deleteItem(NodeIt node_to_delete)
    3.65 +void GraphDisplayerCanvas::deleteItem(Node node_to_delete)
    3.66  {
    3.67    delete(nodetextmap[node_to_delete]);
    3.68    delete(nodesmap[node_to_delete]);
    3.69    mapstorage.graph.erase(node_to_delete);
    3.70  }
    3.71  
    3.72 -void GraphDisplayerCanvas::deleteItem(EdgeIt edge_to_delete)
    3.73 -{
    3.74 -  delete(edgetextmap[edge_to_delete]);
    3.75 -  delete(edgesmap[edge_to_delete]);
    3.76 -  mapstorage.graph.erase(edge_to_delete);
    3.77 -}
    3.78 -
    3.79 -void GraphDisplayerCanvas::deleteItem(Graph::Edge edge_to_delete)
    3.80 +void GraphDisplayerCanvas::deleteItem(Edge edge_to_delete)
    3.81  {
    3.82    delete(edgetextmap[edge_to_delete]);
    3.83    delete(edgesmap[edge_to_delete]);
     4.1 --- a/gui/graph_displayer_canvas-node.cc	Thu Aug 18 12:22:44 2005 +0000
     4.2 +++ b/gui/graph_displayer_canvas-node.cc	Thu Aug 18 13:33:49 2005 +0000
     4.3 @@ -3,7 +3,7 @@
     4.4  #include <cmath>
     4.5  
     4.6  
     4.7 -int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Graph::Node node)
     4.8 +int GraphDisplayerCanvas::changeNodeRadius (std::string mapname, Node node)
     4.9  {
    4.10    Graph::NodeMap<double> * actual_map;
    4.11    double min, max;
    4.12 @@ -69,7 +69,7 @@
    4.13    return 0;
    4.14  };
    4.15  
    4.16 -int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Graph::Node node)
    4.17 +int GraphDisplayerCanvas::changeNodeColor (std::string mapname, Node node)
    4.18  {  
    4.19  
    4.20    //function maps the range of the maximum and
    4.21 @@ -141,7 +141,7 @@
    4.22    return 0;
    4.23  };
    4.24  
    4.25 -int GraphDisplayerCanvas::changeNodeText (std::string mapname, Graph::Node node)
    4.26 +int GraphDisplayerCanvas::changeNodeText (std::string mapname, Node node)
    4.27  {
    4.28  
    4.29    //the number in the map will be written on the node
     5.1 --- a/gui/graph_displayer_canvas.h	Thu Aug 18 12:22:44 2005 +0000
     5.2 +++ b/gui/graph_displayer_canvas.h	Thu Aug 18 13:33:49 2005 +0000
     5.3 @@ -23,27 +23,27 @@
     5.4  
     5.5    ///Changes the linewidth attribute according to the given map.
     5.6    ///\param mapname is the name of the map which contains the new values
     5.7 -  int changeEdgeWidth (std::string mapname, Graph::Edge new_item=INVALID);
     5.8 +  int changeEdgeWidth (std::string mapname, Edge new_item=INVALID);
     5.9  
    5.10    ///Changes the linecolor attribute according to the given map.
    5.11    ///\param mapname is the name of the map which contains the new values
    5.12 -  int changeEdgeColor (std::string mapname, Graph::Edge new_item=INVALID);
    5.13 +  int changeEdgeColor (std::string mapname, Edge new_item=INVALID);
    5.14  
    5.15    ///Changes the text of line attribute according to the given map.
    5.16    ///\param mapname is the name of the map which contains the new values
    5.17 -  int changeEdgeText (std::string mapname, Graph::Edge new_item=INVALID);
    5.18 +  int changeEdgeText (std::string mapname, Edge new_item=INVALID);
    5.19  
    5.20    ///Changes the linewidth attribute according to the given map.
    5.21    ///\param mapname is the name of the map which contains the new values
    5.22 -  int changeNodeRadius (std::string mapname, Graph::Node new_item=INVALID);
    5.23 +  int changeNodeRadius (std::string mapname, Node new_item=INVALID);
    5.24  
    5.25    ///Changes the linecolor attribute according to the given map.
    5.26    ///\param mapname is the name of the map which contains the new values
    5.27 -  int changeNodeColor (std::string mapname, Graph::Node new_item=INVALID);
    5.28 +  int changeNodeColor (std::string mapname, Node new_item=INVALID);
    5.29  
    5.30    ///Changes the text of line attribute according to the given map.
    5.31    ///\param mapname is the name of the map which contains the new values
    5.32 -  int changeNodeText (std::string mapname, Graph::Node new_item=INVALID);
    5.33 +  int changeNodeText (std::string mapname, Node new_item=INVALID);
    5.34  
    5.35    ///Callback for 'ViewZoomIn' action.
    5.36    virtual void zoomIn();
    5.37 @@ -119,11 +119,9 @@
    5.38  
    5.39  private:
    5.40    ///Deletes the given element.
    5.41 -  void deleteItem(NodeIt);
    5.42 +  void deleteItem(Node);
    5.43    ///Deletes the given element.
    5.44 -  void deleteItem(EdgeIt);
    5.45 -  ///Deletes the given element.
    5.46 -  void deleteItem(Graph::Edge);
    5.47 +  void deleteItem(Edge);
    5.48  
    5.49  private:
    5.50  
    5.51 @@ -166,9 +164,9 @@
    5.52    ///1. we cannot query the item at he cursor as fast as it could not cause a Segmentation Fault
    5.53    ///2. we would like to handle only ony item per movement, therefore quering it is not a working solution
    5.54    Gnome::Canvas::Item * active_item, * target_item;
    5.55 -  Graph::NodeIt active_node;
    5.56 -  Graph::EdgeIt active_edge;
    5.57 -  Graph::EdgeIt forming_edge;
    5.58 +  Node active_node;
    5.59 +  Edge active_edge;
    5.60 +  Edge forming_edge;
    5.61  
    5.62    std::string nodemap_to_edit, edgemap_to_edit;
    5.63  
     6.1 --- a/gui/map_win.cc	Thu Aug 18 12:22:44 2005 +0000
     6.2 +++ b/gui/map_win.cc	Thu Aug 18 13:33:49 2005 +0000
     6.3 @@ -217,7 +217,7 @@
     6.4    }
     6.5  };
     6.6  
     6.7 -void MapWin::updateNode(Graph::Node node)
     6.8 +void MapWin::updateNode(Node node)
     6.9  {
    6.10    for(int i=0;i<NODE_PROPERTY_NUM;i++)
    6.11      {
    6.12 @@ -250,7 +250,7 @@
    6.13      }
    6.14  }
    6.15  
    6.16 -void MapWin::updateEdge(Graph::Edge edge)
    6.17 +void MapWin::updateEdge(Edge edge)
    6.18  {
    6.19    for(int i=0;i<EDGE_PROPERTY_NUM;i++)
    6.20      {
     7.1 --- a/gui/mapstorage.cc	Thu Aug 18 12:22:44 2005 +0000
     7.2 +++ b/gui/mapstorage.cc	Thu Aug 18 13:33:49 2005 +0000
     7.3 @@ -116,7 +116,7 @@
     7.4    return min;
     7.5  }
     7.6  
     7.7 -void MapStorage::initMapsForEdge(Graph::Edge e)
     7.8 +void MapStorage::initMapsForEdge(Edge e)
     7.9  {
    7.10    std::map< std::string,Graph::EdgeMap<double> * >::iterator ems_it;
    7.11    for(ems_it=edgemap_storage.begin();ems_it!=edgemap_storage.end();ems_it++)
     8.1 --- a/lemon/concept/graph.h	Thu Aug 18 12:22:44 2005 +0000
     8.2 +++ b/lemon/concept/graph.h	Thu Aug 18 13:33:49 2005 +0000
     8.3 @@ -404,7 +404,7 @@
     8.4      
     8.5          /// This constructor sets the iterator to the first edge of \c g.
     8.6          ///@param g the graph
     8.7 -        EdgeIt(const StaticGraph& g) { }
     8.8 +        EdgeIt(const StaticGraph& g) { ignore_unused_variable_warning(g); }
     8.9          /// Edge -> EdgeIt conversion
    8.10  
    8.11          /// Sets the iterator to the value of the trivial iterator \c e.
     9.1 --- a/lemon/concept/path.h	Thu Aug 18 12:22:44 2005 +0000
     9.2 +++ b/lemon/concept/path.h	Thu Aug 18 13:33:49 2005 +0000
     9.3 @@ -24,6 +24,7 @@
     9.4  #define LEMON_CONCEPT_PATH_H
     9.5  
     9.6  #include <lemon/invalid.h>
     9.7 +#include <lemon/concept_check.h>
     9.8  
     9.9  namespace lemon {
    9.10    namespace concept {
    9.11 @@ -54,7 +55,9 @@
    9.12  
    9.13        /// \param _g The graph in which the path is.
    9.14        ///
    9.15 -      Path(const Graph &_g) {}
    9.16 +      Path(const Graph &_g) {
    9.17 +	ignore_unused_variable_warning(_g);
    9.18 +      }
    9.19  
    9.20        /// Length of the path.
    9.21        int length() const {return 0;}
    10.1 --- a/lemon/concept/undir_graph.h	Thu Aug 18 12:22:44 2005 +0000
    10.2 +++ b/lemon/concept/undir_graph.h	Thu Aug 18 13:33:49 2005 +0000
    10.3 @@ -557,7 +557,7 @@
    10.4      
    10.5          /// This constructor sets the iterator to the first edge of \c g.
    10.6          ///@param g the graph
    10.7 -        EdgeIt(const UndirGraph &g) { }
    10.8 +        EdgeIt(const UndirGraph &g) { ignore_unused_variable_warning(g); }
    10.9          /// Edge -> EdgeIt conversion
   10.10  
   10.11          /// Sets the iterator to the value of the trivial iterator \c e.
   10.12 @@ -605,7 +605,10 @@
   10.13          /// the node.
   10.14          ///@param n the node
   10.15          ///@param g the graph
   10.16 -        OutEdgeIt(const UndirGraph& n, const Node& g) { }
   10.17 +        OutEdgeIt(const UndirGraph& n, const Node& g) {
   10.18 +	  ignore_unused_variable_warning(n);
   10.19 +	  ignore_unused_variable_warning(g);
   10.20 +	}
   10.21          /// Edge -> OutEdgeIt conversion
   10.22  
   10.23          /// Sets the iterator to the value of the trivial iterator.
   10.24 @@ -654,7 +657,10 @@
   10.25          /// the node.
   10.26          ///@param n the node
   10.27          ///@param g the graph
   10.28 -        InEdgeIt(const UndirGraph& g, const Node& n) { }
   10.29 +        InEdgeIt(const UndirGraph& g, const Node& n) { 
   10.30 +	  ignore_unused_variable_warning(n);
   10.31 +	  ignore_unused_variable_warning(g);
   10.32 +	}
   10.33          /// Edge -> InEdgeIt conversion
   10.34  
   10.35          /// Sets the iterator to the value of the trivial iterator \c e.
    11.1 --- a/lemon/full_graph.h	Thu Aug 18 12:22:44 2005 +0000
    11.2 +++ b/lemon/full_graph.h	Thu Aug 18 13:33:49 2005 +0000
    11.3 @@ -125,10 +125,10 @@
    11.4  
    11.5      protected:
    11.6        int id;
    11.7 -      Node(int _id) { id = _id;}
    11.8 +      Node(int _id) : id(_id) {}
    11.9      public:
   11.10        Node() {}
   11.11 -      Node (Invalid) { id = -1; }
   11.12 +      Node (Invalid) : id(-1) {}
   11.13        bool operator==(const Node node) const {return id == node.id;}
   11.14        bool operator!=(const Node node) const {return id != node.id;}
   11.15        bool operator<(const Node node) const {return id < node.id;}
   11.16 @@ -260,12 +260,12 @@
   11.17  
   11.18      Node source(Edge e) const { 
   11.19        /// \todo we may do it faster
   11.20 -      return ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2; 
   11.21 +      return Node(((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2);
   11.22      }
   11.23  
   11.24      Node target(Edge e) const { 
   11.25        int source = ((int)sqrt((double)(1 + 8 * e.id)) + 1) / 2;;
   11.26 -      return e.id - (source) * (source - 1) / 2; 
   11.27 +      return Node(e.id - (source) * (source - 1) / 2);
   11.28      }
   11.29  
   11.30