Mercurial > hg > octave-lyh
changeset 7229:64d6f4dc37e0
[project @ 2007-11-30 17:09:55 by jwe]
author | jwe |
---|---|
date | Fri, 30 Nov 2007 17:09:56 +0000 |
parents | 685c186d8f62 |
children | a760bd2630d5 |
files | src/ChangeLog src/DLD-FUNCTIONS/typecast.cc |
diffstat | 2 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -6,6 +6,8 @@ * OPERATORS/op-sbm-sbm.cc (DEFDBLCONVFN): Delete useless macro invocation. + * DLD-FUNCTIONS/typecast.cc (typecast): No longer static. + 2007-11-30 John W. Eaton <jwe@octave.org> * graphics.cc (updating_axis_limits): New static variable.
--- a/src/DLD-FUNCTIONS/typecast.cc +++ b/src/DLD-FUNCTIONS/typecast.cc @@ -30,7 +30,7 @@ #include "oct.h" template <class LT, class RT> -static void +/* static */ void typecast (const Array<RT>& x, Array<LT>& y) { octave_idx_type n = x.length (); @@ -38,7 +38,7 @@ size_t ms = sizeof (LT); if (n * ns % ms != 0) - error ("typecast: incorrect number of input values to make output value"); + error ("typecast: incorrect number of input values to make output value"); else { octave_idx_type m = n * ns / ms; @@ -50,8 +50,8 @@ break; } y.resize (dv); - const unsigned char *xp = reinterpret_cast<const unsigned char *> - (x.fortran_vec ()); + const unsigned char *xp + = reinterpret_cast<const unsigned char *> (x.fortran_vec ()); unsigned char *yp = reinterpret_cast<unsigned char *>(y.fortran_vec ()); for (octave_idx_type i = 0; i < n * static_cast<octave_idx_type>(ns); i++) @@ -157,11 +157,11 @@ if (type == "single") error ("typecast: type 'single' is not supported"); - else if (type != "uint8" && type != "uint16" && - type != "uint32" && type != "uint64" && - type != "int8" && type != "int16" && - type != "int32" && type != "int64" && - type != "single" && type != "double") + else if (type != "uint8" && type != "uint16" + && type != "uint32" && type != "uint64" + && type != "int8" && type != "int16" + && type != "int32" && type != "int64" + && type != "single" && type != "double") error ("typecast: unrecognized or invalid type"); else if (args(0).is_sparse_type () || args(0).is_complex_type ()) error ("typecast: sparse and complex types are invalid");