kingiii / softart

Automatically exported from code.google.com/p/softart
Other
0 stars 0 forks source link

Refactory TypeCaster #134

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Description:
 Make type conversation is used easier.

Original issue reported on code.google.com by wuye9036 on 27 Nov 2011 at 7:12

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 27 Nov 2011 at 7:12

GoogleCodeExporter commented 8 years ago
This issue was updated by revision 5929f2d0d713.

SASL:
  Rename *_type_converter to *_caster for make name short.
  Rename tecov_t to caster.
  Rename functions in tecov/caster.
  Remove some warnings.

Original comment by wuye9036 on 27 Nov 2011 at 11:13

GoogleCodeExporter commented 8 years ago
Now caster design has a little change.
The cast function prototype is cast( node src, node dest ).

If dest is type node, the casted result will be overwrite to src.
Implicit cast will run as this case.

If dest is as same as src, it must be some logic wrong. assert it and debug it 
later :(

If dest is a expression node, and dest has a storable value, it will store to 
the address.
e.g.
int i;
float f;
f = i;

If dest is expression node, and dest is null or not storable, maybe is normal, 
maybe some error occurs. We consider the error condition as normal. The example 
is explicit cast :
int i = (int)f;

Original comment by wuye9036 on 27 Nov 2011 at 11:21

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 27 Nov 2011 at 11:22

GoogleCodeExporter commented 8 years ago

Original comment by wuye9036 on 15 Dec 2011 at 3:36