Commit 5ef42585 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 d86885ea
......@@ -17,6 +17,8 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstring>
#include "Interpreter.hh"
Interpreter::Interpreter(double *params_arg, double *y_arg, double *ya_arg, double *x_arg, double *direction_arg, int y_size_arg,
......
......@@ -36,12 +36,12 @@
using namespace std;
typedef struct Block_contain_type
struct Block_contain_type
{
int Equation, Variable, Own_Derivative;
};
typedef struct Block_type
struct Block_type
{
long int begin, end, size, type;
};
......
......@@ -25,7 +25,7 @@
#include "mex.h"
using namespace std;
typedef struct NonZeroElem
struct NonZeroElem
{
int u_index;
int r_index, c_index, lag_index;
......
......@@ -17,6 +17,8 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstring>
#include "SparseMatrix.hh"
SparseMatrix::SparseMatrix()
......
......@@ -33,7 +33,7 @@
using namespace std;
typedef struct t_save_op_s
struct t_save_op_s
{
short int lag, operat;
int first, second;
......@@ -51,13 +51,13 @@ const double eps=1e-7;
const double very_big=1e24;
const int alt_symbolic_count_max=1;
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,8 @@
* along with Dynare. If not, see <http://www.gnu.org/licenses/>.
*/
#include <cstring>
#include "linbcg.hh"
//#define DEBUG
......
......@@ -23,6 +23,8 @@
// use NO_COMPILER option in MODEL command //
////////////////////////////////////////////////////////////////////////
#include <cstring>
#include "simulate.hh"
#include "Interpreter.hh"
#include "Mem_Mngr.hh"
......
......@@ -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;
......
Markdown is supported
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