|
@ -146,34 +146,32 @@ namespace cln { |
|
|
// Constructors and assignment operators from C numeric types. |
|
|
// Constructors and assignment operators from C numeric types. |
|
|
|
|
|
|
|
|
// from `float': |
|
|
// from `float': |
|
|
union ffloatjanus; |
|
|
|
|
|
extern cl_private_thing cl_float_to_FF_pointer (const union ffloatjanus& val); |
|
|
|
|
|
|
|
|
extern cl_private_thing cl_float_to_FF_pointer (const float val); |
|
|
|
|
|
|
|
|
#define CL_DEFINE_FLOAT_CONSTRUCTOR(_class_) \ |
|
|
#define CL_DEFINE_FLOAT_CONSTRUCTOR(_class_) \ |
|
|
inline _class_ :: _class_ (const float x) \ |
|
|
inline _class_ :: _class_ (const float x) \ |
|
|
{ \ |
|
|
{ \ |
|
|
pointer = cl_float_to_FF_pointer(*(const union ffloatjanus *)&x); \ |
|
|
|
|
|
|
|
|
pointer = cl_float_to_FF_pointer(x); \ |
|
|
} \ |
|
|
} \ |
|
|
inline _class_& _class_::operator= (const float x) \ |
|
|
inline _class_& _class_::operator= (const float x) \ |
|
|
{ \ |
|
|
{ \ |
|
|
cl_dec_refcount(*this); \ |
|
|
cl_dec_refcount(*this); \ |
|
|
pointer = cl_float_to_FF_pointer(*(const union ffloatjanus *)&x); \ |
|
|
|
|
|
|
|
|
pointer = cl_float_to_FF_pointer(x); \ |
|
|
return *this; \ |
|
|
return *this; \ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// from `double': |
|
|
// from `double': |
|
|
union dfloatjanus; |
|
|
|
|
|
extern struct cl_heap_dfloat * cl_double_to_DF_pointer (const union dfloatjanus& val); |
|
|
|
|
|
|
|
|
extern struct cl_heap_dfloat * cl_double_to_DF_pointer (const double val); |
|
|
|
|
|
|
|
|
#define CL_DEFINE_DOUBLE_CONSTRUCTOR(_class_) \ |
|
|
#define CL_DEFINE_DOUBLE_CONSTRUCTOR(_class_) \ |
|
|
inline _class_::_class_ (const double x) \ |
|
|
inline _class_::_class_ (const double x) \ |
|
|
{ \ |
|
|
{ \ |
|
|
pointer = cl_double_to_DF_pointer(*(const union dfloatjanus *)&x); \ |
|
|
|
|
|
|
|
|
pointer = cl_double_to_DF_pointer(x); \ |
|
|
} \ |
|
|
} \ |
|
|
inline _class_& _class_::operator= (const double x) \ |
|
|
inline _class_& _class_::operator= (const double x) \ |
|
|
{ \ |
|
|
{ \ |
|
|
cl_dec_refcount(*this); \ |
|
|
cl_dec_refcount(*this); \ |
|
|
pointer = cl_double_to_DF_pointer(*(const union dfloatjanus *)&x); \ |
|
|
|
|
|
|
|
|
pointer = cl_double_to_DF_pointer(x); \ |
|
|
return *this; \ |
|
|
return *this; \ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|