Index: sources/README
===================================================================
--- sources/README	(revision 58)
+++ sources/README	(revision 59)
@@ -1,4 +1,7 @@
 SystemCASS Installation
 =======================
+
+Commande pour compiler : se placer dans le rÃ©pertoire voulu (ici sandbox_test/objdir), puis :
+$ ../../configure --prefix=$(pwd) --enable-debug
 
 Please use automake/autoconf to install SystemCASS.
Index: sources/src/alias.cc
===================================================================
--- sources/src/alias.cc	(revision 58)
+++ sources/src/alias.cc	(revision 59)
@@ -41,12 +41,12 @@
 
 const char * alias () {
-	static int i = 0;
-	char * buf = new char[4];	
-	buf[3] = '\0';
-	buf[2] = 'a' + i % 26;
-	buf[1] = 'a' + (i / 26) % 26;
-	buf[0] = 'a' + ((i / 26) / 26) % 26;
-	i++;	
-	return buf;
+    static int i = 0;
+    char * buf = new char[4];
+    buf[3] = '\0';
+    buf[2] = 'a' + i % 26;
+    buf[1] = 'a' + (i / 26) % 26;
+    buf[0] = 'a' + ((i / 26) / 26) % 26;
+    i++;
+    return buf;
 }
 
Index: sources/src/casc.h
===================================================================
--- sources/src/casc.h	(revision 58)
+++ sources/src/casc.h	(revision 59)
@@ -21,8 +21,8 @@
 
 #include <cstdio>
-#include <stdint.h>
+//#include <stdint.h>
 
 EXTERN char unstable;
-EXTERN int32_t pending_write_vector_nb;
+EXTERN int32 pending_write_vector_nb;
 
 namespace sc_core {
Index: sources/src/entity.cc
===================================================================
--- sources/src/entity.cc	(revision 58)
+++ sources/src/entity.cc	(revision 59)
@@ -122,5 +122,5 @@
 }
 
-static sc_port_base *get_localvar(equi_t & eq) {
+static sc_port_base * get_localvar(equi_t & eq) {
     equi_t::iterator i;
     for (i = eq.begin(); i != eq.end(); ++i) {
@@ -134,5 +134,5 @@
 
 
-static sc_port_base *get_signal(equi_t & eq) {
+static sc_port_base * get_signal(equi_t & eq) {
     equi_t::iterator i;
     for (i = eq.begin(); i != eq.end(); ++i) {
@@ -167,5 +167,4 @@
     assert(pointer != NULL);
 
-    // boost
     tab_t2equi_it_t:: /*const_ */ iterator it = tab2equi_map.find(pointer);
     if (it != tab2equi_map.end()) {
@@ -274,4 +273,7 @@
 
 template < typename T > static equi_list_t::iterator get_equi(T & e) {
+    // QM debug
+    //cout << "equi_map : " << equi_map << endl;
+
     entity2equi_it_t::iterator it = equi_map.find(entity(e));
     if (it == equi_map.end()) {
Index: sources/src/gen_code.cc
===================================================================
--- sources/src/gen_code.cc	(revision 58)
+++ sources/src/gen_code.cc	(revision 59)
@@ -582,4 +582,6 @@
     SC_ENTRY_FUNC func = m.func;
     //  CASC_ENTRY_FUNC   func = reinterpret_cast<CASC_ENTRY_FUNC> (m.func);
+    // QM
+    //cerr << "Exec " << mod->name() << "->" << m.name << endl;
     (mod->*func) ();
 }
Index: sources/src/gen_code.h
===================================================================
--- sources/src/gen_code.h	(revision 58)
+++ sources/src/gen_code.h	(revision 59)
@@ -93,9 +93,9 @@
 inline void internal_sc_cycle1(int number_of_cycles) {  
     //while ((! have_to_stop) && (number_of_cycles != 0)) {
-    while (!((have_to_stop) | (number_of_cycles == 0))) {
+    while (!((have_to_stop) || (number_of_cycles == 0))) {
         trace_all(false);
         internal_sc_cycle2();
         trace_all(true);
-        number_of_cycles = (number_of_cycles<0) ? number_of_cycles:number_of_cycles - 1;
+        number_of_cycles = (number_of_cycles < 0) ? number_of_cycles : number_of_cycles - 1;
     }
 }
@@ -116,11 +116,11 @@
 #endif
 
-    if (is_posted_write ()) {
-        // update posted value to external signals		
-        update ();
-        func_combinationals ();
+    if (is_posted_write()) {
+        // update posted value to external signals
+        update();
+        func_combinationals();
     }
 
-    internal_sc_cycle1 ((int) duration);
+    internal_sc_cycle1((int) duration);
 
     // don't need to do func_combinationals since 'unstable' flag is now false
Index: sources/src/global_functions.cc
===================================================================
--- sources/src/global_functions.cc	(revision 58)
+++ sources/src/global_functions.cc	(revision 59)
@@ -38,4 +38,5 @@
 #include <iostream>
 #include <dlfcn.h>
+#include <signal.h>
 
 #include "schedulers.h"   // get_scheduling & run_schedule_editor
@@ -326,4 +327,14 @@
     check_and_initialize();
     sc_core::internal_sc_cycle0(duration);
+    if (have_to_stop) {
+        std::vector<method_process_t *>::iterator i;
+        for (i = sc_core::method_process_list.begin(); i != sc_core::method_process_list.end(); i++) {
+            delete *i;
+        }
+        std::vector<const char *>::iterator j;
+        for (j = sc_core::allocated_names.begin(); j != sc_core::allocated_names.end(); j++) {
+            free((char *) *j);
+        }
+    }
 }
 
@@ -332,4 +343,14 @@
     check_and_initialize();
     sc_core::internal_sc_cycle0(duration);
+    if (have_to_stop) {
+        std::vector<method_process_t *>::iterator i;
+        for (i = sc_core::method_process_list.begin(); i != sc_core::method_process_list.end(); i++) {
+            delete *i;
+        }
+        std::vector<const char *>::iterator j;
+        for (j = sc_core::allocated_names.begin(); j != sc_core::allocated_names.end(); j++) {
+            free((char *) *j);
+        }
+    }
 }
 
Index: sources/src/internal.h
===================================================================
--- sources/src/internal.h	(revision 58)
+++ sources/src/internal.h	(revision 59)
@@ -17,4 +17,5 @@
 #include <string>
 #include <vector>
+//#include <stdint.h>
 
 namespace sc_core {
@@ -27,4 +28,5 @@
 typedef std::vector<std::string> module_name_stack_t;
 extern module_name_stack_t module_name_stack;
+extern std::vector<const char *> allocated_names;
 
 // Hash Table Port -> Module
Index: sources/src/internal_ext.h
===================================================================
--- sources/src/internal_ext.h	(revision 58)
+++ sources/src/internal_ext.h	(revision 59)
@@ -38,4 +38,5 @@
 
 #include <list>
+//#include <stdint.h>
 
 #include "sc_fwd.h"
@@ -71,5 +72,5 @@
 #else
     typedef uint32 tab_t;
-// typedef smallest_uint tab_t; // signals of 64 bits are wrong in trace file
+    //typedef smallest_uint tab_t; // signals of 64 bits are wrong in trace file
 #endif
 typedef tab_t * equi_table_t;
Index: sources/src/module_hierarchy2dot.cc
===================================================================
--- sources/src/module_hierarchy2dot.cc	(revision 58)
+++ sources/src/module_hierarchy2dot.cc	(revision 59)
@@ -1,13 +1,13 @@
 /*------------------------------------------------------------\
-|                                                             |
-| Tool    :                  systemcass                       |
-|                                                             |
-| File    :                  module_hierarchy2dot.cc          |
-|                                                             |
-| Author  :                 Buchmann Richard                  |
-|                                                             |
-| Date    :                   26_01_2006                      |
-|                                                             |
-\------------------------------------------------------------*/
+  |                                                             |
+  | Tool    :                  systemcass                       |
+  |                                                             |
+  | File    :                  module_hierarchy2dot.cc          |
+  |                                                             |
+  | Author  :                 Buchmann Richard                  |
+  |                                                             |
+  | Date    :                   26_01_2006                      |
+  |                                                             |
+  \------------------------------------------------------------*/
 
 /* 
@@ -53,72 +53,61 @@
 namespace sc_core {
 
-/*
-static
-const char*
-get_parent_name (const sc_object &obj)
-{
-  const sc_object *parent = NULL;//get_parent_object (obj);
-  if (parent == NULL)
-    return "";
-  return parent->basename ();
-}
-*/
-
 typedef set<const char*> node_set_t;
 node_set_t node_set;
 
-static
-void
-print_edge (ostream &o)
+static void print_edge (ostream &o)
 {
-  typedef map<const char*, const char*> edge_t;
-  edge_t edges;
-  const equi_list_t &eq_list = get_equi_list ();
-  equi_list_t::const_iterator jt;
-  for (jt = eq_list.begin (); jt != eq_list.end (); ++jt)
-  {
-    const equi_t &eq = (*jt);
-    sc_port_base *out   = get_out_port (eq);
-    if (out == NULL)
-      continue;
-    if (is_clock (*out))
-      continue;
-    const sc_module &out_mod = out->get_module ();
-    const char *out_mod_name = out_mod.basename ();
-    equi_t::const_iterator it;
-    for (it = eq.begin (); it != eq.end (); ++it)
+    typedef map<const char*, const char*> edge_t;
+    edge_t edges;
+    const equi_list_t &eq_list = get_equi_list ();
+    equi_list_t::const_iterator jt;
+    for (jt = eq_list.begin (); jt != eq_list.end (); ++jt)
     {
-      const entity &in_entity  = *it;
-      sc_object    *in_obj     = in_entity.object;
-      assert(in_obj != NULL);
-      const sc_module *in_parent = NULL;
-      switch (in_entity.type) {
-      case entity::PORT :
-        in_parent = &(in_entity.port->get_module ());
-        if (&out_mod == in_parent)
-          continue;
-        break;
-      case entity::SIGNAL :
-      default :
-        continue;
-      }
-      edges[out_mod_name] = in_parent->basename ();
-      node_set.insert(out_mod_name);
-      node_set.insert(in_parent->basename ());
+        const equi_t & eq = (*jt);
+        sc_port_base * out   = get_out_port (eq);
+        if (out == NULL) {
+            continue;
+        }
+        if (is_clock(*out)) {
+            continue;
+        }
+        const sc_module &out_mod = out->get_module ();
+        const char *out_mod_name = out_mod.basename ();
+        equi_t::const_iterator it;
+        for (it = eq.begin (); it != eq.end (); ++it)
+        {
+            const entity &in_entity  = *it;
+            sc_object    *in_obj     = in_entity.object;
+            assert(in_obj != NULL);
+            const sc_module *in_parent = NULL;
+            switch (in_entity.type) {
+                case entity::PORT :
+                    in_parent = &(in_entity.port->get_module ());
+                    if (&out_mod == in_parent) {
+                        continue;
+                    }
+                    break;
+                case entity::SIGNAL :
+                default :
+                    continue;
+            }
+            edges[out_mod_name] = in_parent->basename ();
+            node_set.insert(out_mod_name);
+            node_set.insert(in_parent->basename ());
+        }
     }
-  }
 #if 0
-  const equi_t &signal_eq = *(eq_list.begin ());
-  const char *signal_name = get_name (signal_eq);
-  o << "edge [label=\"" << signal_name << "\"]\n";
+    const equi_t &signal_eq = *(eq_list.begin ());
+    const char *signal_name = get_name (signal_eq);
+    o << "edge [label=\"" << signal_name << "\"]\n";
 #endif
-  edge_t::const_iterator i;
-  for (i = edges.begin (); i != edges.end (); ++i)
-  {
-    o << i->first
-      << " -> " 
-      << i->second 
-      << ";\n";
-  }
+    edge_t::const_iterator i;
+    for (i = edges.begin (); i != edges.end (); ++i)
+    {
+        o << i->first
+          << " -> " 
+          << i->second 
+          << ";\n";
+    }
 }
 
@@ -126,56 +115,59 @@
 
 static
-void
+    void
 print_node (ostream         &o,
-            const sc_object &obj)
+        const sc_object &obj)
 {
-  const vector<sc_object*> &obj_list = get_child_objects (obj);
-  bool subgraph = (obj_list.empty() == false);
-//                  && (get_parent_object (obj) != NULL);
-  if (subgraph) {
-    const char *name = obj.basename ();
-    o << "subgraph \"cluster" << name << "\" {\n"
-      << "label=\"" << name << "\";\n";
-    print_node (o, obj_list);
-    o << "}\n";
-  } /*else*/ {
-//    if (obj.kind () == sc_module::kind_string)
-    if (node_set.find (obj.basename ()) != node_set.end())
-      o << obj.basename () << endl;
-  }
+    const vector<sc_object*> &obj_list = get_child_objects (obj);
+    bool subgraph = (obj_list.empty() == false);
+    //                  && (get_parent_object (obj) != NULL);
+    if (subgraph) {
+        const char *name = obj.basename ();
+        o << "subgraph \"cluster" << name << "\" {\n"
+            << "label=\"" << name << "\";\n";
+        print_node (o, obj_list);
+        o << "}\n";
+    } /*else*/ {
+        //    if (obj.kind () == sc_module::kind_string)
+        if (node_set.find (obj.basename ()) != node_set.end()) {
+            o << obj.basename () << endl;
+        }
+    }
 }
 
 static
-void
+    void
 print_node (ostream                  &o,
-            const vector<sc_object*> &obj_list)
+        const vector<sc_object*> &obj_list)
 {
-  vector<sc_object*>::const_iterator it;
-  for (it = obj_list.begin(); it != obj_list.end(); ++it)
-  {
-    sc_object *obj = *it;
-    print_node (o, *obj);
-  }
+    vector<sc_object*>::const_iterator it;
+    for (it = obj_list.begin(); it != obj_list.end(); ++it)
+    {
+        sc_object *obj = *it;
+        print_node (o, *obj);
+    }
 }
 
-bool
+    bool
 module_hierarchy2dot (const char *name)
 {
-	if (!name)
-		return false;
-	string filename;
-	filename =  name;
-	filename += ".dot";
-	ofstream o;
-  o.open (filename.c_str(),ios::out | ios::trunc);
-	if (o.is_open () == false)
-		return false;
-	o << "strict digraph " << name << " {\n";
-  o << "node [shape=box];\n";
-  print_edge (o);
-	print_node (o,sc_get_top_level_objects ());
-	o << "}\n";
-	o.close ();
-	return true;
+    if (!name) {
+        return false;
+    }
+    string filename;
+    filename =  name;
+    filename += ".dot";
+    ofstream o;
+    o.open (filename.c_str(),ios::out | ios::trunc);
+    if (o.is_open () == false) {
+        return false;
+    }
+    o << "strict digraph " << name << " {\n";
+    o << "node [shape=box];\n";
+    print_edge (o);
+    print_node (o,sc_get_top_level_objects ());
+    o << "}\n";
+    o.close ();
+    return true;
 }
 
Index: sources/src/mouchard_scheduling.cc
===================================================================
--- sources/src/mouchard_scheduling.cc	(revision 58)
+++ sources/src/mouchard_scheduling.cc	(revision 59)
@@ -46,4 +46,5 @@
 #include "sc_module.h"
 #include "sc_ver.h"
+
 
 #ifdef HAVE_CONFIG_H
Index: sources/src/sc_bigint.h
===================================================================
--- sources/src/sc_bigint.h	(revision 58)
+++ sources/src/sc_bigint.h	(revision 59)
@@ -16,4 +16,5 @@
 #include <sc_logic.h>
 #include <sc_bv.h>
+//#include <stdint.h>
 
 // ----------------------------------------------------------------------------
Index: sources/src/sc_biguint.h
===================================================================
--- sources/src/sc_biguint.h	(revision 58)
+++ sources/src/sc_biguint.h	(revision 59)
@@ -19,4 +19,5 @@
 
 #include "sc_nbdefs.h"
+//#include <stdint.h>
 
 namespace sc_dt {
Index: sources/src/sc_bv.h
===================================================================
--- sources/src/sc_bv.h	(revision 58)
+++ sources/src/sc_bv.h	(revision 59)
@@ -17,4 +17,6 @@
 //
 // ----------------------------------------------------------------------------
+
+//#include <stdint.h>
 
 #include "sc_nbdefs.h"
@@ -41,7 +43,7 @@
     sc_bv_base & operator = (const sc_unsigned & a);
     sc_bv_base & operator = (const sc_signed & a);
+    sc_bv_base & operator = (unsigned int a);
     sc_bv_base & operator = (unsigned long a);
     sc_bv_base & operator = (long a);
-    sc_bv_base & operator = (unsigned int a);
     sc_bv_base & operator = (int a);
     sc_bv_base & operator = (uint64 a);
@@ -66,7 +68,7 @@
     sc_bv (const sc_unsigned & a);
     sc_bv (const sc_signed & a);
+    sc_bv (unsigned int a);
     sc_bv (unsigned long a);
     sc_bv (long a);
-    sc_bv (unsigned int a);
     sc_bv (int a);
     sc_bv (uint64 a);
@@ -82,7 +84,7 @@
     sc_bv < W > & operator = (const sc_unsigned & a);
     sc_bv < W > & operator = (const sc_signed & a);
+    sc_bv < W > & operator = (unsigned int a);
     sc_bv < W > & operator = (unsigned long a);
     sc_bv < W > & operator = (long a);
-    sc_bv < W > & operator = (unsigned int a);
     sc_bv < W > & operator = (int a);
     sc_bv < W > & operator = (uint64 a);
Index: sources/src/sc_clock_ext.h
===================================================================
--- sources/src/sc_clock_ext.h	(revision 58)
+++ sources/src/sc_clock_ext.h	(revision 59)
@@ -73,5 +73,5 @@
              bool            posedge_first_ = true);
 
-    sc_clock(const char *name_,
+    sc_clock(const char * name_,
              double period_,
              double duty_cycle_ = 0.5,
Index: sources/src/sc_int.h
===================================================================
--- sources/src/sc_int.h	(revision 58)
+++ sources/src/sc_int.h	(revision 59)
@@ -19,4 +19,5 @@
 #include <sc_bv.h>
 #include <cstdlib>
+//#include <stdint.h>
 
 // ----------------------------------------------------------------------------
@@ -37,10 +38,10 @@
 
 
-#define MASK32(W) ((~ (const uint32)0) >> (sizeof (uint32) * 8 - W))
-#define MASK64(W) ((~ (const uint64)0) >> (sizeof (uint64) * 8 - W))
+#define MASK32(W) ((~ (const uint32) 0) >> (sizeof (uint32) * 8 - W))
+#define MASK64(W) ((~ (const uint64) 0) >> (sizeof (uint64) * 8 - W))
 
 template<int W> struct s_int_type { typedef int64 int_type; };
 
-#define DECLAR_INT_TYPE(W) template<> struct s_int_type<W> { typedef smallest_int int_type; } // not declared as in8 because << operator threats like a character
+#define DECLAR_INT_TYPE(W) template<> struct s_int_type<W> { typedef smallest_int int_type; } // not declared as int8 because << operator threats like a character
 DECLAR_INT_TYPE(1);
 DECLAR_INT_TYPE(2);
@@ -54,5 +55,5 @@
 
 #define DECLAR_INT_TYPE(W) template<> struct s_int_type<W> { typedef int16 int_type; }
-DECLAR_INT_TYPE( 9);
+DECLAR_INT_TYPE(9);
 DECLAR_INT_TYPE(10);
 DECLAR_INT_TYPE(11);
@@ -96,15 +97,17 @@
     int64 val;
     sc_int_subref_r(int64 val_, int left_, int right_) {
-        val = val_; left = left_; right = right_;
+        val = val_;
+        left = left_;
+        right = right_;
     }
     
-    inline int64 read () const { return val; }
-    inline const sc_int_subref_r& operator | (const sc_int_subref_r &v) const {
-        print_warning ();
+    inline int64 read() const { return val; }
+    inline const sc_int_subref_r & operator | (const sc_int_subref_r & v) const {
+        print_warning();
         return *this;
     }
 
     private :
-    void print_warning () const;
+    void print_warning() const;
 
 };
@@ -116,5 +119,5 @@
 class sc_int_subref_r;
 
-template< int W /* = SC_INTWIDTH */>
+template < int W /* = SC_INTWIDTH */>
 class sc_int {
 
@@ -123,11 +126,12 @@
     /***********************/
     typedef sc_int<W> this_type;
+    public:
     typedef typename s_int_type<W>::int_type data_type;
-
+    private:
     typedef data_type sc_int_subref;
 
     // internal
     union {
-        val_field<W, (sizeof (data_type) * 8) - W,data_type> vf; /* To compute */
+        val_field<W, (sizeof(data_type) * 8) - W,data_type> vf; /* To compute */
         data_type val;          /* To return an int reference (read function) */
     };
@@ -138,15 +142,15 @@
     /***********************/
     public:
-    sc_int()                  { val = 0; }
-    sc_int (const char * a)   { val = 0; write (std::atoi (a)); }
-    sc_int (unsigned short a) { val = 0; write (a); }
-    sc_int (short a)          { val = 0; write (a); }
-    sc_int (unsigned long a)  { val = 0; write (a); }
-    sc_int (long a)           { val = 0; write (a); }
-    sc_int (unsigned int a)   { val = 0; write (a); }
-    sc_int (int a)            { val = 0; write (a); }
-    sc_int (int64 a)          { val = 0; write (a); }
-    sc_int (uint64 a)         { val = 0; write (a); }
-    sc_int (double a)         { val = 0; write (a); }
+    sc_int()                 { val = 0; }
+    sc_int(const char * a)   { val = 0; write(std::atoi(a)); }
+    sc_int(unsigned short a) { val = 0; write(a); }
+    sc_int(short a)          { val = 0; write(a); }
+    sc_int(unsigned long a)  { val = 0; write(a); }
+    sc_int(long a)           { val = 0; write(a); }
+    sc_int(unsigned int a)   { val = 0; write(a); }
+    sc_int(int a)            { val = 0; write(a); }
+    sc_int(int64 a)        { val = 0; write(a); }
+    sc_int(uint64 a)       { val = 0; write(a); }
+    sc_int(double a)         { val = 0; write(a); }
 
     template <int W2> sc_int (const sc_int<W2> &val_) { val = 0; write (val_.read());}
@@ -155,6 +159,6 @@
      */
 
-    sc_int (const sc_int &val_) { val = val_.val; }
-    sc_int (const sc_int_subref_r & a) { val = 0; write (a); } 
+    sc_int(const sc_int & val_) { val = val_.val; }
+    sc_int(const sc_int_subref_r & a) { val = 0; write(a); } 
     /* the user needs to cast explicitly result of range () method. */
 
@@ -165,8 +169,10 @@
 
     // read/write
-    inline const data_type& read() const { return val; }
-    inline void write(data_type val_)    { vf.valW = val_; }
-    template <int W2> inline void write (const sc_int<W2> val_) { write (val_.read ()); }
-    inline void write (const sc_int_subref_r& s) { write (s.read()); }
+    inline const data_type & read() const { return val; }
+    inline void write(data_type val_) { vf.valW = val_; }
+    template <int W2> void write(const sc_int<W2> val_) { write (val_.read ()); }
+    inline void write(const sc_int_subref_r & s) {
+        write (s.read());
+    }
 
     /***********************/
@@ -176,14 +182,14 @@
     // operators
     inline operator const data_type & () const {
-        return read ();
-    }
-
-    template <typename T> inline sc_int& operator = (const T& val_) {
-        write (val_);
+        return read();
+    }
+
+    template < typename T > inline sc_int & operator = (const T & val_) {
+        write(val_);
         return *this;
     }
 
-    inline sc_int & operator = (const sc_int_subref_r& a) {
-        write (a);
+    inline sc_int & operator = (const sc_int_subref_r & a) {
+        write(a);
         return *this;
     }
@@ -199,8 +205,8 @@
         return sc_dt::to_string (val, W, numrep);
     }
-    const sc_string to_dec() const { return to_string (SC_DEC); }
-    const sc_string to_bin() const { return to_string (SC_BIN); }
-    const sc_string to_oct() const { return to_string (SC_OCT); }
-    const sc_string to_hex() const { return to_string (SC_HEX); }
+    const sc_string to_dec() const { return to_string(SC_DEC); }
+    const sc_string to_bin() const { return to_string(SC_BIN); }
+    const sc_string to_oct() const { return to_string(SC_OCT); }
+    const sc_string to_hex() const { return to_string(SC_HEX); }
 
     // arithmetic
@@ -231,5 +237,6 @@
     template <int W2> 
     inline sc_int<W + W2> operator , (const sc_int<W2> & b) const {
-        sc_int<W + W2> res = read() << W2; res += b.read();
+        sc_int<W + W2> res = read() << W2;
+        res += b.read();
         return res;
     }
@@ -241,16 +248,17 @@
 
     template <int W2>
-    inline sc_int<W2> operator , (const sc_int_subref_r &v) const {
+    inline sc_int<W2> operator , (const sc_int_subref_r & v) const {
         std::cerr << "Warning : \n";
         return sc_int<W2> (v.read());
     }
 
-    inline sc_int_subref range (int left, int right) {
+    inline sc_int_subref range(int left, int right) {
         return (data_type)((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right;
     }
 
-    inline sc_int_subref_r range (int left, int right) const {
-        return sc_int_subref_r (((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right, left, right);
-    }
+    inline sc_int_subref_r range(int left, int right) const {
+        return sc_int_subref_r(((data_type) (((data_type)~(0)) >> (sizeof (data_type) * 8 - left - 1)) & val) >> right, left, right);
+    }
+
 #if 0
     std::cerr << "range(" << left << "," << right << ")\n";
@@ -263,5 +271,5 @@
 };
 
-inline std::ostream & operator << (std::ostream &o, const sc_int_subref_r & s) {
+inline std::ostream & operator << (std::ostream & o, const sc_int_subref_r & s) {
     return o << s.val;
 }
Index: sources/src/sc_lv.h
===================================================================
--- sources/src/sc_lv.h	(revision 58)
+++ sources/src/sc_lv.h	(revision 59)
@@ -18,4 +18,6 @@
 //
 // ----------------------------------------------------------------------------
+
+//#include <stdint.h>
 
 #include "sc_nbdefs.h"
@@ -122,7 +124,7 @@
     sc_lv(const sc_unsigned & a) { val = 0; write(a); }
     sc_lv(const sc_signed & a)   { val = 0; write(a); }
-    sc_lv(unsigned long a)       { val = 0; write(a); }  
+    sc_lv(unsigned int a)        { val = 0; write(a); }
+    sc_lv(unsigned long a)       { val = 0; write(a); }
     sc_lv(long a)                { val = 0; write(a); }
-    sc_lv(unsigned int a)        { val = 0; write(a); }
     sc_lv(int a)                 { val = 0; write(a); }
     sc_lv(uint64 a)              { val = 0; write(a); }
@@ -142,5 +144,5 @@
 #endif // LRM
 
-    template <typename T> inline sc_lv& operator = (const T& val_) {
+    template < typename T > inline sc_lv& operator = (const T& val_) {
         write (val_);
         return *this;
Index: sources/src/sc_module.cc
===================================================================
--- sources/src/sc_module.cc	(revision 58)
+++ sources/src/sc_module.cc	(revision 59)
@@ -67,4 +67,5 @@
 instances_list_t temp_list;   
 method_process_list_t method_process_list;
+std::vector<const char *> allocated_names;
 module_name_stack_t module_name_stack;
 modules_stack_t modules_stack;
@@ -73,5 +74,5 @@
 void declare_method_process(const char * name, SC_ENTRY_FUNC func, sc_module & module) {
   method = create_method_process(name, func, module);
-  method_process_list.push_back(method); 
+  method_process_list.push_back(method);
 }
 
Index: sources/src/sc_nbdefs.h
===================================================================
--- sources/src/sc_nbdefs.h	(revision 58)
+++ sources/src/sc_nbdefs.h	(revision 59)
@@ -14,11 +14,8 @@
 #define __SC_DEFS_H__
 
-#ifndef WIN32
+//#include <stdint.h>
+
 typedef signed long long int64;
 typedef unsigned long long uint64;
-#else
-typedef signed __int64 int64;
-typedef unsigned __int64 uint64;
-#endif
 
 typedef long  int32;
@@ -28,4 +25,8 @@
 typedef unsigned short uint16;
 typedef unsigned char  uint8;
+
+
+//typedef uint16_t smallest_uint;
+//typedef int16_t  smallest_int;
 
 typedef uint16 smallest_uint;
Index: sources/src/sc_numrep.h
===================================================================
--- sources/src/sc_numrep.h	(revision 58)
+++ sources/src/sc_numrep.h	(revision 59)
@@ -55,5 +55,5 @@
             char t[64];
             char format[64];
-            sprintf(format, "0x0%%0%dx", nbits / 4);
+            sprintf(format, "0x0%%0%dx", (int) nbits / 4);
             sprintf(t, format, val);
             s = t;
Index: sources/src/sc_object.cc
===================================================================
--- sources/src/sc_object.cc	(revision 58)
+++ sources/src/sc_object.cc	(revision 59)
@@ -107,5 +107,7 @@
     string s;
     gen_name(basename_,s);
-    return strdup (s.c_str());
+    const char * ret = strdup(s.c_str());
+    sc_core::allocated_names.push_back(ret);
+    return ret;
 }
 
Index: sources/src/sc_object.h
===================================================================
--- sources/src/sc_object.h	(revision 58)
+++ sources/src/sc_object.h	(revision 59)
@@ -26,9 +26,9 @@
 
 class sc_object {
-	
+
     ///////////
-	// Internal
+    // Internal
     // ////////
-	protected:
+    protected:
     void init();
     void set_kind(const char *);
Index: sources/src/sc_pat_trace.cc
===================================================================
--- sources/src/sc_pat_trace.cc	(revision 58)
+++ sources/src/sc_pat_trace.cc	(revision 59)
@@ -70,5 +70,5 @@
     //création d'1 instance de la structure Sc_trace_file:
     sc_trace_file * traceFic = new sc_trace_file();
-    traceFic->flag = PAT_FORMAT;	
+    traceFic->flag = PAT_FORMAT;
 
     trace_file_list.push_back(traceFic);
@@ -83,5 +83,5 @@
 //*************************************************************************
 
-void sc_close_pat_trace_file(sc_trace_file * traceFic ) {	
+void sc_close_pat_trace_file(sc_trace_file * traceFic ) {
     if (notrace) {
         return;
Index: sources/src/sc_port.cc
===================================================================
--- sources/src/sc_port.cc	(revision 58)
+++ sources/src/sc_port.cc	(revision 59)
@@ -53,5 +53,5 @@
     extern char unstable;
     char unstable = 0; // not in sc_core namespace because dynamic link support C linkage only
-    unsigned int pending_write_vector_nb = 0;
+    int32 pending_write_vector_nb = 0;
 }
 
@@ -67,7 +67,7 @@
 extern equi_list_t equi_list;
 
-const char * get_module_name (const tab_t * pointer) {
-	const equi_t & eq = get_equi (pointer);
-    return get_module_name (eq);
+const char * get_module_name(const tab_t * pointer) {
+    const equi_t & eq = get_equi(pointer);
+    return get_module_name(eq);
 }
 
@@ -87,5 +87,5 @@
 
 sc_port_base::sc_port_base() {
-	init ();
+    init ();
 }
 
@@ -216,5 +216,5 @@
             // stl vectors are too slow
             // memcopy is not better
-            // signal table sorting doesn't give any better performance	
+            // signal table sorting doesn't give any better performance
 #if defined(DUMP_STAGE)
             cerr << "(" << pending_write_vector_nb 
@@ -229,5 +229,5 @@
                     exit (8);
                 }
-#endif	
+#endif
 #ifdef DUMP_SIGNAL_STATS
                 if (*(iter.pointer) == iter.value) {
@@ -236,5 +236,5 @@
                 counter[iter.pointer]++;
 #endif
-                *(iter.pointer) = iter.value;	
+                *(iter.pointer) = iter.value;
 #undef iter
             }
@@ -277,5 +277,5 @@
     for (k = counter.begin(); k != counter.end(); ++k) {
         string module_name = get_module_name (k->first);
-        counter_by_module[module_name] += k->second;	
+        counter_by_module[module_name] += k->second;
     }
     o << "module name / usage\n";
@@ -290,4 +290,5 @@
 #endif
 }
+
 
 static bool is_bound(/*const*/ sc_port_base & port) {
@@ -297,9 +298,10 @@
         return false; // case : sc_in not bound
     }
-    return has_equi (port);
-}
+    return has_equi(port);
+}
+
 
 static void check_port(/*const*/ sc_port_base & port) {
-    if (!is_bound (port)) {
+    if (!is_bound(port)) {
         cerr << "Error : '" << port.name() << "' port"
             " (" << port.kind() << ")"
@@ -316,5 +318,5 @@
     port2module_t::/*const_*/iterator i;
     for (i = port2module.begin(); i != port2module.end(); ++i) {
-        /*const*/ sc_port_base *port = i->first;
+        /*const*/ sc_port_base * port = i->first;
         assert(port != NULL);
         check_port(*port);
Index: sources/src/sc_signal.h
===================================================================
--- sources/src/sc_signal.h	(revision 58)
+++ sources/src/sc_signal.h	(revision 59)
@@ -18,4 +18,5 @@
 #include <iostream>
 #include <cstdlib>
+#include <typeinfo> // for typeid
 
 #include "sc_fwd.h"
@@ -53,8 +54,4 @@
     base_type * pointer;
     base_type value;
-    //pending_write_t(base_type * const pointer_, const base_type value_) {
-    //    pointer = pointer_;
-    //    value = value_;
-    //}
     
     friend std::ostream & operator << (std::ostream & o, const pending_write_t & p) {
@@ -76,11 +73,11 @@
 
 template < typename T >
-inline void post_write(base_type * const pointer_, const T value_) /*INLINE*/;
-
-template < typename T >
-inline void post_multiwrite(base_type * const pointer_, const T value_) {
+inline void post_write(base_type * const pointer_, const T & value_) /*INLINE*/;
+
+template < typename T >
+inline void post_multiwrite(base_type * const pointer_, const T & value_) {
     size_t size = (sizeof(T) - 1) / sizeof(base_type);
     size_t i = 0;
-    const base_type * pvalue = (const base_type *) (void *) (& value_);
+    const base_type * pvalue = (const base_type *) (void *) (&value_);
     do {
         post_write(pointer_ + i, pvalue[i]);
@@ -89,7 +86,7 @@
 
 template < typename T >
-inline void post_write(base_type * const pointer_, const T value_) {
+inline void post_write(base_type * const pointer_, const T & value_) {
     if (sizeof(T) > sizeof(base_type)) {
-        post_multiwrite(pointer_,value_);
+        post_multiwrite(pointer_, value_);
     }
     else {
@@ -166,5 +163,7 @@
 
     private:
+
     T val;
+
     typedef T data_type;
     typedef sc_signal < T > this_type;
@@ -182,4 +181,8 @@
     // constructors, destructor 
     sc_signal() {
+        if (typeid(data_type) == typeid(double) || typeid(data_type) == typeid(float)) {
+            std::cerr << "Error: SystemCASS does not support sc_signal<T> with T of type " << typeid(data_type).name() << std::endl;
+            exit(1);
+        }
         init();
     }
@@ -215,5 +218,14 @@
     }
 
-    const data_type & get_new_value() const;
+    const data_type & get_new_value() const {
+        // Warning: untested and doesn't support variable size
+        unsigned int i = 0;
+        for (i = 0; i < pending_write_vector_capacity; i++) {
+            if (pending_write_vector[i].pointer == get_pointer()) {
+                return pending_write_vector[i].value;
+            }
+        }
+        return val;
+    }
 
     //  void trace (sc_trace_file * tf) const;
@@ -235,5 +247,5 @@
     set_kind(kind_string);
     sc_interface::init(sizeof(data_type)); 
-    val = 0; /* The simulator initializes the signal/register to 0.    */
+    val = (T) 0; /* The simulator initializes the signal/register to 0.    */
     /* However, hardware initialization still has to be done. */
     /* This kind of initialization is for trace diffing.      */
@@ -245,7 +257,8 @@
 /*virtual*/ inline const T & sc_signal< T >::read() const {
 #ifdef DUMP_READ
-    std::cerr << "read " << READ_SIGNAL(const T, get_pointer()) << " on signal " << name() << "\n";
-#endif
-    return READ_SIGNAL(const T, get_pointer());
+    std::cerr << "read " << READ_SIGNAL(const data_type, get_pointer()) << " on signal " << name() << "\n";
+#endif
+    // QM
+    return READ_SIGNAL(T, get_pointer());
 }
 
@@ -266,4 +279,5 @@
     std::cerr << "write (posted) " << value_ << " on sc_signal (writing into register) '" << name() << "'\n";
 #endif
+    
     post_write(/*(tab_t*)&val*/ get_pointer(), value_);
 }
Index: sources/src/sc_time.cc
===================================================================
--- sources/src/sc_time.cc	(revision 58)
+++ sources/src/sc_time.cc	(revision 59)
@@ -51,8 +51,8 @@
 
 static const char *const unit_repr_string[6] = {
-	"FS", "PS", "NS", "US", "MS", "SEC"
+    "FS", "PS", "NS", "US", "MS", "SEC"
 };
 
-uint64_t nb_cycles = 0;
+uint64 nb_cycles = 0;
 
 const sc_time SC_ZERO_TIME(0, SC_NS);
@@ -66,5 +66,5 @@
 
 sc_time::sc_time (double val, sc_time_unit tu) {
-    time = (uint64_t) val;
+    time = (uint64) val;
     unit = tu;
 }
Index: sources/src/sc_time.h
===================================================================
--- sources/src/sc_time.h	(revision 58)
+++ sources/src/sc_time.h	(revision 59)
@@ -15,5 +15,7 @@
 
 #include <string>
-#include <stdint.h>
+//#include <stdint.h>
+
+#include "sc_nbdefs.h"
 
 namespace sc_core {
@@ -40,5 +42,5 @@
 extern sc_time SC_CURRENT_TIME;
 
-extern uint64_t nb_cycles;
+extern uint64 nb_cycles;
 
 inline double sc_simulation_time() {
@@ -55,5 +57,5 @@
 
     friend const sc_time & sc_time_stamp();
-    uint64_t time;
+    uint64 time;
     enum sc_time_unit unit;
 
@@ -64,5 +66,5 @@
     sc_time & operator= (const sc_time &);
 
-    uint64_t value() const {
+    uint64 value() const {
         return time;
     }
Index: sources/src/sc_trace.cc
===================================================================
--- sources/src/sc_trace.cc	(revision 58)
+++ sources/src/sc_trace.cc	(revision 59)
@@ -40,4 +40,5 @@
 #include <iostream>
 #include <cstring> //strlen
+//#include <stdint.h>
 
 #include "sc_port.h"
Index: sources/src/sc_trace.h
===================================================================
--- sources/src/sc_trace.h	(revision 58)
+++ sources/src/sc_trace.h	(revision 59)
@@ -38,4 +38,5 @@
 
 #include <vector>
+//#include <stdint.h>
 
 #include "sc_trace_ext.h"
@@ -60,8 +61,8 @@
 
 struct sc_trace_file {
-	TRACE_FORMAT flag;
-	FILE * pfic;
-	std::vector<signal2trace> sig_list;
-	std::vector<signal2trace> clk_list;
+    TRACE_FORMAT flag;
+    FILE * pfic;
+    std::vector<signal2trace> sig_list;
+    std::vector<signal2trace> clk_list;
 };
 
Index: sources/src/sc_trace_ext.h
===================================================================
--- sources/src/sc_trace_ext.h	(revision 58)
+++ sources/src/sc_trace_ext.h	(revision 59)
@@ -42,4 +42,5 @@
 #include <string>
 #include <sstream>
+//#include <stdint.h>
 
 #include "sc_fwd.h"
@@ -90,6 +91,6 @@
 BITS_NUMBER_GETTER_DEF(, sc_signed     , 8 * sizeof(int));
 BITS_NUMBER_GETTER_DEF(, double        , 8 * sizeof(val_t));
-BITS_NUMBER_GETTER_DEF(, uint64        , 8 * sizeof(val_t));
-BITS_NUMBER_GETTER_DEF(, int64         , 8 * sizeof(val_t));
+BITS_NUMBER_GETTER_DEF(, uint64      , 8 * sizeof(val_t));
+BITS_NUMBER_GETTER_DEF(, int64       , 8 * sizeof(val_t));
 BITS_NUMBER_GETTER_DEF(typename inval_t, sc_in<inval_t>    , bits_number_getter<inval_t>::get());
 BITS_NUMBER_GETTER_DEF(typename inval_t, sc_out<inval_t>   , bits_number_getter<inval_t>::get());
Index: sources/src/sc_uint.h
===================================================================
--- sources/src/sc_uint.h	(revision 58)
+++ sources/src/sc_uint.h	(revision 59)
@@ -20,4 +20,5 @@
 #include <sc_bv.h>
 #include <cstdlib>
+//#include <stdint.h>
 
 // ----------------------------------------------------------------------------
@@ -75,5 +76,5 @@
 };
 
-#define DECLAR_UINT_TYPE(W) template<> struct s_uint_type<W> { typedef smallest_uint uint_type; }// not declared as uint16 because << operator threats like a character
+#define DECLAR_UINT_TYPE(W) template<> struct s_uint_type<W> { typedef smallest_uint uint_type; }// not declared as uint8 because << operator threats like a character
 DECLAR_UINT_TYPE(1);
 DECLAR_UINT_TYPE(2);
@@ -280,5 +281,4 @@
     template <int W2>
     inline sc_uint<W2> operator , (const sc_uint_subref_r & v) const {
-        std::cerr << "Warning : \n"; // ??
         return sc_uint<W2> (v.read());
     }
Index: sources/src/schedulers.cc
===================================================================
--- sources/src/schedulers.cc	(revision 58)
+++ sources/src/schedulers.cc	(revision 59)
@@ -215,5 +215,5 @@
     }
 
-    /* Schedule */ 
+    /* Schedule */
     string base_name;
     switch (scheduling_method) {
Index: sources/src/serialization.cc
===================================================================
--- sources/src/serialization.cc	(revision 58)
+++ sources/src/serialization.cc	(revision 59)
@@ -37,4 +37,5 @@
 #include <map>
 #include <fstream>
+//#include <stdint.h>
 
 #include "internal_ext.h" // tab_t
Index: sources/test_regression/19042005/Makefile
===================================================================
--- sources/test_regression/19042005/Makefile	(revision 58)
+++ sources/test_regression/19042005/Makefile	(revision 59)
@@ -19,8 +19,8 @@
 			$(ECHO) -e "$(OK)" ; \
 		else \
-			$(ECHO) -e "$(KO) 1" ; \
+			$(ECHO) -e "$(KO) SC" ; \
 		fi ; \
 	else \
-		$(ECHO) -e "$(KO) 2" ; \
+		$(ECHO) -e "$(KO) SCASS" ; \
 	fi ;
 
Index: sources/test_regression/Makefile
===================================================================
--- sources/test_regression/Makefile	(revision 58)
+++ sources/test_regression/Makefile	(revision 59)
@@ -71,19 +71,19 @@
       09092005b \
       09092005c \
-		11062007  \
+      11062007  \
       14092005  \
       15042009a \
       15042009b \
       15042009c \
-		15062006  \
+      15062006  \
       15092005a \
       15092005b \
       15092005c \
       15092005d \
-		17022006  \
+      17022006  \
       17032005  \
       20122006  \
       21062005  \
-		24082009  \
+      24082009  \
       25032005  \
       28102005  \
