Mercurial > hg > octave-nkf
diff src/ls-mat5.cc @ 5941:117052c2b53c
[project @ 2006-08-18 18:05:20 by jwe]
author | jwe |
---|---|
date | Fri, 18 Aug 2006 18:05:20 +0000 |
parents | 1bcd9dd629c3 |
children | c7105ffca0b6 |
line wrap: on
line diff
--- a/src/ls-mat5.cc +++ b/src/ls-mat5.cc @@ -342,7 +342,7 @@ // place the type code in TYPE and the byte count in BYTES // return nonzero on error static int -read_mat5_tag (std::istream& is, bool swap, int& type, int& bytes) +read_mat5_tag (std::istream& is, bool swap, int32_t& type, int& bytes) { unsigned int upper; int32_t temp; @@ -404,15 +404,15 @@ // initialization of variable. oct_mach_info::float_format flt_fmt = oct_mach_info::flt_fmt_unknown; - int type = 0; + int32_t type = 0; bool imag; bool logicalvar; enum arrayclasstype arrayclass; int32_t nzmax; int32_t flags; dim_vector dims; - int len; - int element_length; + int32_t len; + int32_t element_length; std::streampos pos; int16_t number; number = *(int16_t *)"\x00\x01"; @@ -1646,8 +1646,10 @@ SparseComplexMatrix m = tc.sparse_complex_matrix_value (); int nc = m.cols (); - write_mat5_integer_data (os, m.ridx (), - sizeof(int), nnz); - write_mat5_integer_data (os, m.cidx (), - sizeof(int), nc + 1); + int tmp = sizeof (int); + + write_mat5_integer_data (os, m.ridx (), -tmp, nnz); + write_mat5_integer_data (os, m.cidx (), -tmp, nc + 1); NDArray buf (dim_vector (nnz, 1)); @@ -1666,8 +1668,10 @@ SparseMatrix m = tc.sparse_matrix_value (); int nc = m.cols (); - write_mat5_integer_data (os, m.ridx (), - sizeof(int), nnz); - write_mat5_integer_data (os, m.cidx (), - sizeof(int), nc + 1); + int tmp = sizeof (int); + + write_mat5_integer_data (os, m.ridx (), -tmp, nnz); + write_mat5_integer_data (os, m.cidx (), -tmp, nc + 1); // FIXME // Is there a way to easily do without this buffer