# HG changeset patch # User jwe # Date 1159371268 0 # Node ID 0f5bc819fdb860d7be9eacdb7d60d84da8ca67d0 # Parent 52b520087c5048375a548766bb60705a26afbb64 [project @ 2006-09-27 15:34:28 by jwe] diff -r 52b520087c50 -r 0f5bc819fdb8 src/ChangeLog --- a/src/ChangeLog Wed Sep 27 15:05:54 2006 +0000 +++ b/src/ChangeLog Wed Sep 27 15:34:28 2006 +0000 @@ -1,3 +1,8 @@ +2006-09-27 John W. Eaton + + * pr-output.cc (abs): New template function. Instantiate for + unsigned types. + 2006-09-27 David Bateman * file-io.cc (Fsprintf): If fmt is an sq_string, return an sq_string. diff -r 52b520087c50 -r 0f5bc819fdb8 src/pr-output.cc --- a/src/pr-output.cc Wed Sep 27 15:05:54 2006 +0000 +++ b/src/pr-output.cc Wed Sep 27 15:34:28 2006 +0000 @@ -2206,6 +2206,20 @@ } template +static inline T +abs (T x) +{ + return x; +} + +#define INSTANTIATE_ABS(T) template static inline T abs (T x) + +INSTANTIATE_ABS (unsigned int); +INSTANTIATE_ABS (unsigned short); +INSTANTIATE_ABS (unsigned long); +INSTANTIATE_ABS (unsigned long long); + +template void octave_print_internal (std::ostream& os, const intNDArray& nda, bool pr_as_read_syntax, int extra_indent)