Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sources/src/sc_uint.h

    r27 r11  
    2525// ----------------------------------------------------------------------------
    2626
    27 #include "sc_nbdefs.h"
     27#include"sc_nbdefs.h"
    2828
    2929namespace sc_dt {
     
    183183
    184184  // arithmetic
    185 #define DEFINE_OPERATOR(OPER)        \
    186   template <typename T>              \
    187   inline sc_uint& operator OPER (T v)\
    188   { vf.valW OPER v; return *this; }
    189 
    190   DEFINE_OPERATOR(<<=)
    191   DEFINE_OPERATOR(>>=)
    192   DEFINE_OPERATOR(+=)
    193   DEFINE_OPERATOR(-=)
    194   DEFINE_OPERATOR(*=)
    195   DEFINE_OPERATOR(/=)
    196   DEFINE_OPERATOR(%=)
    197   DEFINE_OPERATOR(&=)
    198   DEFINE_OPERATOR(|=)
    199   DEFINE_OPERATOR(^=)
    200 #undef DEFINE_OPERATOR
    201 
    202 #if 0
    203 #define DEFINE_OPERATOR(OPER)                                              \
    204   friend bool operator OPER (const data_type& a, const data_type& b);
    205 //  { return (a.valW) OPER (b.valW); }
    206 
    207   DEFINE_OPERATOR(==)
    208   DEFINE_OPERATOR(!=)
    209   DEFINE_OPERATOR(>=)
    210   DEFINE_OPERATOR(<=)
    211 #undef DEFINE_OPERATOR
    212 #endif
     185  template <typename T>
     186  inline sc_uint& operator <<= (T v)
     187  { vf.valW <<= v; return *this; }
     188  template <typename T>
     189  inline sc_uint& operator >>= (T v)
     190  { vf.valW >>= v; return *this; }
     191  template <typename T>
     192  inline sc_uint& operator += (T v)
     193  { vf.valW += v; return *this; }
     194  template <typename T>
     195  inline sc_uint& operator -= (T v)
     196  { vf.valW -= v; return *this; }
     197  template <typename T>
     198  inline sc_uint& operator *= (T v)
     199  { vf.valW *= v; return *this; }
     200  template <typename T>
     201  inline sc_uint& operator /= (T v)
     202  { vf.valW /= v; return *this; }
     203  template <typename T>
     204  inline sc_uint& operator %= (T v)
     205  { vf.valW %= v; return *this; }
     206  template <typename T>
     207  inline sc_uint& operator &= (T v)
     208  { vf.valW &= v; return *this; }
     209  template <typename T>
     210  inline sc_uint& operator |= (T v)
     211  { vf.valW |= v; return *this; }
     212  template <typename T>
     213  inline sc_uint& operator ^= (T v)
     214  { vf.valW ^= v; return *this; }
    213215  inline sc_uint_bit_ref operator [] (int v)
    214216  { return (vf.valW >> v) & 1; }
Note: See TracChangeset for help on using the changeset viewer.