Mercurial > octave
diff src/ov-cx-sparse.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 |
line wrap: on
line diff
--- a/src/ov-cx-sparse.cc Thu Apr 13 13:04:33 2006 +0000 +++ b/src/ov-cx-sparse.cc Fri Apr 14 04:01:40 2006 +0000 @@ -216,16 +216,16 @@ FOUR_BYTE_INT itmp; // Use negative value for ndims to be consistent with other formats itmp= -2; - os.write (X_CAST (char *, &itmp), 4); + os.write (reinterpret_cast<char *> (&itmp), 4); itmp= nr; - os.write (X_CAST (char *, &itmp), 4); + os.write (reinterpret_cast<char *> (&itmp), 4); itmp= nc; - os.write (X_CAST (char *, &itmp), 4); + os.write (reinterpret_cast<char *> (&itmp), 4); itmp= nz; - os.write (X_CAST (char *, &itmp), 4); + os.write (reinterpret_cast<char *> (&itmp), 4); save_type st = LS_DOUBLE; if (save_as_floats) @@ -251,17 +251,17 @@ { OCTAVE_QUIT; itmp = matrix.cidx(i); - os.write (X_CAST (char *, &itmp), 4); + os.write (reinterpret_cast<char *> (&itmp), 4); } for (int i = 0; i < nz; i++) { OCTAVE_QUIT; itmp = matrix.ridx(i); - os.write (X_CAST (char *, &itmp), 4); + os.write (reinterpret_cast<char *> (&itmp), 4); } - write_doubles (os, X_CAST (const double *, matrix.data()), st, 2 * nz); + write_doubles (os, reinterpret_cast<const double *> (matrix.data()), st, 2 * nz); return true; } @@ -273,7 +273,7 @@ FOUR_BYTE_INT nz, nc, nr, tmp; char ctmp; - if (! is.read (X_CAST (char *, &tmp), 4)) + if (! is.read (reinterpret_cast<char *> (&tmp), 4)) return false; if (swap) @@ -284,11 +284,11 @@ return false; } - if (! is.read (X_CAST (char *, &nr), 4)) + if (! is.read (reinterpret_cast<char *> (&nr), 4)) return false; - if (! is.read (X_CAST (char *, &nc), 4)) + if (! is.read (reinterpret_cast<char *> (&nc), 4)) return false; - if (! is.read (X_CAST (char *, &nz), 4)) + if (! is.read (reinterpret_cast<char *> (&nz), 4)) return false; if (swap) @@ -305,7 +305,7 @@ for (int i = 0; i < nc+1; i++) { OCTAVE_QUIT; - if (! is.read (X_CAST (char *, &tmp), 4)) + if (! is.read (reinterpret_cast<char *> (&tmp), 4)) return false; if (swap) swap_bytes<4> (&tmp); @@ -315,18 +315,18 @@ for (int i = 0; i < nz; i++) { OCTAVE_QUIT; - if (! is.read (X_CAST (char *, &tmp), 4)) + if (! is.read (reinterpret_cast<char *> (&tmp), 4)) return false; if (swap) swap_bytes<4> (&tmp); m.ridx(i) = tmp; } - if (! is.read (X_CAST (char *, &ctmp), 1)) + if (! is.read (reinterpret_cast<char *> (&ctmp), 1)) return false; - read_doubles (is, X_CAST(double *, m.data()), X_CAST (save_type, ctmp), - 2 * nz, swap, fmt); + read_doubles (is, reinterpret_cast<double *> (m.data ()), + static_cast<save_type> (ctmp), 2 * nz, swap, fmt); if (error_state || ! is) return false; @@ -358,7 +358,7 @@ octave_idx_type tmp; hsize_t hdims[2]; - space_hid = H5Screate_simple (0, hdims, (hsize_t*) 0); + space_hid = H5Screate_simple (0, hdims, 0); if (space_hid < 0) { H5Gclose (group_hid); @@ -376,7 +376,7 @@ tmp = m.rows (); retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void*) &tmp) >= 0; + H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -396,7 +396,7 @@ tmp = m.cols (); retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void*) &tmp) >= 0; + H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -416,7 +416,7 @@ tmp = m.nzmax (); retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void*) &tmp) >= 0; + H5P_DEFAULT, &tmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -449,7 +449,7 @@ octave_idx_type * itmp = m.xcidx (); retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void*) itmp) >= 0; + H5P_DEFAULT, itmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -481,8 +481,7 @@ } itmp = m.xridx (); - retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void*) itmp) >= 0; + retval = H5Dwrite (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) >= 0; H5Dclose (data_hid); if (!retval) { @@ -523,8 +522,7 @@ return false; } - data_hid = H5Dcreate (group_hid, "data", type_hid, space_hid, - H5P_DEFAULT); + data_hid = H5Dcreate (group_hid, "data", type_hid, space_hid, H5P_DEFAULT); if (data_hid < 0) { H5Sclose (space_hid); @@ -540,7 +538,7 @@ Complex * ctmp = m.xdata (); retval = H5Dwrite (data_hid, complex_type_hid, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void*) ctmp) >= 0; + H5P_DEFAULT, ctmp) >= 0; } H5Dclose (data_hid); @@ -580,8 +578,7 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void *) &nr) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nr) < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -601,8 +598,7 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void *) &nc) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nc) < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -622,8 +618,7 @@ return false; } - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void *) &nz) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, &nz) < 0) { H5Dclose (data_hid); H5Gclose (group_hid); @@ -663,8 +658,7 @@ } octave_idx_type *itmp = m.xcidx (); - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void *) itmp) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) < 0) { H5Sclose (space_hid); H5Dclose (data_hid); @@ -699,8 +693,7 @@ } itmp = m.xridx (); - if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, - H5P_DEFAULT, (void *) itmp) < 0) + if (H5Dread (data_hid, H5T_NATIVE_IDX, H5S_ALL, H5S_ALL, H5P_DEFAULT, itmp) < 0) { H5Sclose (space_hid); H5Dclose (data_hid); @@ -748,8 +741,7 @@ Complex *ctmp = m.xdata (); bool retval = false; - if (H5Dread (data_hid, complex_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, - (void *) ctmp) >= 0) + if (H5Dread (data_hid, complex_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, ctmp) >= 0) { retval = true; matrix = m;