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/>.
*/
#include <cstdlib>
#include <iostream>
#include <sstream>

View File

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

View File

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

View File

@ -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;
}

View File

@ -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;

View File

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

View File

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

View File

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

View File

@ -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;

View File

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

View File

@ -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;

View File

@ -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 */

View File

@ -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;

View File

@ -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;

View File

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