comparison src/ov-struct.cc @ 5760:8d7162924bd3

[project @ 2006-04-14 04:01:37 by jwe]
author jwe
date Fri, 14 Apr 2006 04:01:40 +0000
parents ce79d238f142
children ace8d8d26933
comparison
equal deleted inserted replaced
5759:ce79d238f142 5760:8d7162924bd3
1106 octave_struct::save_binary (std::ostream& os, bool& save_as_floats) 1106 octave_struct::save_binary (std::ostream& os, bool& save_as_floats)
1107 { 1107 {
1108 Octave_map m = map_value (); 1108 Octave_map m = map_value ();
1109 1109
1110 FOUR_BYTE_INT len = m.length(); 1110 FOUR_BYTE_INT len = m.length();
1111 os.write (X_CAST (char *, &len), 4); 1111 os.write (reinterpret_cast<char *> (&len), 4);
1112 1112
1113 Octave_map::iterator i = m.begin (); 1113 Octave_map::iterator i = m.begin ();
1114 while (i != m.end ()) 1114 while (i != m.end ())
1115 { 1115 {
1116 octave_value val = map.contents (i); 1116 octave_value val = map.contents (i);
1126 return true; 1126 return true;
1127 } 1127 }
1128 1128
1129 bool 1129 bool
1130 octave_struct::load_binary (std::istream& is, bool swap, 1130 octave_struct::load_binary (std::istream& is, bool swap,
1131 oct_mach_info::float_format fmt) 1131 oct_mach_info::float_format fmt)
1132 { 1132 {
1133 bool success = true; 1133 bool success = true;
1134 FOUR_BYTE_INT len; 1134 FOUR_BYTE_INT len;
1135 if (! is.read (X_CAST (char *, &len), 4)) 1135 if (! is.read (reinterpret_cast<char *> (&len), 4))
1136 return false; 1136 return false;
1137 if (swap) 1137 if (swap)
1138 swap_bytes<4> (&len); 1138 swap_bytes<4> (&len);
1139 1139
1140 if (len > 0) 1140 if (len > 0)