help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Fix SPARC issues on 2.0.7


From: Paolo Bonzini
Subject: [Help-smalltalk] Fix SPARC issues on 2.0.7
Date: Thu, 24 Oct 2002 17:58:36 +0200
User-agent: Mutt/1.4i

Here is 2.0.7 version of the patch I just sent.  It includes the
September patch.

Paolo



diff -rC3 tmp/smalltalk-2.0.7//i18n/i18n.c smalltalk-2.0.7/i18n/i18n.c
*** tmp/smalltalk-2.0.7//i18n/i18n.c    Sun Jul 14 13:46:10 2002
--- smalltalk-2.0.7/i18n/i18n.c Thu Oct 24 17:54:12 2002
***************
*** 150,156 ****
  
    if (!setlocale (LC_ALL, string))
      {
!       xfree (oldLocale);
        return NULL;
      }
  
--- 150,156 ----
  
    if (!setlocale (LC_ALL, string))
      {
!       free (oldLocale);
        return NULL;
      }
  
***************
*** 233,240 ****
  
    charset = locale_charset ();
    setlocale (LC_ALL, oldLocale);
!   xfree (oldLocale);
!   xfree (ourLocale);
  
    return charset;
  }
--- 233,240 ----
  
    charset = locale_charset ();
    setlocale (LC_ALL, oldLocale);
!   free (oldLocale);
!   free (ourLocale);
  
    return charset;
  }
diff -rC3 tmp/smalltalk-2.0.7//lib-src/acosl.c smalltalk-2.0.7/lib-src/acosl.c
*** tmp/smalltalk-2.0.7//lib-src/acosl.c        Wed Aug  7 15:26:01 2002
--- smalltalk-2.0.7/lib-src/acosl.c     Thu Oct 24 17:54:12 2002
***************
*** 9,14 ****
--- 9,16 ----
   * ====================================================
   */
  
+ #include "mathl.h"
+ 
  /*
    Long double expansions contributed by
    Stephen L. Moshier <address@hidden>
diff -rC3 tmp/smalltalk-2.0.7//lib-src/asinl.c smalltalk-2.0.7/lib-src/asinl.c
*** tmp/smalltalk-2.0.7//lib-src/asinl.c        Mon Jul 22 15:02:44 2002
--- smalltalk-2.0.7/lib-src/asinl.c     Thu Oct 24 17:54:12 2002
***************
*** 9,14 ****
--- 9,16 ----
   * ====================================================
   */
  
+ #include "mathl.h"
+ 
  /*
    Long double expansions contributed by
    Stephen L. Moshier <address@hidden>
diff -rC3 tmp/smalltalk-2.0.7//lib-src/atanl.c smalltalk-2.0.7/lib-src/atanl.c
*** tmp/smalltalk-2.0.7//lib-src/atanl.c        Mon Jul 22 11:30:02 2002
--- smalltalk-2.0.7/lib-src/atanl.c     Thu Oct 24 17:54:12 2002
***************
*** 44,49 ****
--- 44,51 ----
  
  /* Copyright 2001 by Stephen L. Moshier <address@hidden>  */
  
+ #include "mathl.h"
+ 
  #include <math.h>
  
  /* arctan(k/8), k = 0, ..., 82 */
diff -rC3 tmp/smalltalk-2.0.7//lib-src/ceill.c smalltalk-2.0.7/lib-src/ceill.c
*** tmp/smalltalk-2.0.7//lib-src/ceill.c        Mon Jul 22 09:44:35 2002
--- smalltalk-2.0.7/lib-src/ceill.c     Thu Oct 24 17:54:12 2002
***************
*** 30,35 ****
--- 30,37 ----
  
  #include <float.h>
  
+ #include "mathl.h"
+ 
  /* To compute the integer part of X, sum a big enough
     integer so that the precision of the floating point
     number is exactly 1.  */
diff -rC3 tmp/smalltalk-2.0.7//lib-src/cosl.c smalltalk-2.0.7/lib-src/cosl.c
*** tmp/smalltalk-2.0.7//lib-src/cosl.c Mon Jul 22 15:26:28 2002
--- smalltalk-2.0.7/lib-src/cosl.c      Thu Oct 24 17:54:12 2002
***************
*** 46,51 ****
--- 46,53 ----
  
  #include <math.h>
  
+ #include "mathl.h"
+ 
  #include "trigl.h"
  #ifdef HAVE_SINL
  #include "trigl.c"
diff -rC3 tmp/smalltalk-2.0.7//lib-src/expl.c smalltalk-2.0.7/lib-src/expl.c
*** tmp/smalltalk-2.0.7//lib-src/expl.c Mon Jul 22 15:26:33 2002
--- smalltalk-2.0.7/lib-src/expl.c      Thu Oct 24 17:54:12 2002
***************
*** 31,36 ****
--- 31,38 ----
  #include <float.h>
  #include <math.h>
  
+ #include "mathl.h"
+ 
  static const long double C[] = {
  /* Chebyshev polynom coeficients for (exp(x)-1)/x */
  #define P1 C[0]
diff -rC3 tmp/smalltalk-2.0.7//lib-src/floorl.c smalltalk-2.0.7/lib-src/floorl.c
*** tmp/smalltalk-2.0.7//lib-src/floorl.c       Mon Jul 22 09:44:31 2002
--- smalltalk-2.0.7/lib-src/floorl.c    Thu Oct 24 17:54:12 2002
***************
*** 30,35 ****
--- 30,37 ----
  
  #include <float.h>
  
+ #include "mathl.h"
+ 
  /* To compute the integer part of X, sum a big enough
     integer so that the precision of the floating point
     number is exactly 1.  */
diff -rC3 tmp/smalltalk-2.0.7//lib-src/frexpl.c smalltalk-2.0.7/lib-src/frexpl.c
*** tmp/smalltalk-2.0.7//lib-src/frexpl.c       Wed Aug  7 14:23:41 2002
--- smalltalk-2.0.7/lib-src/frexpl.c    Thu Oct 24 17:54:12 2002
***************
*** 31,36 ****
--- 31,38 ----
  #include <float.h>
  #include <math.h>
  
+ #include "mathl.h"
+ 
  /* Binary search.  Quite inefficient but portable. */
  long double
  frexpl(long double x, int *exp)
diff -rC3 tmp/smalltalk-2.0.7//lib-src/ldexpl.c smalltalk-2.0.7/lib-src/ldexpl.c
*** tmp/smalltalk-2.0.7//lib-src/ldexpl.c       Mon Jul 22 10:31:00 2002
--- smalltalk-2.0.7/lib-src/ldexpl.c    Thu Oct 24 17:54:12 2002
***************
*** 31,36 ****
--- 31,38 ----
  #include <float.h>
  #include <math.h>
  
+ #include "mathl.h"
+ 
  long double
  ldexpl(long double x, int exp)
  {
diff -rC3 tmp/smalltalk-2.0.7//lib-src/logl.c smalltalk-2.0.7/lib-src/logl.c
*** tmp/smalltalk-2.0.7//lib-src/logl.c Mon Jul 22 11:24:08 2002
--- smalltalk-2.0.7/lib-src/logl.c      Thu Oct 24 17:54:12 2002
***************
*** 44,49 ****
--- 44,51 ----
  
  #include <math.h>
  
+ #include "mathl.h"
+ 
  /* Copyright 2001 by Stephen L. Moshier <address@hidden> */
  
  /* log(1+x) = x - .5 x^2 + x^3 l(x)
diff -rC3 tmp/smalltalk-2.0.7//lib-src/mathl.h smalltalk-2.0.7/lib-src/mathl.h
*** tmp/smalltalk-2.0.7//lib-src/mathl.h        Mon Jul 22 15:06:18 2002
--- smalltalk-2.0.7/lib-src/mathl.h     Thu Oct 24 17:54:12 2002
***************
*** 28,33 ****
--- 28,36 ----
   *
   ***********************************************************************/
  
+ #ifndef GST_MATHL_H
+ #define GST_MATHL_H
+ 
  extern long double acosl(long double x);
  extern long double asinl (long double x);
  extern long double atanl (long double x);
***************
*** 41,43 ****
--- 44,48 ----
  extern long double sinl (long double x);
  extern long double sqrtl(long double x);
  extern long double tanl (long double x);
+ 
+ #endif
diff -rC3 tmp/smalltalk-2.0.7//lib-src/sincosl.c 
smalltalk-2.0.7/lib-src/sincosl.c
*** tmp/smalltalk-2.0.7//lib-src/sincosl.c      Mon Jul 22 14:30:57 2002
--- smalltalk-2.0.7/lib-src/sincosl.c   Thu Oct 24 17:54:12 2002
***************
*** 21,26 ****
--- 21,28 ----
  #include <math.h>
  #include <float.h>
  
+ #include "mathl.h"
+ 
  static const long double sin_c[] = {
  #define ONE sin_c[0]
    1.00000000000000000000000000000000000E+00L, /* 
3fff0000000000000000000000000000 */
***************
*** 72,103 ****
  };
  
  static const long double cos_c[] = {
- #define ONE cos_c[0]
-   1.00000000000000000000000000000000000E+00L, /* 
3fff0000000000000000000000000000 */
- 
- /* cos x ~ ONE + x^2 ( SCOS1 + SCOS2 * x^2 + ... + SCOS4 * x^6 + SCOS5 * x^8 )
-    x in <0,1/256>  */
- #define SCOS1 cos_c[1]
- #define SCOS2 cos_c[2]
- #define SCOS3 cos_c[3]
- #define SCOS4 cos_c[4]
- #define SCOS5 cos_c[5]
-   -5.00000000000000000000000000000000000E-01L,        /* 
bffe0000000000000000000000000000 */
-   4.16666666666666666666666666556146073E-02L, /* 
3ffa5555555555555555555555395023 */
-   -1.38888888888888888888309442601939728E-03L,        /* 
bff56c16c16c16c16c16a566e42c0375 */
-   2.48015873015862382987049502531095061E-05L, /* 
3fefa01a01a019ee02dcf7da2d6d5444 */
-   -2.75573112601362126593516899592158083E-07L,        /* 
bfe927e4f5dce637cb0b54908754bde0 */
- 
  /* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
     x in <0,0.1484375>  */
! #define COS1 cos_c[6]
! #define COS2 cos_c[7]
! #define COS3 cos_c[8]
! #define COS4 cos_c[9]
! #define COS5 cos_c[10]
! #define COS6 cos_c[11]
! #define COS7 cos_c[12]
! #define COS8 cos_c[13]
    -4.99999999999999999999999999999999759E-01L,        /* 
bffdfffffffffffffffffffffffffffb */
    4.16666666666666666666666666651287795E-02L, /* 
3ffa5555555555555555555555516f30 */
    -1.38888888888888888888888742314300284E-03L,        /* 
bff56c16c16c16c16c16c16a463dfd0d */
--- 74,89 ----
  };
  
  static const long double cos_c[] = {
  /* cos x ~ ONE + x^2 ( COS1 + COS2 * x^2 + ... + COS7 * x^12 + COS8 * x^14 )
     x in <0,0.1484375>  */
! #define COS1 cos_c[0]
! #define COS2 cos_c[1]
! #define COS3 cos_c[2]
! #define COS4 cos_c[3]
! #define COS5 cos_c[4]
! #define COS6 cos_c[5]
! #define COS7 cos_c[6]
! #define COS8 cos_c[7]
    -4.99999999999999999999999999999999759E-01L,        /* 
bffdfffffffffffffffffffffffffffb */
    4.16666666666666666666666666651287795E-02L, /* 
3ffa5555555555555555555555516f30 */
    -1.38888888888888888888888742314300284E-03L,        /* 
bff56c16c16c16c16c16c16a463dfd0d */
***************
*** 107,124 ****
    -1.14707451049343817400420280514614892E-11L,        /* 
bfda9397496922a9601ed3d4ca48944b */
    4.77810092804389587579843296923533297E-14L, /* 
3fd2ae5f8197cbcdcaf7c3fb4523414c */
  
- /* sin x ~ ONE * x + x^3 ( SSIN1 + SSIN2 * x^2 + ... + SSIN4 * x^6 + SSIN5 * 
x^8 )
-    x in <0,1/256>  */
- #define SSIN1 cos_c[14]
- #define SSIN2 cos_c[15]
- #define SSIN3 cos_c[16]
- #define SSIN4 cos_c[17]
- #define SSIN5 cos_c[18]
-   -1.66666666666666666666666666666666659E-01L,        /* 
bffc5555555555555555555555555555 */
-   8.33333333333333333333333333146298442E-03L, /* 
3ff81111111111111111111110fe195d */
-   -1.98412698412698412697726277416810661E-04L,        /* 
bff2a01a01a01a01a019e7121e080d88 */
-   2.75573192239848624174178393552189149E-06L, /* 
3fec71de3a556c640c6aaa51aa02ab41 */
-   -2.50521016467996193495359189395805639E-08L,        /* 
bfe5ae644ee90c47dc71839de75b2787 */
  };
  
  #define SINCOSL_COS_HI 0
--- 93,98 ----
diff -rC3 tmp/smalltalk-2.0.7//lib-src/sinl.c smalltalk-2.0.7/lib-src/sinl.c
*** tmp/smalltalk-2.0.7//lib-src/sinl.c Mon Jul 22 15:27:12 2002
--- smalltalk-2.0.7/lib-src/sinl.c      Thu Oct 24 17:54:12 2002
***************
*** 46,51 ****
--- 46,53 ----
  
  #include <math.h>
  
+ #include "mathl.h"
+ 
  #include "trigl.h"
  #include "trigl.c"
  #include "sincosl.c"
diff -rC3 tmp/smalltalk-2.0.7//lib-src/sqrtl.c smalltalk-2.0.7/lib-src/sqrtl.c
*** tmp/smalltalk-2.0.7//lib-src/sqrtl.c        Wed Aug  7 15:28:44 2002
--- smalltalk-2.0.7/lib-src/sqrtl.c     Thu Oct 24 17:54:12 2002
***************
*** 31,36 ****
--- 31,38 ----
  #include <float.h>
  #include <math.h>
  
+ #include "mathl.h"
+ 
  /* A simple Newton-Raphson method. */
  long double
  sqrtl(long double x)
diff -rC3 tmp/smalltalk-2.0.7//lib-src/tanl.c smalltalk-2.0.7/lib-src/tanl.c
*** tmp/smalltalk-2.0.7//lib-src/tanl.c Mon Jul 22 15:26:51 2002
--- smalltalk-2.0.7/lib-src/tanl.c      Thu Oct 24 17:54:12 2002
***************
*** 46,51 ****
--- 46,53 ----
  
  #include <math.h>
  
+ #include "mathl.h"
+ 
  #include "trigl.h"
  #ifdef HAVE_SINL
  #ifdef HAVE_COSL
diff -rC3 tmp/smalltalk-2.0.7//lib-src/trigl.c smalltalk-2.0.7/lib-src/trigl.c
*** tmp/smalltalk-2.0.7//lib-src/trigl.c        Tue Jul 23 08:12:09 2002
--- smalltalk-2.0.7/lib-src/trigl.c     Thu Oct 24 17:54:12 2002
***************
*** 21,26 ****
--- 21,28 ----
  #include <math.h>
  #include <float.h>
  
+ #include "mathl.h"
+ 
  /* Table of constants for 2/pi, 5628 hexadecimal digits of 2/pi */
  static const int two_over_pi[] = {
    0xa2f983, 0x6e4e44, 0x1529fc, 0x2757d1, 0xf534dd, 0xc0db62,
diff -rC3 tmp/smalltalk-2.0.7//libgst/dict.inl smalltalk-2.0.7/libgst/dict.inl
*** tmp/smalltalk-2.0.7//libgst/dict.inl        Mon Sep  9 19:42:50 2002
--- smalltalk-2.0.7/libgst/dict.inl     Thu Oct 24 17:54:32 2002
***************
*** 433,439 ****
  
    /* we may not be aligned properly...fetch things out the hard way */
    obj = OOP_TO_OBJ (floatOOP);
!   memcpy (&d, obj->data, sizeof (double));
    return (d);
  }
  #endif
--- 433,439 ----
  
    /* we may not be aligned properly...fetch things out the hard way */
    obj = OOP_TO_OBJ (floatOOP);
!   memcpy ((PTR) &d, obj->data, sizeof (double));
    return (d);
  }
  #endif
***************
*** 441,456 ****
  OOP
  floatd_new (double f)
  {
-   gst_floatd floatObject;
    OOP floatOOP;
  
!   floatObject = (gst_floatd) new_instance_with 
      (_gst_floatd_class, sizeof (double), &floatOOP);
  
- #if (DOUBLE_ALIGNMENT <= SIZEOF_CHAR_P)
    floatObject->value = f;
  #else
!   memcpy (&floatObject->value, &f, sizeof (double));
  #endif
  
    return (floatOOP);
--- 441,461 ----
  OOP
  floatd_new (double f)
  {
    OOP floatOOP;
+ #if (DOUBLE_ALIGNMENT <= SIZEOF_CHAR_P)
+   gst_floatd floatObject;
  
!   floatObject = (gst_floatd) new_instance_with
      (_gst_floatd_class, sizeof (double), &floatOOP);
  
    floatObject->value = f;
  #else
!   mst_Object obj;
! 
!   obj = new_instance_with
!     (_gst_floatd_class, sizeof (double), &floatOOP);
! 
!   memcpy (obj->data, (PTR) &f, sizeof (double));
  #endif
  
    return (floatOOP);
***************
*** 473,479 ****
  
    /* we may not be aligned properly...fetch things out the hard way */
    obj = OOP_TO_OBJ (floatOOP);
!   memcpy (&d, obj->data, sizeof (long double));
    return (d);
  }
  #endif
--- 478,484 ----
  
    /* we may not be aligned properly...fetch things out the hard way */
    obj = OOP_TO_OBJ (floatOOP);
!   memcpy ((PTR) &d, obj->data, sizeof (long double));
    return (d);
  }
  #endif
***************
*** 481,496 ****
  OOP
  floatq_new (long double f)
  {
-   gst_floatq floatObject;
    OOP floatOOP;
  
!   floatObject = (gst_floatq) new_instance_with 
      (_gst_floatq_class, sizeof (long double), &floatOOP);
  
- #if (LONG_DOUBLE_ALIGNMENT <= SIZEOF_CHAR_P)
    floatObject->value = f;
  #else
!   memcpy (&floatObject->value, &f, sizeof (long double));
  #endif
  
    return (floatOOP);
--- 486,506 ----
  OOP
  floatq_new (long double f)
  {
    OOP floatOOP;
+ #if (LONG_DOUBLE_ALIGNMENT <= SIZEOF_CHAR_P)
+   gst_floatq floatObject;
  
!   floatObject = (gst_floatq) new_instance_with
      (_gst_floatq_class, sizeof (long double), &floatOOP);
  
    floatObject->value = f;
  #else
!   mst_Object obj;
! 
!   obj = new_instance_with
!     (_gst_floatq_class, sizeof (long double), &floatOOP);
! 
!   memcpy (obj->data, (PTR) &f, sizeof (long double));
  #endif
  
    return (floatOOP);
diff -rC3 tmp/smalltalk-2.0.7//libgst/mpz.c smalltalk-2.0.7/libgst/mpz.c
*** tmp/smalltalk-2.0.7//libgst/mpz.c   Sun Jul 14 13:45:54 2002
--- smalltalk-2.0.7/libgst/mpz.c        Thu Oct 24 17:54:12 2002
***************
*** 32,37 ****
--- 32,38 ----
  #include "gstpriv.h"
  #include <stdlib.h>
  #include <math.h>
+ #include "mathl.h"
  
  #if HAVE_GMP
  #include <gmp.h>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]