diff src/ops.h @ 5075:b6a9f78f60e9

[project @ 2004-11-10 03:13:26 by jwe]
author jwe
date Wed, 10 Nov 2004 03:13:27 +0000
parents e71be9c548f2
children 23b37da9fd5b
line wrap: on
line diff
--- a/src/ops.h	Tue Nov 09 19:41:46 2004 +0000
+++ b/src/ops.h	Wed Nov 10 03:13:27 2004 +0000
@@ -330,19 +330,29 @@
 // XXX FIXME XXX -- in some cases, the constructor isn't necessary.
 
 #define DEFCATOP_FN(name, t1, t2, f) \
-  CATOPDECL (name, a1, a2)	     \
+  CATOPDECL (name, a1, a2) \
   { \
     CAST_BINOP_ARGS (octave_ ## t1&, const octave_ ## t2&); \
     return octave_value (v1.t1 ## _value (). f (v2.t2 ## _value (), ra_idx)); \
   }
 
-#define DEFNDCATOP_FN(name, t1, t2, e1, e2, f)	\
-  CATOPDECL (name, a1, a2)			\
+#define DEFNDCATOP_FN(name, t1, t2, e1, e2, f) \
+  CATOPDECL (name, a1, a2) \
   { \
     CAST_BINOP_ARGS (octave_ ## t1&, const octave_ ## t2&); \
     return octave_value (v1.e1 ## _value (). f (v2.e2 ## _value (), ra_idx)); \
   }
 
+// For compatibility, the second arg is always converted to the type
+// of the first.  Hmm.
+
+#define DEFNDCATOP_FN2(name, t1, t2, tc1, tc2, e1, e2, f) \
+  CATOPDECL (name, a1, a2) \
+  { \
+    CAST_BINOP_ARGS (octave_ ## t1&, const octave_ ## t2&); \
+    return octave_value (tc1 (v1.e1 ## _value ()) . f (tc2 (v2.e2 ## _value ()), ra_idx)); \
+  }
+
 #define CATOP_NONCONFORMANT(msg) \
   gripe_nonconformant (msg, \
 		       a1.rows (), a1.columns (), \