changeset 5941:117052c2b53c

[project @ 2006-08-18 18:05:20 by jwe]
author jwe
date Fri, 18 Aug 2006 18:05:20 +0000
parents 0dd8428bb260
children a02a305e06ee
files src/ChangeLog src/ls-mat5.cc
diffstat 2 files changed, 17 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Fri Aug 18 17:50:23 2006 +0000
+++ b/src/ChangeLog	Fri Aug 18 18:05:20 2006 +0000
@@ -1,3 +1,8 @@
+2006-08-18  Benjamin Lindner  <lindnerben@gmx.net>
+
+	* ls-mat5.cc (read_mat5_tag): Declare type as int32_t, not int.
+	(read_mat5_binary_element): Likewise, for len and element_length.
+
 2006-08-18  John W. Eaton  <jwe@octave.org>
 
 	* load-save.h (enum load_save_format): New element, LS_MAT_ASCII_LONG.
--- a/src/ls-mat5.cc	Fri Aug 18 17:50:23 2006 +0000
+++ b/src/ls-mat5.cc	Fri Aug 18 18:05:20 2006 +0000
@@ -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