On Wed, Jun 17, 2009 at 1:05 PM, Kyle Sluder<kyle.slu...@gmail.com> wrote: > On Wed, Jun 17, 2009 at 9:54 AM, Kirk Kerekes<kirkkere...@gmail.com> wrote: >> <http://www-cs-faculty.stanford.edu/~knuth/programs/rng.c> > > Not to knock on Don Knuth, but I wouldn't recommend using that code in > your app. There's a perfectly good RNG facility in the system as Mr. > George Warner pointed out, and Knuth's code is designed for a 32-bit > system. While it will work on OS X (because we use LP64), it will be > wrong on Win64 (which uses ILP64) and will cause problems if you > upcast to NSUInteger on OS X.
Nitpick: Windows is actually LLP64 (int and long are 32, long long and pointers are 64) and so it will work fine there. This is not to detract from your overall point in any way. If your code needs precise sizes, use a data type which specifies the size explicitly, like the standard int32_t and friends in stdint.h. Mike _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com