#9399: Remove Sun-specific junk in rings/finite_rings/stdint.h
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |       Owner:  drkirkby
       Type:  defect    |      Status:  new     
   Priority:  major     |   Milestone:  sage-4.5
  Component:  solaris   |    Keywords:          
     Author:            |    Upstream:  N/A     
   Reviewer:            |      Merged:          
Work_issues:            |  
------------------------+---------------------------------------------------
Changes (by drkirkby):

 * cc: jsp, jhpalmieri (added)


Old description:

> The file has this in it
>

> {{{
> #if defined(__sun)
> typedef int int_fast32_t;
> typedef long long int_fast64_t;
> #else
> #include <stdint.h>
> #endif
>
> #define INTEGER_MOD_INT32_LIMIT 46341          //  = ceil(sqrt(2^31-1))
> #define INTEGER_MOD_INT64_LIMIT 2147483647     //  = 2^31-1 for now,
> should be 3037000500LL = ceil(sqrt(2^63-1))
> }}}
>
> I can only assume someone added this Sun-specific code for a very old
> version of Solaris. Any Solaris 10 release will include the header file
> <stdint.h>, so there is no need to have this.
>
> The code as it stands conflicts with a Solaris header file, which defines
> int_fast64_t as being a 'long' and not a 'long long' in 64-bit mode. The
> code as show is only valid for 32-bit.
>
> The following will save a few bytes, and will go further to advance the
> state of a 64-bit Solaris port.
>
> {{{
> #include <stdint.h>
>
> #define INTEGER_MOD_INT32_LIMIT 46341          //  = ceil(sqrt(2^31-1))
> #define INTEGER_MOD_INT64_LIMIT 2147483647     //  = 2^31-1 for now,
> should be 3037000500LL = ceil(sqrt(2^63-1))
> }}}

New description:

 The file {{{sage-4.4.4.alpha1/sage/rings/finite_rings/stdint.h}}} has this
 in it:

 {{{
 #if defined(__sun)
 typedef int int_fast32_t;
 typedef long long int_fast64_t;
 #else
 #include <stdint.h>
 #endif

 #define INTEGER_MOD_INT32_LIMIT 46341          //  = ceil(sqrt(2^31-1))
 #define INTEGER_MOD_INT64_LIMIT 2147483647     //  = 2^31-1 for now,
 should be 3037000500LL = ceil(sqrt(2^63-1))
 }}}

 I can only assume someone added this Sun-specific code for a very old
 version of Solaris. Any Solaris 10 release will include the header file
 <stdint.h>, so there is no need to have this.

 The code as it stands conflicts with a Solaris header file, which defines
 int_fast64_t as being a 'long' and not a 'long long' in 64-bit mode. The
 code as show is only valid for 32-bit.

 The following will save a few bytes, and will go further to advance the
 state of a 64-bit Solaris port.

 {{{
 #include <stdint.h>

 #define INTEGER_MOD_INT32_LIMIT 46341          //  = ceil(sqrt(2^31-1))
 #define INTEGER_MOD_INT64_LIMIT 2147483647     //  = 2^31-1 for now,
 should be 3037000500LL = ceil(sqrt(2^63-1))
 }}}

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9399#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to