Difference between revisions of "Void-safe migration guide"
(Prepared guide for migrating code to be Void safe) |
(→Prepare migration using EiffelStudio 6.3 or EiffelStudio 6.4 with the compatibility option) |
||
| Line 3: | Line 3: | ||
==Prepare migration using EiffelStudio 6.3 or EiffelStudio 6.4 with the compatibility option== | ==Prepare migration using EiffelStudio 6.3 or EiffelStudio 6.4 with the compatibility option== | ||
Compile your code using and apply the following refactorings: | Compile your code using and apply the following refactorings: | ||
| − | + | * Search for callers of <e>{CELL}.default_create</e> and replace it by calling <e>put</e> instead and providing a sensible default value. | |
| − | + | * Search for callers of <e>{STRING_8}.make_from_c</e> and <e>{STRING_32}.make_from_c</e>. Replace them by <e>make_from_c_pointer</e> when used as creation procedure, otherwise it is ok to leave it as is. | |
| + | * Search for callers of <e>{C_STRING}.share_from_pointer</e> and <e>{C_STRING}.share_from_pointer_and_count</e> and replace them by <e>make_shared_from_pointer</e> and <e>make_shared_from_pointer_and_count</e> when used as creation procedure, otherwise although it is ok to leave them as is, we recommend using <e>set_shared_from_pointer</e> and <e>set_shared_from_pointer_and_count</e>. | ||
== Compiling in void-safe mode with 6.4 == | == Compiling in void-safe mode with 6.4 == | ||
Revision as of 14:09, 5 February 2009
Migrating your code to be void-safe is quite easy if you follow the recommendations presented in this document.
Prepare migration using EiffelStudio 6.3 or EiffelStudio 6.4 with the compatibility option
Compile your code using and apply the following refactorings:
- Search for callers of
{CELL}.default_createand replace it by callingputinstead and providing a sensible default value. - Search for callers of
{STRING_8}.make_from_cand{STRING_32}.make_from_c. Replace them bymake_from_c_pointerwhen used as creation procedure, otherwise it is ok to leave it as is. - Search for callers of
{C_STRING}.share_from_pointerand{C_STRING}.share_from_pointer_and_countand replace them bymake_shared_from_pointerandmake_shared_from_pointer_and_countwhen used as creation procedure, otherwise although it is ok to leave them as is, we recommend usingset_shared_from_pointerandset_shared_from_pointer_and_count.

