'int' is enough for 'length' to migrate code from x86 to x64

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Tue Nov 18 05:35:31 PST 2014


On Tue, 18 Nov 2014 12:33:51 +0000
FrankLike via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> If you migrate your projct from x86 to x64,you will find the 
> length is error,you must modify it ,such as:
>    int i= (something).length
> to
>    size_t i = (something).length
> 
> but now ,'int' is enough for use,not huge and not small,only 
> enough.
> 'int' is easy to write,and most people are used to it.
> Most importantly easier to migrate code,if  'length''s return 
> value type is 'int'.
> 
> Thank you all.
drop your C.

  auto len = smth.length;

works ok for both x86 and x86_64 (don't know what x64 is).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141118/47474040/attachment.sig>


More information about the Digitalmars-d mailing list