]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
* Microscopic corrections to make things compile on the Cray APP.
authorGuido van Rossum <guido@python.org>
Wed, 7 Apr 1993 14:06:14 +0000 (14:06 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 7 Apr 1993 14:06:14 +0000 (14:06 +0000)
* Removed one use of $> in Makefile and warned about others.
  Added configurable lines in Makefile to change CC and AR.

Modules/arraymodule.c
Modules/mathmodule.c
Modules/socketmodule.c
Objects/floatobject.c
Objects/intobject.c
Python/ceval.c

index 8812ad613cbb71e3b6b207ad5d27a32ddb3a8797..e5bf46a1e9c7c2d7b75a491bc26b63d2311e1acb 100644 (file)
@@ -31,8 +31,16 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #include "modsupport.h"
 #include "ceval.h"
 
+#ifdef i860
+/* Cray APP doesn't have memmove */
+#define NEED_MEMMOVE
+extern char *memcpy();
+#endif
+
 #ifdef sun
+/* SunOS doesn't have memmove */
 #define NEED_MEMMOVE
+extern char *memcpy();
 #endif
 
 #ifdef NEED_MEMMOVE
index 15211339bfcd46c7558fb229ebd9ba45a4ac1b1a..979155e481bf859f2810639257f7a43625224e71 100644 (file)
@@ -35,6 +35,11 @@ extern int errno;
 
 #include <math.h>
 
+#ifdef i860
+/* Cray APP has bogus definition of HUGE_VAL in <math.h> */
+#undef HUGE_VAL
+#endif
+
 #ifndef __STDC__
 extern double fmod PROTO((double, double));
 #endif
index 0e20307f7daff1816bb1920f03c99c98dbf13f11..e2328fb9543f717385dc50a8568a45bb8771cc99 100644 (file)
@@ -82,6 +82,11 @@ Socket methods:
 #include <sys/un.h>
 #include <netdb.h>
 
+#ifdef i860
+/* Cray APP doesn't have getpeername() */
+#define NO_GETPEERNAME
+#endif
+
 
 /* Global variable holding the exception type for errors detected
    by this module (but not argument type or memory errors, etc.). */
@@ -594,6 +599,7 @@ sock_getsockname(s, args)
 }
 
 
+#ifndef NO_GETPEERNAME
 /* s.getpeername() method */
 
 static object *
@@ -614,6 +620,7 @@ sock_getpeername(s, args)
                return socket_error();
        return makesockaddr((struct sockaddr *) addrbuf, addrlen);
 }
+#endif
 
 
 /* s.listen(n) method */
@@ -809,7 +816,9 @@ static struct methodlist sock_methods[] = {
        {"connect",     sock_connect},
        {"fileno",      sock_fileno},
        {"getsockname", sock_getsockname},
+#ifndef NO_GETPEERNAME
        {"getpeername", sock_getpeername},
+#endif
        {"listen",      sock_listen},
        {"makefile",    sock_makefile},
        {"recv",        sock_recv},
index 8533e0e7be453fee04afaa25fadef57f7169b866..6a95ebf82f986f4ca76785c49ebc458d9cfca180 100644 (file)
@@ -38,6 +38,11 @@ extern int errno;
 #include <ctype.h>
 #include <math.h>
 
+#ifdef i860
+/* Cray APP has bogus definition of HUGE_VAL in <math.h> */
+#undef HUGE_VAL
+#endif
+
 #ifdef HUGE_VAL
 #define CHECK(x) if (errno != 0) ; \
        else if (-HUGE_VAL <= (x) && (x) <= HUGE_VAL) ; \
@@ -170,6 +175,7 @@ float_hash(v)
        }
        else {
                fractpart = frexp(fractpart, &expo);
+               fractpart = fractpart*4294967296.0; /* 2**32 */
                x = (long) (intpart + fractpart) ^ expo; /* Rather arbitrary */
        }
        if (x == -1)
index 6806f0c109ad2b3f7d7432461360c137ce668641..3021873acde093c569aaa3ac195c9f3aae3e43f4 100644 (file)
@@ -426,7 +426,7 @@ int_int(v)
        intobject *v;
 {
        INCREF(v);
-       return v;
+       return (object *)v;
 }
 
 static object *
@@ -512,5 +512,5 @@ typeobject Inttype = {
        &int_as_number, /*tp_as_number*/
        0,              /*tp_as_sequence*/
        0,              /*tp_as_mapping*/
-       &int_hash,      /*tp_hash*/
+       int_hash,       /*tp_hash*/
 };
index cdd71a89d9c3c225efb94c41d9ae29856339f468..12065703c882efd1e2f6a170103f01032c027fb6 100644 (file)
@@ -125,9 +125,8 @@ save_thread()
                release_lock(interpreter_lock);
                return res;
        }
-       else
-               return NULL;
 #endif
+       return NULL;
 }
 
 void