Mercurial > hg > octave-lyh
diff src/ls-mat5.cc @ 4944:44046bbaa52c
[project @ 2004-08-31 05:30:46 by jwe]
author | jwe |
---|---|
date | Tue, 31 Aug 2004 05:30:47 +0000 |
parents | e44d0ac643a5 |
children | 11bea7392e69 |
line wrap: on
line diff
--- a/src/ls-mat5.cc +++ b/src/ls-mat5.cc @@ -172,7 +172,7 @@ goto data_read_error; if (swap) - swap_4_bytes ((char *)&temp); + swap_bytes<4> (&temp); upper = (temp >> 16) & 0xffff; type = temp & 0xffff; @@ -187,7 +187,7 @@ if (! is.read (X_CAST (char *, &temp), 4 )) goto data_read_error; if (swap) - swap_4_bytes ((char *)&temp); + swap_bytes<4> (&temp); bytes = temp; } @@ -197,6 +197,15 @@ return 1; } +static void +read_int (std::istream& is, bool swap, FOUR_BYTE_INT& val) +{ + is.read (reinterpret_cast<char *> (&val), 4); + + if (swap) + swap_bytes<4> (&val); +} + // Extract one data element (scalar, matrix, string, etc.) from stream // IS and place it in TC, returning the name of the variable. // @@ -378,7 +387,7 @@ goto data_read_error; if (swap) - swap_4_bytes ((char *)&field_name_length); + swap_bytes<4> (&field_name_length); // field name subelement. The length of this subelement tells // us how many fields there are.