Changeset 1106 for to-imperative/trunk/runtime/rf_short_int.cc
- Timestamp:
- Aug 6, 2003, 5:30:09 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
to-imperative/trunk/runtime/rf_short_int.cc
r866 r1106 14 14 { 15 15 16 unsigned ShortInt::compute_max_len ()16 unsigned Int32::compute_max_len () 17 17 { 18 18 intptr_t i = INTPTR_MAX / 10000; … … 22 22 } 23 23 24 const unsigned ShortInt::max_len = compute_max_len();24 const unsigned Int32::max_len = compute_max_len(); 25 25 26 Expr ShortInt::create_expr (intptr_t _n)26 Expr Int32::create_expr (intptr_t _n) 27 27 { 28 28 Expr e = Term::create_expr(1); 29 new(e.get_first()) ShortInt(_n);29 new(e.get_first()) Int32(_n); 30 30 return e; 31 31 } 32 32 33 33 34 Expr ShortInt::create_expr (pxx::WString& _str) {34 Expr Int32::create_expr (pxx::WString& _str) { 35 35 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)); 37 37 } 38 38 … … 109 109 #endif 110 110 111 void ShortInt::ctor (ShortInt* _to, ShortIntconst* _from)111 void Int32::ctor (Int32* _to, Int32 const* _from) 112 112 { 113 113 _to->data1 = _from->data1; … … 115 115 } 116 116 117 int ShortInt::compare (ShortInt const* _shint1, ShortIntconst* _shint2)117 int Int32::compare (Int32 const* _shint1, Int32 const* _shint2) 118 118 { 119 119 if (_shint1->int_data2 == _shint2->int_data2) return 0; … … 122 122 } 123 123 124 uint32_t ShortInt::hash (ShortIntconst* _shint)124 uint32_t Int32::hash (Int32 const* _shint) 125 125 { 126 126 return _shint->uint_data2; 127 127 } 128 128 129 pxx::WString ShortInt::to_string (ShortIntconst* _shint) {129 pxx::WString Int32::to_string (Int32 const* _shint) { 130 130 intptr_t n = _shint->int_data2; 131 131 int flag = 0; … … 158 158 } 159 159 160 short_type_funcs_t ShortInt::funcs = {161 (void (*)(Term*, Term const*))( ShortInt::ctor),160 short_type_funcs_t Int32::funcs = { 161 (void (*)(Term*, Term const*))(Int32::ctor), 162 162 null, // ShortInt::dtor, 163 163 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) 167 167 }; 168 168
Note: See TracChangeset
for help on using the changeset viewer.