Difference between revisions of "Void-safe migration guide"
(→Prepare migration using 6.3 or 6.4 with the compatibility option) |
|||
| Line 4: | Line 4: | ||
==Prepare migration using 6.3 or 6.4 with the compatibility option== | ==Prepare migration using 6.3 or 6.4 with the compatibility option== | ||
| − | Compile your code using | + | Compile your code using either 6.3 or 6.4 in compatibility mode. Then 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>{CELL}.default_create</e> and replace it by calling <e>put</e> instead and providing a sensible default value. | ||
* Search for callers of <e>{READABLE_STRING_8}.make_from_c</e> and <e>{READABLE_STRING_32}.make_from_c</e>. If you are using them as part of a creation instruction or a creation expression then nothing to be done. Otherwise we recommend you to replace the call by a call to <e>from_c</e>. | * Search for callers of <e>{READABLE_STRING_8}.make_from_c</e> and <e>{READABLE_STRING_32}.make_from_c</e>. If you are using them as part of a creation instruction or a creation expression then nothing to be done. Otherwise we recommend you to replace the call by a call to <e>from_c</e>. | ||
Revision as of 14:48, 6 February 2009
Migrating your code to be void-safe is quite easy if you follow the recommendations presented in this document.
Prepare migration using 6.3 or 6.4 with the compatibility option
Compile your code using either 6.3 or 6.4 in compatibility mode. Then 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
{READABLE_STRING_8}.make_from_cand{READABLE_STRING_32}.make_from_c. If you are using them as part of a creation instruction or a creation expression then nothing to be done. Otherwise we recommend you to replace the call by a call tofrom_c. - 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.

