changeset 4907:102f199a9a9e

[project @ 2004-06-25 22:10:07 by jwe]
author jwe
date Fri, 25 Jun 2004 22:10:36 +0000
parents 6754342ef7ad
children 66af4b9f451e
files src/ChangeLog src/OPERATORS/op-int-conv.cc
diffstat 2 files changed, 30 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Wed Jun 23 11:11:51 2004 +0000
+++ b/src/ChangeLog	Fri Jun 25 22:10:36 2004 +0000
@@ -1,3 +1,7 @@
+2004-06-25  John W. Eaton  <jwe@octave.org>
+
+	* OPERATORS/op-int-conv.cc: Add conversions for range type.
+
 2004-06-17  John W. Eaton  <jwe@octave.org>
 
 	* bitfcns.cc (bitfcns): New file.
--- a/src/OPERATORS/op-int-conv.cc	Wed Jun 23 11:11:51 2004 +0000
+++ b/src/OPERATORS/op-int-conv.cc	Fri Jun 25 22:10:36 2004 +0000
@@ -39,6 +39,7 @@
 #include "ov-uint16.h"
 #include "ov-uint32.h"
 #include "ov-uint64.h"
+#include "ov-range.h"
 #include "ov-scalar.h"
 #include "ov-re-mat.h"
 #include "ov-typeinfo.h"
@@ -66,6 +67,16 @@
 DEFCONVFN (matrix_to_uint32, matrix, uint32)
 DEFCONVFN (matrix_to_uint64, matrix, uint64)
 
+DEFCONVFN (range_to_int8, range, int8)
+DEFCONVFN (range_to_int16, range, int16)
+DEFCONVFN (range_to_int32, range, int32)
+DEFCONVFN (range_to_int64, range, int64)
+
+DEFCONVFN (range_to_uint8, range, uint8)
+DEFCONVFN (range_to_uint16, range, uint16)
+DEFCONVFN (range_to_uint32, range, uint32)
+DEFCONVFN (range_to_uint64, range, uint64)
+
 #define INT_CONV_FUNCTIONS(tfrom) \
   DEFCONVFN2 (tfrom ## _scalar_to_int8, tfrom, scalar, int8) \
   DEFCONVFN2 (tfrom ## _scalar_to_int16, tfrom, scalar, int16) \
@@ -116,30 +127,25 @@
   INSTALL_CONVOP (octave_ ## tfrom ## _matrix, octave_uint8_matrix, tfrom ## _matrix_to_uint8) \
   INSTALL_CONVOP (octave_ ## tfrom ## _matrix, octave_uint16_matrix, tfrom ## _matrix_to_uint16) \
   INSTALL_CONVOP (octave_ ## tfrom ## _matrix, octave_uint32_matrix, tfrom ## _matrix_to_uint32) \
-  INSTALL_CONVOP (octave_ ## tfrom ## _matrix, octave_uint64_matrix, tfrom ## _matrix_to_uint64) \
+  INSTALL_CONVOP (octave_ ## tfrom ## _matrix, octave_uint64_matrix, tfrom ## _matrix_to_uint64)
+
+#define INSTALL_CONVOPS(tfrom) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_int8_matrix, tfrom ## _to_int8) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_int16_matrix, tfrom ## _to_int16) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_int32_matrix, tfrom ## _to_int32) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_int64_matrix, tfrom ## _to_int64) \
+ \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_uint8_matrix, tfrom ## _to_uint8) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_uint16_matrix, tfrom ## _to_uint16) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_uint32_matrix, tfrom ## _to_uint32) \
+  INSTALL_CONVOP (octave_ ## tfrom, octave_uint64_matrix, tfrom ## _to_uint64)
 
 void
 install_int_conv_ops (void)
 {
-  INSTALL_CONVOP (octave_scalar, octave_int8_matrix, scalar_to_int8);
-  INSTALL_CONVOP (octave_scalar, octave_int16_matrix, scalar_to_int16);
-  INSTALL_CONVOP (octave_scalar, octave_int32_matrix, scalar_to_int32);
-  INSTALL_CONVOP (octave_scalar, octave_int64_matrix, scalar_to_int64);
-
-  INSTALL_CONVOP (octave_scalar, octave_uint8_matrix, scalar_to_uint8);
-  INSTALL_CONVOP (octave_scalar, octave_uint16_matrix, scalar_to_uint16);
-  INSTALL_CONVOP (octave_scalar, octave_uint32_matrix, scalar_to_uint32);
-  INSTALL_CONVOP (octave_scalar, octave_uint64_matrix, scalar_to_uint64);
-
-  INSTALL_CONVOP (octave_matrix, octave_int8_matrix, matrix_to_int8);
-  INSTALL_CONVOP (octave_matrix, octave_int16_matrix, matrix_to_int16);
-  INSTALL_CONVOP (octave_matrix, octave_int32_matrix, matrix_to_int32);
-  INSTALL_CONVOP (octave_matrix, octave_int64_matrix, matrix_to_int64);
-
-  INSTALL_CONVOP (octave_matrix, octave_uint8_matrix, matrix_to_uint8);
-  INSTALL_CONVOP (octave_matrix, octave_uint16_matrix, matrix_to_uint16);
-  INSTALL_CONVOP (octave_matrix, octave_uint32_matrix, matrix_to_uint32);
-  INSTALL_CONVOP (octave_matrix, octave_uint64_matrix, matrix_to_uint64);
+  INSTALL_CONVOPS (scalar)
+  INSTALL_CONVOPS (matrix)
+  INSTALL_CONVOPS (range)
 
   INSTALL_INT_CONV_FUNCTIONS (int8)
   INSTALL_INT_CONV_FUNCTIONS (int16)