summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1997-04-21 14:50:33 +0000
committerUlrich Drepper <drepper@redhat.com>1997-04-21 14:50:33 +0000
commit47f13fd4ba484366bedadfc41b12b17a5c7c56d6 (patch)
tree1408bbf869a2c6887e354f82181abdd2afbc15a5
parentb4012b7542183a57cd92514e2359b8110609e52a (diff)
downloadglibc-47f13fd4ba484366bedadfc41b12b17a5c7c56d6.tar.gz
Update.
1997-04-21 16:45 Ulrich Drepper <drepper@cygnus.com> * stdlib/drand48.c: Cleanup namespace. * stdlib/drand48_r.c: Cleanup namespace. * stdlib/erand48.c: Cleanup namespace. * stdlib/erand48_r.c: Cleanup namespace. * stdlib/jrand48.c: Cleanup namespace. * stdlib/jrand48_r.c: Cleanup namespace. * stdlib/lrand48.c: Cleanup namespace. * stdlib/lrand48_r.c: Cleanup namespace. * stdlib/mrand48.c: Cleanup namespace. * stdlib/mrand48_r.c: Cleanup namespace. * stdlib/nrand48.c: Cleanup namespace. * stdlib/nrand48_r.c: Cleanup namespace. * stdlib/lcong48.c: Cleanup namespace. * stdlib/lcong48_r.c: Cleanup namespace. * stdlib/srand48.c: Cleanup namespace. * stdlib/srand48_r.c: Cleanup namespace. * stdlib/seed48.c: Cleanup namespace. * stdlib/seed48_r.c: Cleanup namespace. * stdlib/stdlib.h: Provide new prototypes.
-rw-r--r--ChangeLog23
-rw-r--r--stdlib/drand48.c2
-rw-r--r--stdlib/drand48_r.c2
-rw-r--r--stdlib/erand48.c2
-rw-r--r--stdlib/erand48_r.c3
-rw-r--r--stdlib/jrand48.c6
-rw-r--r--stdlib/jrand48_r.c5
-rw-r--r--stdlib/lcong48.c2
-rw-r--r--stdlib/lcong48_r.c13
-rw-r--r--stdlib/lrand48.c6
-rw-r--r--stdlib/lrand48_r.c2
-rw-r--r--stdlib/mrand48.c6
-rw-r--r--stdlib/mrand48_r.c2
-rw-r--r--stdlib/nrand48.c6
-rw-r--r--stdlib/nrand48_r.c5
-rw-r--r--stdlib/seed48.c2
-rw-r--r--stdlib/seed48_r.c3
-rw-r--r--stdlib/srand48.c2
-rw-r--r--stdlib/srand48_r.c3
-rw-r--r--stdlib/stdlib.h18
20 files changed, 84 insertions, 29 deletions
diff --git a/ChangeLog b/ChangeLog
index 92ddf3420a..9f020b6cf4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,26 @@
+1997-04-21 16:45 Ulrich Drepper <drepper@cygnus.com>
+
+ * stdlib/drand48.c: Cleanup namespace.
+ * stdlib/drand48_r.c: Cleanup namespace.
+ * stdlib/erand48.c: Cleanup namespace.
+ * stdlib/erand48_r.c: Cleanup namespace.
+ * stdlib/jrand48.c: Cleanup namespace.
+ * stdlib/jrand48_r.c: Cleanup namespace.
+ * stdlib/lrand48.c: Cleanup namespace.
+ * stdlib/lrand48_r.c: Cleanup namespace.
+ * stdlib/mrand48.c: Cleanup namespace.
+ * stdlib/mrand48_r.c: Cleanup namespace.
+ * stdlib/nrand48.c: Cleanup namespace.
+ * stdlib/nrand48_r.c: Cleanup namespace.
+ * stdlib/lcong48.c: Cleanup namespace.
+ * stdlib/lcong48_r.c: Cleanup namespace.
+ * stdlib/srand48.c: Cleanup namespace.
+ * stdlib/srand48_r.c: Cleanup namespace.
+ * stdlib/seed48.c: Cleanup namespace.
+ * stdlib/seed48_r.c: Cleanup namespace.
+
+ * stdlib/stdlib.h: Provide new prototypes.
+
1997-04-21 13:25 Ulrich Drepper <drepper@cygnus.com>
* manual/arith.texi: Add description for INFINITY, _Imaginary_I,
diff --git a/stdlib/drand48.c b/stdlib/drand48.c
index 15c84a7fca..7fa6f33356 100644
--- a/stdlib/drand48.c
+++ b/stdlib/drand48.c
@@ -27,7 +27,7 @@ drand48 ()
{
double result;
- (void) erand48_r (__libc_drand48_data.X, &__libc_drand48_data, &result);
+ (void) __erand48_r (__libc_drand48_data.X, &__libc_drand48_data, &result);
return result;
}
diff --git a/stdlib/drand48_r.c b/stdlib/drand48_r.c
index 27d6b5c55f..7ce500a998 100644
--- a/stdlib/drand48_r.c
+++ b/stdlib/drand48_r.c
@@ -26,5 +26,5 @@ drand48_r (buffer, result)
struct drand48_data *buffer;
double *result;
{
- return erand48_r (buffer->X, buffer, result);
+ return __erand48_r (buffer->X, buffer, result);
}
diff --git a/stdlib/erand48.c b/stdlib/erand48.c
index 345fca3f5a..d9784ca9d4 100644
--- a/stdlib/erand48.c
+++ b/stdlib/erand48.c
@@ -28,7 +28,7 @@ erand48 (xsubi)
{
double result;
- (void) erand48_r (xsubi, &__libc_drand48_data, &result);
+ (void) __erand48_r (xsubi, &__libc_drand48_data, &result);
return result;
}
diff --git a/stdlib/erand48_r.c b/stdlib/erand48_r.c
index 958c2e2799..40c3665c74 100644
--- a/stdlib/erand48_r.c
+++ b/stdlib/erand48_r.c
@@ -23,7 +23,7 @@
int
-erand48_r (xsubi, buffer, result)
+__erand48_r (xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
double *result;
@@ -50,3 +50,4 @@ erand48_r (xsubi, buffer, result)
return 0;
}
+weak_alias (__erand48_r, erand48_r)
diff --git a/stdlib/jrand48.c b/stdlib/jrand48.c
index 3da25166d7..c9802f02f0 100644
--- a/stdlib/jrand48.c
+++ b/stdlib/jrand48.c
@@ -22,13 +22,13 @@
/* Global state for non-reentrant functions. Defined in drand48-iter.c. */
extern struct drand48_data __libc_drand48_data;
-long
+long int
jrand48 (xsubi)
unsigned short int xsubi[3];
{
- long result;
+ long int result;
- (void) jrand48_r (xsubi, &__libc_drand48_data, &result);
+ (void) __jrand48_r (xsubi, &__libc_drand48_data, &result);
return result;
}
diff --git a/stdlib/jrand48_r.c b/stdlib/jrand48_r.c
index 648604d4f5..ce4c8b0a95 100644
--- a/stdlib/jrand48_r.c
+++ b/stdlib/jrand48_r.c
@@ -20,10 +20,10 @@
#include <stdlib.h>
int
-jrand48_r (xsubi, buffer, result)
+__jrand48_r (xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
- long *result;
+ long int *result;
{
/* Compute next state. */
if (__drand48_iterate (xsubi, buffer) < 0)
@@ -40,3 +40,4 @@ jrand48_r (xsubi, buffer, result)
return 0;
}
+weak_alias (__jrand48_r, jrand48_r)
diff --git a/stdlib/lcong48.c b/stdlib/lcong48.c
index a9ef571867..b6e41704ac 100644
--- a/stdlib/lcong48.c
+++ b/stdlib/lcong48.c
@@ -26,5 +26,5 @@ void
lcong48 (param)
unsigned short int param[7];
{
- (void) lcong48_r (param, &__libc_drand48_data);
+ (void) __lcong48_r (param, &__libc_drand48_data);
}
diff --git a/stdlib/lcong48_r.c b/stdlib/lcong48_r.c
index 037fd4931e..c7baa3815f 100644
--- a/stdlib/lcong48_r.c
+++ b/stdlib/lcong48_r.c
@@ -21,15 +21,26 @@
#include <string.h>
int
-lcong48_r (param, buffer)
+__lcong48_r (param, buffer)
unsigned short int param[7];
struct drand48_data *buffer;
{
/* Store the given values. */
+#if USHRT_MAX == 0xffffU
memcpy (buffer->X, &param[0], sizeof (buffer->X));
memcpy (buffer->a, &param[3], sizeof (buffer->a));
+#else
+ buffer->X[2] = (param[2] << 16) | param[1];
+ buffer->X[1] = param[0] << 16;
+ buffer->X[0] = 0;
+
+ buffer->a[2] = (param[5] << 16) | param[4];
+ buffer->a[1] = param[3] << 16;
+ buffer->a[0] = 0;
+#endif
buffer->c = param[6];
buffer->init = 1;
return 0;
}
+weak_alias (__lcong48_r, lcong48_r)
diff --git a/stdlib/lrand48.c b/stdlib/lrand48.c
index 2f5530b33c..0c2593551b 100644
--- a/stdlib/lrand48.c
+++ b/stdlib/lrand48.c
@@ -22,12 +22,12 @@
/* Global state for non-reentrant functions. Defined in drand48-iter.c. */
extern struct drand48_data __libc_drand48_data;
-long
+long int
lrand48 ()
{
- long result;
+ long int result;
- (void) nrand48_r (__libc_drand48_data.X, &__libc_drand48_data, &result);
+ (void) __nrand48_r (__libc_drand48_data.X, &__libc_drand48_data, &result);
return result;
}
diff --git a/stdlib/lrand48_r.c b/stdlib/lrand48_r.c
index 8c20cf594b..de4dd99fea 100644
--- a/stdlib/lrand48_r.c
+++ b/stdlib/lrand48_r.c
@@ -22,7 +22,7 @@
int
lrand48_r (buffer, result)
struct drand48_data *buffer;
- long *result;
+ long int *result;
{
/* Be generous for the arguments, detect some errors. */
if (buffer == NULL)
diff --git a/stdlib/mrand48.c b/stdlib/mrand48.c
index 9a68cbf45c..9b0507c1af 100644
--- a/stdlib/mrand48.c
+++ b/stdlib/mrand48.c
@@ -22,12 +22,12 @@
/* Global state for non-reentrant functions. Defined in drand48-iter.c. */
extern struct drand48_data __libc_drand48_data;
-long
+long int
mrand48 ()
{
- long result;
+ long int result;
- (void) jrand48_r (__libc_drand48_data.X, &__libc_drand48_data, &result);
+ (void) __jrand48_r (__libc_drand48_data.X, &__libc_drand48_data, &result);
return result;
}
diff --git a/stdlib/mrand48_r.c b/stdlib/mrand48_r.c
index 0c9819a452..23c0a1562b 100644
--- a/stdlib/mrand48_r.c
+++ b/stdlib/mrand48_r.c
@@ -22,7 +22,7 @@
int
mrand48_r (buffer, result)
struct drand48_data *buffer;
- long *result;
+ long int *result;
{
/* Be generous for the arguments, detect some errors. */
if (buffer == NULL)
diff --git a/stdlib/nrand48.c b/stdlib/nrand48.c
index dc646275d4..5ec7bd72a0 100644
--- a/stdlib/nrand48.c
+++ b/stdlib/nrand48.c
@@ -22,13 +22,13 @@
/* Global state for non-reentrant functions. Defined in drand48-iter.c. */
extern struct drand48_data __libc_drand48_data;
-long
+long int
nrand48 (xsubi)
unsigned short int xsubi[3];
{
- long result;
+ long int result;
- (void) nrand48_r (xsubi, &__libc_drand48_data, &result);
+ (void) __nrand48_r (xsubi, &__libc_drand48_data, &result);
return result;
}
diff --git a/stdlib/nrand48_r.c b/stdlib/nrand48_r.c
index 178be0bfb0..093a4e277b 100644
--- a/stdlib/nrand48_r.c
+++ b/stdlib/nrand48_r.c
@@ -20,10 +20,10 @@
#include <stdlib.h>
int
-nrand48_r (xsubi, buffer, result)
+__nrand48_r (xsubi, buffer, result)
unsigned short int xsubi[3];
struct drand48_data *buffer;
- long *result;
+ long int *result;
{
/* Compute next state. */
if (__drand48_iterate (xsubi, buffer) < 0)
@@ -37,3 +37,4 @@ nrand48_r (xsubi, buffer, result)
return 0;
}
+weak_alias (__nrand48_r, nrand48_r)
diff --git a/stdlib/seed48.c b/stdlib/seed48.c
index 436cc8bf27..f8f31b24c9 100644
--- a/stdlib/seed48.c
+++ b/stdlib/seed48.c
@@ -26,7 +26,7 @@ unsigned short int *
seed48 (seed16v)
unsigned short int seed16v[3];
{
- (void) seed48_r (seed16v, &__libc_drand48_data);
+ (void) __seed48_r (seed16v, &__libc_drand48_data);
return __libc_drand48_data.old_X;
}
diff --git a/stdlib/seed48_r.c b/stdlib/seed48_r.c
index 186d96cdd3..31a5856a94 100644
--- a/stdlib/seed48_r.c
+++ b/stdlib/seed48_r.c
@@ -21,7 +21,7 @@
#include <string.h>
int
-seed48_r (seed16v, buffer)
+__seed48_r (seed16v, buffer)
unsigned short int seed16v[3];
struct drand48_data *buffer;
{
@@ -51,3 +51,4 @@ seed48_r (seed16v, buffer)
return 0;
}
+weak_alias (__seed48_r, seed48_r)
diff --git a/stdlib/srand48.c b/stdlib/srand48.c
index 9bd248a541..eed09a41e6 100644
--- a/stdlib/srand48.c
+++ b/stdlib/srand48.c
@@ -26,5 +26,5 @@ void
srand48 (seedval)
long seedval;
{
- (void) srand48_r (seedval, &__libc_drand48_data);
+ (void) __srand48_r (seedval, &__libc_drand48_data);
}
diff --git a/stdlib/srand48_r.c b/stdlib/srand48_r.c
index 042c669950..763d5c4ef8 100644
--- a/stdlib/srand48_r.c
+++ b/stdlib/srand48_r.c
@@ -21,7 +21,7 @@
#include <limits.h>
int
-srand48_r (seedval, buffer)
+__srand48_r (seedval, buffer)
long int seedval;
struct drand48_data *buffer;
{
@@ -51,3 +51,4 @@ srand48_r (seedval, buffer)
return 0;
}
+weak_alias (__srand48_r, srand48_r)
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 4e60201bad..98ed88986b 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -211,7 +211,7 @@ extern __inline int atoi (__const char *__nptr)
extern __inline long int atol (__const char *__nptr)
{ return strtol (__nptr, (char **) NULL, 10); }
-#if defined __USE_ISOC9X && (defined __GNUC__ || defined __USE_MISC)
+#if defined __USE_MISC || defined __USE_ISOC9X
extern __inline long long int atoll (__const char *__nptr)
{ return strtoll (__nptr, (char **) NULL, 10); }
#endif
@@ -335,23 +335,39 @@ struct drand48_data
#ifdef __USE_MISC
/* Return non-negative, double-precision floating-point value in [0.0,1.0). */
extern int drand48_r __P ((struct drand48_data *__buffer, double *__result));
+extern int __erand48_r __P ((unsigned short int __xsubi[3],
+ struct drand48_data *__buffer, double *__result));
extern int erand48_r __P ((unsigned short int __xsubi[3],
struct drand48_data *__buffer, double *__result));
/* Return non-negative, long integer in [0,2^31). */
extern int lrand48_r __P ((struct drand48_data *__buffer, long int *__result));
+extern int __nrand48_r __P ((unsigned short int __xsubi[3],
+ struct drand48_data *__buffer,
+ long int *__result));
extern int nrand48_r __P ((unsigned short int __xsubi[3],
struct drand48_data *__buffer, long int *__result));
/* Return signed, long integers in [-2^31,2^31). */
extern int mrand48_r __P ((struct drand48_data *__buffer, long int *__result));
+extern int __jrand48_r __P ((unsigned short int __xsubi[3],
+ struct drand48_data *__buffer,
+ long int *__result));
extern int jrand48_r __P ((unsigned short int __xsubi[3],
struct drand48_data *__buffer, long int *__result));
/* Seed random number generator. */
+extern int __srand48_r __P ((long int __seedval,
+ struct drand48_data *__buffer));
extern int srand48_r __P ((long int __seedval, struct drand48_data *__buffer));
+
+extern int __seed48_r __P ((unsigned short int __seed16v[3],
+ struct drand48_data *__buffer));
extern int seed48_r __P ((unsigned short int __seed16v[3],
struct drand48_data *__buffer));
+
+extern int __lcong48_r __P ((unsigned short int __param[7],
+ struct drand48_data *__buffer));
extern int lcong48_r __P ((unsigned short int __param[7],
struct drand48_data *__buffer));
#endif /* Use misc. */