Index: sources/src/sc_int.h
===================================================================
--- sources/src/sc_int.h	(revision 21)
+++ sources/src/sc_int.h	(revision 22)
@@ -18,4 +18,5 @@
 #include <sc_logic.h>
 #include <sc_bv.h>
+#include <cstdlib>
 
 // ----------------------------------------------------------------------------
@@ -135,5 +136,5 @@
   sc_int()                 { val = 0; }
 //  sc_int(data_type val_)  { val = 0; write (val_); }
-  sc_int (const char *a)   { val = 0; write (atoi (a)); }
+  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); }
@@ -197,34 +198,21 @@
 
   // arithmetic
-  template <typename T>
-  inline sc_int& operator <<= (T v)
-  { vf.valW <<= v; return *this; }
-  template <typename T>
-  inline sc_int& operator >>= (T v)
-  { vf.valW >>= v; return *this; }
-  template <typename T>
-  inline sc_int& operator += (T v)
-  { vf.valW += v; return *this; }
-  template <typename T>
-  inline sc_int& operator -= (T v)
-  { vf.valW -= v; return *this; }
-  template <typename T>
-  inline sc_int& operator *= (T v)
-  { vf.valW *= v; return *this; }
-  template <typename T>
-  inline sc_int& operator /= (T v)
-  { vf.valW /= v; return *this; }
-  template <typename T>
-  inline sc_int& operator %= (T v)
-  { vf.valW %= v; return *this; }
-  template <typename T>
-  inline sc_int& operator &= (T v)
-  { vf.valW &= v; return *this; }
-  template <typename T>
-  inline sc_int& operator |= (T v)
-  { vf.valW |= v; return *this; }
-  template <typename T>
-  inline sc_int& operator ^= (T v)
-  { vf.valW ^= v; return *this; }
+#define DEFINE_OPERATOR(OPER)        \
+  template <typename T>              \
+  inline sc_int& operator OPER (T v) \
+  { vf.valW OPER v; return *this; }
+
+  DEFINE_OPERATOR(<<=)
+  DEFINE_OPERATOR(>>=)
+  DEFINE_OPERATOR(+=)
+  DEFINE_OPERATOR(-=)
+  DEFINE_OPERATOR(*=)
+  DEFINE_OPERATOR(/=)
+  DEFINE_OPERATOR(%=)
+  DEFINE_OPERATOR(&=)
+  DEFINE_OPERATOR(|=)
+  DEFINE_OPERATOR(^=)
+#undef DEFINE_OPERATOR
+
   inline sc_int_bit_ref& operator [] (int v)
   { return (vf.valW >> v) & 1; }
Index: sources/src/sc_signal.h
===================================================================
--- sources/src/sc_signal.h	(revision 21)
+++ sources/src/sc_signal.h	(revision 22)
@@ -91,23 +91,23 @@
                         const T          value_)
 {
-	if (sizeof (T) > sizeof (base_type)) {
+  if (sizeof (T) > sizeof (base_type)) {
 #if 0
-    cout << "sizeof (T) = " << sizeof (T) << " (base_type = " << sizeof
-(base_type) << "\n";
-#endif
-		post_multiwrite (pointer_,value_);
-	} else {
+  std::cout << "sizeof (T) = " << sizeof (T) 
+            << " (base_type = " << sizeof (base_type) << "\n";
+#endif
+  post_multiwrite (pointer_,value_);
+  } else {
 #if defined(DEBUG)
-	if (pending_write_vector_nb >= pending_write_vector_capacity) {
-	//if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write)) {
-		std::cerr << "Error : The array for posted writing on register is too small.\n";
-		std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
-		std::cerr << "Please check the hardware description.\n";
-		exit (-1);
-	}
+    if (pending_write_vector_nb >= pending_write_vector_capacity) {
+      //if (pending_write_vector_nb >= pending_write_vector_capacity * sizeof(pending_write)) {
+      std::cerr << "Error : The array for posted writing on register is too small.\n";
+      std::cerr << "Up to 1 writing per register is allowed during a cycle.\n";
+      std::cerr << "Please check the hardware description.\n";
+      exit (-1);
+    }
 #endif // DEBUG
-  pending_write_vector[pending_write_vector_nb].pointer = pointer_;
+    pending_write_vector[pending_write_vector_nb].pointer = pointer_;
 //	pending_write_vector[pending_write_vector_nb++].value = *(reinterpret_cast<const base_type*const>(&value_)); => bug !
-  pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
+    pending_write_vector[pending_write_vector_nb++].value = value_; // => bug avec blues !
 
 	// -> fix to use user-defined struct in sc_signal/sc_in/sc_out/sc_inout
@@ -121,10 +121,10 @@
 		return;
 #endif
-	};
+  };
 }
 
 inline bool is_posted_write ()
 {
-		return pending_write_vector_nb > 0;
+  return pending_write_vector_nb > 0;
 }
 
@@ -139,10 +139,10 @@
 class sc_signal_base : public sc_object, public sc_interface
 {
-	//////
-	// Internal
+  //////
+  // Internal
   friend class sc_clock;
   friend class sc_port_base;
   void init ();
-	//////				 
+  //////				 
   
 
@@ -158,5 +158,5 @@
   sc_signal_base(const char* name_);
   sc_signal_base(const char* name_, void*);
-	~sc_signal_base();
+  ~sc_signal_base();
 };
 
@@ -165,19 +165,21 @@
 {
 private:
-	T val;
-  typedef T  data_type;
+  T val;
+  typedef T                data_type;
   typedef sc_signal < T >  this_type;
-	///////////
-	// Internal
-	public: void init ();
-	///////////
-//  virtual void update ();
+
+  ///////////
+  // Internal
+public: void init ();
+  ///////////
+
+  //  virtual void update ();
   void check_writer ();
 public:
   // constructors, destructor 
   sc_signal () 
-	{ init (); }
+  { init (); }
   explicit sc_signal (const char *name_): sc_signal_base(name_)
-	{ init (); }
+  { init (); }
   /*virtual */~ sc_signal () 
   {}
@@ -229,5 +231,5 @@
   set_pointer ((tab_t*)&val);
   set_kind    (kind_string);
-	sc_interface::init (sizeof (data_type)); 
+  sc_interface::init (sizeof (data_type)); 
   val = 0; /* The simulator initializes the signal/register to 0.    */
            /* However, hardware initialization still has to be done. */
Index: sources/src/sc_uint.h
===================================================================
--- sources/src/sc_uint.h	(revision 21)
+++ sources/src/sc_uint.h	(revision 22)
@@ -183,34 +183,32 @@
 
   // arithmetic
-  template <typename T>
-  inline sc_uint& operator <<= (T v)
-  { vf.valW <<= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator >>= (T v)
-  { vf.valW >>= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator += (T v)
-  { vf.valW += v; return *this; }
-  template <typename T>
-  inline sc_uint& operator -= (T v)
-  { vf.valW -= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator *= (T v)
-  { vf.valW *= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator /= (T v)
-  { vf.valW /= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator %= (T v)
-  { vf.valW %= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator &= (T v)
-  { vf.valW &= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator |= (T v)
-  { vf.valW |= v; return *this; }
-  template <typename T>
-  inline sc_uint& operator ^= (T v)
-  { vf.valW ^= v; return *this; }
+#define DEFINE_OPERATOR(OPER)        \
+  template <typename T>              \
+  inline sc_uint& operator OPER (T v)\
+  { vf.valW OPER v; return *this; }
+
+  DEFINE_OPERATOR(<<=)
+  DEFINE_OPERATOR(>>=)
+  DEFINE_OPERATOR(+=)
+  DEFINE_OPERATOR(-=)
+  DEFINE_OPERATOR(*=)
+  DEFINE_OPERATOR(/=)
+  DEFINE_OPERATOR(%=)
+  DEFINE_OPERATOR(&=)
+  DEFINE_OPERATOR(|=)
+  DEFINE_OPERATOR(^=)
+#undef DEFINE_OPERATOR
+
+#if 0
+#define DEFINE_OPERATOR(OPER)                                              \
+  friend bool operator OPER (const data_type& a, const data_type& b);
+//  { return (a.valW) OPER (b.valW); }
+
+  DEFINE_OPERATOR(==)
+  DEFINE_OPERATOR(!=)
+  DEFINE_OPERATOR(>=)
+  DEFINE_OPERATOR(<=)
+#undef DEFINE_OPERATOR
+#endif
   inline sc_uint_bit_ref operator [] (int v)
   { return (vf.valW >> v) & 1; }
