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
issue#70
sebastien 2008-06-28 11:20:45 +00:00
parent bfac26ce73
commit f43efe0c12
15 changed files with 48 additions and 36 deletions

View File

@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>

View File

@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <iostream> #include <iostream>
#include "DataTree.hh" #include "DataTree.hh"

View File

@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>

View File

@ -71,18 +71,20 @@ Blocks::block_depth_search(int v)
{ {
// Update low_link no. */ // Update low_link no. */
if(visit_nos[w] < low_link_nos[v]) if(visit_nos[w] < low_link_nos[v])
if(visit_nos[w]>=0) {
low_link_nos[v] = visit_nos[w]; if(visit_nos[w]>=0)
else 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]) // 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]; int j=pos_sc[-(visit_nos[w]+2)];
pos_sc[n_sets]=j; pos_sc[-(visit_nos[w]+2)]=pos_sc[n_sets];
} pos_sc[n_sets]=j;
} }
}
}
} }
edge_ptr = edge_ptr->next; edge_ptr = edge_ptr->next;
} }

View File

@ -17,10 +17,11 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include <cstring>
#include <cmath> #include <cmath>
#include "ModelTree.hh" #include "ModelTree.hh"
@ -1146,13 +1147,13 @@ ModelTree::writeModelStaticEquationsOrdered_M(ostream &output, Model_Block *Mode
void void
ModelTree::writeModelEquationsCodeOrdered(const string file_name, const Model_Block *ModelBlock, const string bin_basename, ExprNodeOutputType output_type) const 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; int u, var, lag;
Uff_l *pNext; Uff_l *pNext;
}; };
typedef struct Uff struct Uff
{ {
Uff_l *Ufl, *Ufl_First; Uff_l *Ufl, *Ufl_First;
int eqr; int eqr;

View File

@ -19,6 +19,7 @@
#include <cstdlib> #include <cstdlib>
#include <cstdio> #include <cstdio>
#include <cstring>
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <ctime> #include <ctime>

View File

@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <iostream> #include <iostream>
#include "NumericalConstants.hh" #include "NumericalConstants.hh"

View File

@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>

View File

@ -32,10 +32,12 @@ void
SymbolTable::addSymbol(const string &name, Type type, const string &tex_name) throw (AlreadyDeclaredException) SymbolTable::addSymbol(const string &name, Type type, const string &tex_name) throw (AlreadyDeclaredException)
{ {
if (exists(name)) if (exists(name))
if (symbol_table[name].first == type) {
throw AlreadyDeclaredException(name, true); if (symbol_table[name].first == type)
else throw AlreadyDeclaredException(name, true);
throw AlreadyDeclaredException(name, false); else
throw AlreadyDeclaredException(name, false);
}
int id; int id;

View File

@ -33,7 +33,7 @@
#include "ExprNode.hh" #include "ExprNode.hh"
typedef struct List_IM struct List_IM
{ {
List_IM* pNext; List_IM* pNext;
int lead_lag; int lead_lag;

View File

@ -36,7 +36,7 @@ class DataTree;
typedef class ExprNode *NodeID; typedef class ExprNode *NodeID;
typedef struct Model_Block; struct Model_Block;
struct ExprNodeLess; 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; 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 size, u_init, u_finish, nb_endo;
int *u, *us, *Var, *Equ, *Var_Index, *Equ_Index, *Var_dyn_Index; 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; int Size, Sized, Type, Simulation_Type, Max_Lead, Max_Lag, Nb_Lead_Lag_Endo;
bool is_linear; bool is_linear;
@ -329,7 +329,7 @@ typedef struct Block
int Code_Start, Code_Length; int Code_Start, Code_Length;
}; };
typedef struct Model_Block struct Model_Block
{ {
int Size, Periods; int Size, Periods;
Block* Block_List; Block* Block_List;

View File

@ -23,27 +23,27 @@
#include "CodeInterpreter.hh" #include "CodeInterpreter.hh"
typedef struct Edge struct Edge
{ {
Edge *next; Edge *next;
int Vertex_Index; int Vertex_Index;
}; };
typedef struct Equation_vertex struct Equation_vertex
{ {
Edge *First_Edge; Edge *First_Edge;
Edge *Next_Edge; Edge *Next_Edge;
int matched; int matched;
}; };
typedef struct Equation_set struct Equation_set
{ {
Equation_vertex *Number; Equation_vertex *Number;
int size; int size;
int edges; int edges;
}; };
typedef struct simple struct simple
{ {
int index, block; int index, block;
bool available; bool available;
@ -52,16 +52,16 @@ typedef struct simple
class Normalization class Normalization
{ {
private: private:
typedef struct Variable_vertex struct Variable_vertex
{ {
int matched; int matched;
}; };
typedef struct Variable_set struct Variable_set
{ {
Variable_vertex *Number; Variable_vertex *Number;
int size; int size;
}; };
typedef struct t_Heap struct t_Heap
{ {
int u; /* vertex */ int u; /* vertex */
int i_parent; /* index in t_Heap of parent vertex in tree of u */ int i_parent; /* index in t_Heap of parent vertex in tree of u */

View File

@ -31,12 +31,12 @@
#include "ModelTree.hh" #include "ModelTree.hh"
#include "BlockTriangular.hh" #include "BlockTriangular.hh"
typedef struct t_edge struct t_edge
{ {
int index, u_count; int index, u_count;
}; };
typedef struct t_vertex struct t_vertex
{ {
t_edge *out_degree_edge, *in_degree_edge; t_edge *out_degree_edge, *in_degree_edge;
int nb_out_degree_edges, nb_in_degree_edges; int nb_out_degree_edges, nb_in_degree_edges;
@ -44,7 +44,7 @@ typedef struct t_vertex
int index, lag_lead; int index, lag_lead;
}; };
typedef struct t_model_graph struct t_model_graph
{ {
int nb_vertices; int nb_vertices;
t_vertex* vertex; t_vertex* vertex;

View File

@ -27,13 +27,13 @@
using namespace std; using namespace std;
#define TOL 1e-9 #define TOL 1e-9
typedef struct t_table_y struct t_table_y
{ {
int index,nb; int index,nb;
int *u_index, *y_index; int *u_index, *y_index;
}; };
typedef struct t_table_u struct t_table_u
{ {
t_table_u* pNext; t_table_u* pNext;
unsigned char type; unsigned char type;

View File

@ -17,6 +17,7 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>. * along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <cstdlib>
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>