64-bit Insider Newsletter Volume 1, Issue 4 Page 1/664-bit Insider Volume I, Issue 4 Guidelines for Writing Effective Polymorphic Code: Part 2 In Issue 3 of our newsletter, we talked about the pointer truncation errors that might occur when completing a 32- bit to 64-bit code migration. In this issue, we continue our discussion by examining what happens when pointer trun- cation occurs and how you can use polymorphic data types to solve this problem. If you recall the example from Issue 3, we compiled code that resulted in several pointer truncation issues. Before we demonstrate how to fix the code, let’s take a look at how pointer truncation occurs. Examining How Pointer Truncation Occurs In the example from Issue 3, we had a void pointer called myPointer. The following sections explain what happens when the pointer is typecast to an inttype and anINT_PTRtype on both 32-bit and 64-bit platforms. Remember that theINT_PTR type is always the same size as a pointer on both 32-bit and 64-bit platforms. On a 32-bit Platform Typecasting from a pointer to an int type: the poin- ter and inthave the same size, so pointer truncation The 64-bit Advantage The computer industry is chang- ing, and 64-bit technology is the next, inevitable step. The 64-bit Insider newsletter will help you adopt this technology by provid- ing tips and tricks for a successful port. Development and migration of 64- bit technology is not as compli- cated as the 16-bit to 32-bit transi- tion. However, as with any new technology, several areas do re- quire close examination and con- sideration. The goal of the 64-bitInsidernewsletteris to identify potential migration issues and provide viable, effective solutions to these issues. With a plethora ofWeb sites already focused on 64- bit technology, the intention ofthis newsletter is not to repeat previously published information. Instead, it will focus on 64-bit issues that are somewhat isolated yet extremely important to under- stand. It will also connect you to reports and findings from 64-bit experts.