Mercurial > hg > octave-lyh
comparison src/ops.h @ 10313:f3b65e1ae355
untabify src header files
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 11 Feb 2010 12:16:43 -0500 |
parents | cd96d29c5efa |
children | 0de5cc44e690 |
comparison
equal
deleted
inserted
replaced
10312:cbc402e64d83 | 10313:f3b65e1ae355 |
---|---|
76 | 76 |
77 #define CAST_UNOP_ARG(t) \ | 77 #define CAST_UNOP_ARG(t) \ |
78 t v = dynamic_cast<t> (a) | 78 t v = dynamic_cast<t> (a) |
79 | 79 |
80 #define CAST_BINOP_ARGS(t1, t2) \ | 80 #define CAST_BINOP_ARGS(t1, t2) \ |
81 t1 v1 = dynamic_cast<t1> (a1); \ | 81 t1 v1 = dynamic_cast<t1> (a1); \ |
82 t2 v2 = dynamic_cast<t2> (a2) | 82 t2 v2 = dynamic_cast<t2> (a2) |
83 | 83 |
84 #define CAST_CONV_ARG(t) \ | 84 #define CAST_CONV_ARG(t) \ |
85 t v = dynamic_cast<t> (a) | 85 t v = dynamic_cast<t> (a) |
86 | 86 |
87 #define ASSIGNOPDECL(name) \ | 87 #define ASSIGNOPDECL(name) \ |
88 static octave_value \ | 88 static octave_value \ |
89 CONCAT2(oct_assignop_, name) (octave_base_value& a1, \ | 89 CONCAT2(oct_assignop_, name) (octave_base_value& a1, \ |
90 const octave_value_list& idx, \ | 90 const octave_value_list& idx, \ |
91 const octave_base_value& a2) | 91 const octave_base_value& a2) |
92 | 92 |
93 #define NULLASSIGNOPDECL(name) \ | 93 #define NULLASSIGNOPDECL(name) \ |
94 static octave_value \ | 94 static octave_value \ |
95 CONCAT2(oct_assignop_, name) (octave_base_value& a, \ | 95 CONCAT2(oct_assignop_, name) (octave_base_value& a, \ |
96 const octave_value_list& idx, \ | 96 const octave_value_list& idx, \ |
97 const octave_base_value&) | 97 const octave_base_value&) |
98 | 98 |
99 #define ASSIGNANYOPDECL(name) \ | 99 #define ASSIGNANYOPDECL(name) \ |
100 static octave_value \ | 100 static octave_value \ |
101 CONCAT2(oct_assignop_, name) (octave_base_value& a1, \ | 101 CONCAT2(oct_assignop_, name) (octave_base_value& a1, \ |
102 const octave_value_list& idx, \ | 102 const octave_value_list& idx, \ |
103 const octave_value& a2) | 103 const octave_value& a2) |
104 | 104 |
105 #define DEFASSIGNOP(name, t1, t2) \ | 105 #define DEFASSIGNOP(name, t1, t2) \ |
106 ASSIGNOPDECL (name) | 106 ASSIGNOPDECL (name) |
107 | 107 |
108 #define DEFASSIGNOP_FN(name, t1, t2, f) \ | 108 #define DEFASSIGNOP_FN(name, t1, t2, f) \ |
342 return octave_value (f (v1.CONCAT2(e1, _value) (), v2.CONCAT2(e2, _value) ())); \ | 342 return octave_value (f (v1.CONCAT2(e1, _value) (), v2.CONCAT2(e2, _value) ())); \ |
343 } | 343 } |
344 | 344 |
345 #define BINOP_NONCONFORMANT(msg) \ | 345 #define BINOP_NONCONFORMANT(msg) \ |
346 gripe_nonconformant (msg, \ | 346 gripe_nonconformant (msg, \ |
347 a1.rows (), a1.columns (), \ | 347 a1.rows (), a1.columns (), \ |
348 a2.rows (), a2.columns ()); \ | 348 a2.rows (), a2.columns ()); \ |
349 return octave_value () | 349 return octave_value () |
350 | 350 |
351 #define CATOPDECL(name, a1, a2) \ | 351 #define CATOPDECL(name, a1, a2) \ |
352 static octave_value \ | 352 static octave_value \ |
353 CONCAT2(oct_catop_, name) (octave_base_value& a1, const octave_base_value& a2, \ | 353 CONCAT2(oct_catop_, name) (octave_base_value& a1, const octave_base_value& a2, \ |
354 const Array<octave_idx_type>& ra_idx) | 354 const Array<octave_idx_type>& ra_idx) |
355 | 355 |
356 #define DEFCATOPX(name, t1, t2) \ | 356 #define DEFCATOPX(name, t1, t2) \ |
357 CATOPDECL (name, , ) | 357 CATOPDECL (name, , ) |
358 | 358 |
359 #define DEFCATOP(name, t1, t2) \ | 359 #define DEFCATOP(name, t1, t2) \ |
360 CATOPDECL (name, a1, a2) | 360 CATOPDECL (name, a1, a2) |
361 | 361 |
362 // FIXME -- in some cases, the constructor isn't necessary. | 362 // FIXME -- in some cases, the constructor isn't necessary. |
363 | 363 |
364 #define DEFCATOP_FN(name, t1, t2, f) \ | 364 #define DEFCATOP_FN(name, t1, t2, f) \ |
379 CATOPDECL (name, a1, a2) \ | 379 CATOPDECL (name, a1, a2) \ |
380 { \ | 380 { \ |
381 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ | 381 CAST_BINOP_ARGS (CONCAT2(octave_, t1)&, const CONCAT2(octave_, t2)&); \ |
382 \ | 382 \ |
383 return octave_value (v1.char_array_value () . f (v2.char_array_value (), ra_idx), \ | 383 return octave_value (v1.char_array_value () . f (v2.char_array_value (), ra_idx), \ |
384 ((a1.is_sq_string () || a2.is_sq_string ()) \ | 384 ((a1.is_sq_string () || a2.is_sq_string ()) \ |
385 ? '\'' : '"')); \ | 385 ? '\'' : '"')); \ |
386 } | 386 } |
387 | 387 |
388 // For compatibility, the second arg is always converted to the type | 388 // For compatibility, the second arg is always converted to the type |
389 // of the first. Hmm. | 389 // of the first. Hmm. |
390 | 390 |
395 return octave_value (tc1 (v1.CONCAT2(e1, _value) ()) . f (tc2 (v2.CONCAT2(e2, _value) ()), ra_idx)); \ | 395 return octave_value (tc1 (v1.CONCAT2(e1, _value) ()) . f (tc2 (v2.CONCAT2(e2, _value) ()), ra_idx)); \ |
396 } | 396 } |
397 | 397 |
398 #define CATOP_NONCONFORMANT(msg) \ | 398 #define CATOP_NONCONFORMANT(msg) \ |
399 gripe_nonconformant (msg, \ | 399 gripe_nonconformant (msg, \ |
400 a1.rows (), a1.columns (), \ | 400 a1.rows (), a1.columns (), \ |
401 a2.rows (), a2.columns ()); \ | 401 a2.rows (), a2.columns ()); \ |
402 return octave_value () | 402 return octave_value () |
403 | 403 |
404 #endif | 404 #endif |