changeset 6008:0f5bc819fdb8

[project @ 2006-09-27 15:34:28 by jwe]
author jwe
date Wed, 27 Sep 2006 15:34:28 +0000
parents 52b520087c50
children 1f5d31edb459
files src/ChangeLog src/pr-output.cc
diffstat 2 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2006-09-27  John W. Eaton  <jwe@octave.org>
+
+	* pr-output.cc (abs): New template function.  Instantiate for
+	unsigned types.
+
 2006-09-27  David Bateman  <dbateman@free.fr>
 
 	* file-io.cc (Fsprintf): If fmt is an sq_string, return an sq_string.
--- a/src/pr-output.cc
+++ b/src/pr-output.cc
@@ -2206,6 +2206,20 @@
 }
 
 template <class T>
+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 <class T>
 void
 octave_print_internal (std::ostream& os, const intNDArray<T>& nda,
 		       bool pr_as_read_syntax, int extra_indent)