comparison src/ops.h @ 7997:2b8952e133c9

implement checked conversions between integers
author Jaroslav Hajek <highegg@gmail.com>
date Wed, 30 Jul 2008 15:20:13 +0200
parents 935be827eaf8
children 283989f2da9b
comparison
equal deleted inserted replaced
7996:6a7db240b3a3 7997:2b8952e133c9
205 CAST_CONV_ARG (const octave_ ## tfrom&); \ 205 CAST_CONV_ARG (const octave_ ## tfrom&); \
206 \ 206 \
207 return new octave_ ## ovtto (tto ## NDArray (v.e ## array_value ())); \ 207 return new octave_ ## ovtto (tto ## NDArray (v.e ## array_value ())); \
208 } 208 }
209 209
210 #define DEFCONVFNX2(name, tfrom, ovtto, e) \
211 CONVDECL (name) \
212 { \
213 CAST_CONV_ARG (const octave_ ## tfrom&); \
214 \
215 return new octave_ ## ovtto (v.e ## array_value ()); \
216 }
217
210 #define DEFDBLCONVFN(name, ovtfrom, e) \ 218 #define DEFDBLCONVFN(name, ovtfrom, e) \
211 CONVDECL (name) \ 219 CONVDECL (name) \
212 { \ 220 { \
213 CAST_CONV_ARG (const octave_ ## ovtfrom&); \ 221 CAST_CONV_ARG (const octave_ ## ovtfrom&); \
214 \ 222 \
220 228
221 #define DEFSTRDBLCONVFN(name, tfrom) \ 229 #define DEFSTRDBLCONVFN(name, tfrom) \
222 DEFCONVFNX(name, tfrom, matrix, , char_) 230 DEFCONVFNX(name, tfrom, matrix, , char_)
223 231
224 #define DEFCONVFN(name, tfrom, tto) \ 232 #define DEFCONVFN(name, tfrom, tto) \
225 DEFCONVFNX (name, tfrom, tto ## _matrix, tto, ) 233 DEFCONVFNX2 (name, tfrom, tto ## _matrix, tto ## _)
226 234
227 #define DEFCONVFN2(name, tfrom, sm, tto) \ 235 #define DEFCONVFN2(name, tfrom, sm, tto) \
228 DEFCONVFNX (name, tfrom ## _ ## sm, tto ## _matrix, tto, tfrom ## _) 236 DEFCONVFNX2 (name, tfrom ## _ ## sm, tto ## _matrix, tto ## _)
229 237
230 #define UNOPDECL(name, a) \ 238 #define UNOPDECL(name, a) \
231 static octave_value \ 239 static octave_value \
232 oct_unop_ ## name (const octave_base_value& a) 240 oct_unop_ ## name (const octave_base_value& a)
233 241