Commit f43efe0c authored by sebastien's avatar sebastien
Browse files

v4 preprocessor mex: various minor fixed to ensure correct compilation under g++ 4.3


git-svn-id: https://www.dynare.org/svn/dynare/dynare_v4@1906 ac1d8469-bf42-47a9-8791-bf33cf982152
parent bfac26ce
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <iostream>
#include <sstream>
......
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <iostream>
#include "DataTree.hh"
......
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
......
......@@ -71,18 +71,20 @@ Blocks::block_depth_search(int v)
{
// Update low_link no. */
if(visit_nos[w] < low_link_nos[v])
if(visit_nos[w]>=0)
low_link_nos[v] = visit_nos[w];
else
{
// Check for hierarchic structure accross strong connex components
if(pos_sc[-(visit_nos[w]+2)]<pos_sc[n_sets])
{
int j=pos_sc[-(visit_nos[w]+2)];
pos_sc[-(visit_nos[w]+2)]=pos_sc[n_sets];
pos_sc[n_sets]=j;
}
}
{
if(visit_nos[w]>=0)
low_link_nos[v] = visit_nos[w];
else
{
// Check for hierarchic structure accross strong connex components
if(pos_sc[-(visit_nos[w]+2)]<pos_sc[n_sets])
{
int j=pos_sc[-(visit_nos[w]+2)];
pos_sc[-(visit_nos[w]+2)]=pos_sc[n_sets];
pos_sc[n_sets]=j;
}
}
}
}
edge_ptr = edge_ptr->next;
}
......
......@@ -17,10 +17,11 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <cstring>
#include <cmath>
#include "ModelTree.hh"
......@@ -1146,13 +1147,13 @@ ModelTree::writeModelStaticEquationsOrdered_M(ostream &output, Model_Block *Mode
void
ModelTree::writeModelEquationsCodeOrdered(const string file_name, const Model_Block *ModelBlock, const string bin_basename, ExprNodeOutputType output_type) const
{
typedef struct Uff_l
struct Uff_l
{
int u, var, lag;
Uff_l *pNext;
};
typedef struct Uff
struct Uff
{
Uff_l *Ufl, *Ufl_First;
int eqr;
......
......@@ -19,6 +19,7 @@
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <ctime>
......
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <iostream>
#include "NumericalConstants.hh"
......
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <fstream>
#include <iostream>
......
......@@ -32,10 +32,12 @@ void
SymbolTable::addSymbol(const string &name, Type type, const string &tex_name) throw (AlreadyDeclaredException)
{
if (exists(name))
if (symbol_table[name].first == type)
throw AlreadyDeclaredException(name, true);
else
throw AlreadyDeclaredException(name, false);
{
if (symbol_table[name].first == type)
throw AlreadyDeclaredException(name, true);
else
throw AlreadyDeclaredException(name, false);
}
int id;
......
......@@ -33,7 +33,7 @@
#include "ExprNode.hh"
typedef struct List_IM
struct List_IM
{
List_IM* pNext;
int lead_lag;
......
......@@ -36,7 +36,7 @@ class DataTree;
typedef class ExprNode *NodeID;
typedef struct Model_Block;
struct Model_Block;
struct ExprNodeLess;
......@@ -311,13 +311,13 @@ public:
virtual void compile(ofstream &CompileCode, bool lhs_rhs, ExprNodeOutputType output_type, const temporary_terms_type &temporary_terms, map_idx_type map_idx) const;
};
typedef struct IM_compact
struct IM_compact
{
int size, u_init, u_finish, nb_endo;
int *u, *us, *Var, *Equ, *Var_Index, *Equ_Index, *Var_dyn_Index;
};
typedef struct Block
struct Block
{
int Size, Sized, Type, Simulation_Type, Max_Lead, Max_Lag, Nb_Lead_Lag_Endo;
bool is_linear;
......@@ -329,7 +329,7 @@ typedef struct Block
int Code_Start, Code_Length;
};
typedef struct Model_Block
struct Model_Block
{
int Size, Periods;
Block* Block_List;
......
......@@ -23,27 +23,27 @@
#include "CodeInterpreter.hh"
typedef struct Edge
struct Edge
{
Edge *next;
int Vertex_Index;
};
typedef struct Equation_vertex
struct Equation_vertex
{
Edge *First_Edge;
Edge *Next_Edge;
int matched;
};
typedef struct Equation_set
struct Equation_set
{
Equation_vertex *Number;
int size;
int edges;
};
typedef struct simple
struct simple
{
int index, block;
bool available;
......@@ -52,16 +52,16 @@ typedef struct simple
class Normalization
{
private:
typedef struct Variable_vertex
struct Variable_vertex
{
int matched;
};
typedef struct Variable_set
struct Variable_set
{
Variable_vertex *Number;
int size;
};
typedef struct t_Heap
struct t_Heap
{
int u; /* vertex */
int i_parent; /* index in t_Heap of parent vertex in tree of u */
......
......@@ -31,12 +31,12 @@
#include "ModelTree.hh"
#include "BlockTriangular.hh"
typedef struct t_edge
struct t_edge
{
int index, u_count;
};
typedef struct t_vertex
struct t_vertex
{
t_edge *out_degree_edge, *in_degree_edge;
int nb_out_degree_edges, nb_in_degree_edges;
......@@ -44,7 +44,7 @@ typedef struct t_vertex
int index, lag_lead;
};
typedef struct t_model_graph
struct t_model_graph
{
int nb_vertices;
t_vertex* vertex;
......
......@@ -27,13 +27,13 @@
using namespace std;
#define TOL 1e-9
typedef struct t_table_y
struct t_table_y
{
int index,nb;
int *u_index, *y_index;
};
typedef struct t_table_u
struct t_table_u
{
t_table_u* pNext;
unsigned char type;
......
......@@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstdlib>
#include <iostream>
#include <fstream>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment