Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • latest/src/sc_int.h

    r27 r1  
    1818#include <sc_logic.h>
    1919#include <sc_bv.h>
    20 #include <cstdlib>
    2120
    2221// ----------------------------------------------------------------------------
     
    2928// ----------------------------------------------------------------------------
    3029
    31 #include "sc_nbdefs.h"
     30#include"sc_nbdefs.h"
    3231
    3332namespace sc_dt {
     
    136135  sc_int()                 { val = 0; }
    137136//  sc_int(data_type val_)  { val = 0; write (val_); }
    138   sc_int (const char *a)   { val = 0; write (std::atoi (a)); }
     137  sc_int (const char *a)   { val = 0; write (atoi (a)); }
    139138  sc_int (unsigned short a){ val = 0; write (a); }
    140139  sc_int (short a)         { val = 0; write (a); }
     
    198197
    199198  // arithmetic
    200 #define DEFINE_OPERATOR(OPER)        \
    201   template <typename T>              \
    202   inline sc_int& operator OPER (T v) \
    203   { vf.valW OPER v; return *this; }
    204 
    205   DEFINE_OPERATOR(<<=)
    206   DEFINE_OPERATOR(>>=)
    207   DEFINE_OPERATOR(+=)
    208   DEFINE_OPERATOR(-=)
    209   DEFINE_OPERATOR(*=)
    210   DEFINE_OPERATOR(/=)
    211   DEFINE_OPERATOR(%=)
    212   DEFINE_OPERATOR(&=)
    213   DEFINE_OPERATOR(|=)
    214   DEFINE_OPERATOR(^=)
    215 #undef DEFINE_OPERATOR
    216 
     199  template <typename T>
     200  inline sc_int& operator <<= (T v)
     201  { vf.valW <<= v; return *this; }
     202  template <typename T>
     203  inline sc_int& operator >>= (T v)
     204  { vf.valW >>= v; return *this; }
     205  template <typename T>
     206  inline sc_int& operator += (T v)
     207  { vf.valW += v; return *this; }
     208  template <typename T>
     209  inline sc_int& operator -= (T v)
     210  { vf.valW -= v; return *this; }
     211  template <typename T>
     212  inline sc_int& operator *= (T v)
     213  { vf.valW *= v; return *this; }
     214  template <typename T>
     215  inline sc_int& operator /= (T v)
     216  { vf.valW /= v; return *this; }
     217  template <typename T>
     218  inline sc_int& operator %= (T v)
     219  { vf.valW %= v; return *this; }
     220  template <typename T>
     221  inline sc_int& operator &= (T v)
     222  { vf.valW &= v; return *this; }
     223  template <typename T>
     224  inline sc_int& operator |= (T v)
     225  { vf.valW |= v; return *this; }
     226  template <typename T>
     227  inline sc_int& operator ^= (T v)
     228  { vf.valW ^= v; return *this; }
    217229  inline sc_int_bit_ref& operator [] (int v)
    218230  { return (vf.valW >> v) & 1; }
Note: See TracChangeset for help on using the changeset viewer.