Note that MSVC is not ISO C99 compliant. Also note that some compilers do not support long long. It is much safer to use mp_limb_t.
However the correct units to use would probably be uintptr_t. Here is what I think is pretty safe: Counter : ulong (typedef for unsigned long) unless one can be absolutely sure it is going to always hold a small number, in which case I would use unsigned int Bit count : mp_limb_t e.g. for shifting left and right by this many bits (seems odd, but that is what the processor itself usually uses) Single limb integer : mp_limb_t (defined by gmp.h) Count of multiprecision limbs : mp_size_t (defined by gmp.h) Boolean : int Pointer arithmetic : intptr_t Number of bytes contained in a memory area : uintptr_t I'm open to suggestions, but some version of FLINT will probably switch to using these (we currently use ulong for most things which is safe on most processors, but not all). Bill. On 1 Sep, 17:31, Robert Bradshaw <rober...@math.washington.edu> wrote: > On Sep 1, 2009, at 9:17 AM, William A. Stein wrote: > > > > > > > On Sep 1, 2009, at 6:11 AM, David Kirkby wrote: > > >> 2009/9/1 gsw <georgswe...@googlemail.com>: > > >>> Hi Dave, > > >>> I'd propose to use ISO C99 notation from "Stdint.h", e.g. > >>> "uint64_t", > >>> and do the count in bytes. > >>> This standard notation is even usable on Windows. > >>> (See alsohttp://en.wikipedia.org/wiki/Stdint.h) > > >>> Cheers, > >>> Georg > > >> But do we want to rely on an ISO c99 standard. I bet a lot of > >> compilers in common use will not support that. > > > I think FLINT depends on ISO C99, in which case Sage already requires > > that. > > We also use long long's all over the place in the Sage library so > that's safe too. > > - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---