Changeset 1106


Ignore:
Timestamp:
Aug 6, 2003, 5:30:09 PM (17 years ago)
Author:
luba
Message:
  • type_short_int is replaced by type_int32, class ShortInt? is renamed to Int32
Location:
to-imperative/trunk/runtime
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • to-imperative/trunk/runtime/rf_char.cc

    r835 r1106  
    2424  char const* saved_locale = null;
    2525  if (_locale != null) {
     26
    2627    saved_locale = setlocale(LC_CTYPE, null);
    2728    setlocale(LC_CTYPE, _locale);
     
    105106  uintptr_t temp;
    106107  for (; p < q; p++, r++) {
    107     temp = uintptr_t(((ShortInt*)p)->to_int());
     108    temp = uintptr_t(((Int32*)p)->to_int());
    108109    new(r) Char(temp);
    109110  };
     
    119120  Term* r = e.get_first();
    120121  for (; p < q; p++, r++) {
    121     new(r) ShortInt(((Char*)p)->uint_data2);
     122    new(r) Int32(((Char*)p)->uint_data2);
    122123  }
    123124  return e;
  • to-imperative/trunk/runtime/rf_core.cc

    r1066 r1106  
    9999TypeRegister rftype::ObjectRef::reg(&ObjectRef::funcs, type_object) ;
    100100TypeRegister rftype::Char::reg(&Char::funcs, type_char) ;
    101 TypeRegister rftype::ShortInt::reg(&ShortInt::funcs, type_short_int) ;
     101TypeRegister rftype::Int32::reg(&Int32::funcs, type_int32) ;
    102102TypeRegister rftype::Integer::reg(&Integer::funcs, type_int) ;
    103103TypeRegister rftype::Word::reg(&Word::funcs, type_word) ;
  • to-imperative/trunk/runtime/rf_expr.ih

    r991 r1106  
    843843        if (!write_wstr(_fp, ws)) return false;
    844844        if (!f) fputc('\"', _fp);
    845       } else if (p->get_type() == type_short_int) {
    846         if (fprintf(_fp, "%" PRIdPTR, ((ShortInt const&)(*p)).to_int()) == -1)
     845      } else if (p->get_type() == type_int32) {
     846        if (fprintf(_fp, "%" PRIdPTR, ((Int32 const&)(*p)).to_int()) == -1)
    847847          return false;
    848848      } else {
  • to-imperative/trunk/runtime/rf_short_int.cc

    r866 r1106  
    1414{
    1515
    16 unsigned ShortInt::compute_max_len ()
     16unsigned Int32::compute_max_len ()
    1717{
    1818  intptr_t i   = INTPTR_MAX / 10000;
     
    2222}
    2323
    24 const unsigned ShortInt::max_len = compute_max_len();
     24const unsigned Int32::max_len = compute_max_len();
    2525
    26 Expr ShortInt::create_expr (intptr_t _n)
     26Expr Int32::create_expr (intptr_t _n)
    2727{
    2828  Expr e = Term::create_expr(1);
    29   new(e.get_first()) ShortInt(_n);
     29  new(e.get_first()) Int32(_n);
    3030  return e;
    3131}
    3232
    3333
    34 Expr ShortInt::create_expr (pxx::WString& _str) {
     34Expr Int32::create_expr (pxx::WString& _str) {
    3535  wchar_t const* s = _str.get_data();
    36   return ShortInt::create_expr( wcstol(s, null, 10));
     36  return Int32::create_expr( wcstol(s, null, 10));
    3737}
    3838
     
    109109#endif
    110110
    111 void ShortInt::ctor (ShortInt* _to, ShortInt const* _from)
     111void Int32::ctor (Int32* _to, Int32 const* _from)
    112112{
    113113  _to->data1 = _from->data1;
     
    115115}
    116116
    117 int ShortInt::compare (ShortInt const* _shint1, ShortInt const* _shint2)
     117int Int32::compare (Int32 const* _shint1, Int32 const* _shint2)
    118118{
    119119  if (_shint1->int_data2 == _shint2->int_data2) return 0;
     
    122122}
    123123
    124 uint32_t ShortInt::hash (ShortInt const* _shint)
     124uint32_t Int32::hash (Int32 const* _shint)
    125125{
    126126  return _shint->uint_data2;
    127127}
    128128
    129 pxx::WString ShortInt::to_string (ShortInt const* _shint) {
     129pxx::WString Int32::to_string (Int32 const* _shint) {
    130130  intptr_t n = _shint->int_data2;
    131131  int flag = 0;
     
    158158}
    159159
    160 short_type_funcs_t ShortInt::funcs = {
    161   (void (*)(Term*, Term const*))(ShortInt::ctor),
     160short_type_funcs_t Int32::funcs = {
     161  (void (*)(Term*, Term const*))(Int32::ctor),
    162162  null, // ShortInt::dtor,
    163163  null, // ShortInt::eq,
    164   (int (*)(Term const*, Term const*))(ShortInt::compare),
    165   (uint32_t (*)(Term const*))(ShortInt::hash),
    166   (pxx::WString (*)(Term const*))(ShortInt::to_string)
     164  (int (*)(Term const*, Term const*))(Int32::compare),
     165  (uint32_t (*)(Term const*))(Int32::hash),
     166  (pxx::WString (*)(Term const*))(Int32::to_string)
    167167};
    168168
  • to-imperative/trunk/runtime/rf_short_int.hh

    r835 r1106  
    1616using namespace rfrt;
    1717
    18 class ShortInt :
     18class Int32 :
    1919  public Term
    2020{
     
    3030  static Expr create_expr (pxx::WString& _str);
    3131
    32   inline ShortInt (intptr_t n) ;
     32  inline Int32 (intptr_t n) ;
    3333  inline intptr_t to_int () const ;
    3434
    3535  inline size_t get_char_len () const ;
    3636
    37   static void ctor (ShortInt* _to, ShortInt const* _from) ;
    38   static int compare (ShortInt const* _shint1, ShortInt const* _shint2) ;
    39   static uint32_t hash (ShortInt const* _shint) ;
    40   static pxx::WString to_string (ShortInt const* _shint) ;
     37  static void ctor (Int32* _to, Int32 const* _from) ;
     38  static int compare (Int32 const* _shint1, Int32 const* _shint2) ;
     39  static uint32_t hash (Int32 const* _shint) ;
     40  static pxx::WString to_string (Int32 const* _shint) ;
    4141  static short_type_funcs_t funcs ;
    4242  static TypeRegister reg ;
     
    4545
    4646}
    47 //  static Expr create_expr (Expr& _expr, int _flag);
    4847
    4948#endif // __rf_short_int_hh__
  • to-imperative/trunk/runtime/rf_short_int.ih

    r838 r1106  
    1515using namespace rfrt;
    1616
    17 inline ShortInt::ShortInt(intptr_t _n) :
    18   Term(type_short_int)
     17inline Int32::Int32(intptr_t _n) :
     18  Term(type_int32)
    1919{
    2020  int_data2 = _n;
    2121}
    2222
    23 inline intptr_t ShortInt::to_int() const
     23inline intptr_t Int32::to_int() const
    2424{
    2525  return int_data2;
    2626}
    2727
    28 inline size_t ShortInt::get_char_len() const
     28inline size_t Int32::get_char_len() const
    2929{
    3030  intptr_t n = int_data2;
Note: See TracChangeset for help on using the changeset viewer.