1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00
1998-12-01  Thorsten Kukuk  <kukuk@vt.uni-paderborn.de>

	* sunrpc/auth_des.c: Use new XDR int32 functions for integers.
	* sunrpc/rpc/xdr.h: Add IXDR INT32 functions.
	* sunrpc/rpc_hout.c: Remove (u_long) casts in defines to avoid
	conflicts with new solaris version.
	* sunrpc/rpc_main.c: Fix bug in generating Makefile name (malloc
	doesn't zero allocated memory).
	* sunrpc/rpc_svcout.c: Local variables now starts with a _ to avoid
	conflicts with xdr functions.  Solves PR libc/877.
	* nis/rpcsvc/nis.x: Use always uint32_t.
	* nis/rpcsvc/nis.h: Likewise.
	* nis/rpcsvc/nis_object.x: Likewise.

1998-12-01  Ulrich Drepper  <drepper@cygnus.com>

	* math/libm-test.c: Various cleanups.  Patch by Zack Weinberg.

	* sysdeps/unix/sysv/linux/alpha/setfpucw.c: Use correct type for
	parameter.  Patch by Christian Gafton.

	* string/envz.h: Add prototype for envz_remove.
	Reported by Andreas Jaeger.
This commit is contained in:
Ulrich Drepper
1998-12-01 11:25:26 +00:00
parent 28ab8526f2
commit ee586e0ec4
13 changed files with 1072 additions and 1119 deletions

View File

@ -1,3 +1,27 @@
1998-12-01 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* sunrpc/auth_des.c: Use new XDR int32 functions for integers.
* sunrpc/rpc/xdr.h: Add IXDR INT32 functions.
* sunrpc/rpc_hout.c: Remove (u_long) casts in defines to avoid
conflicts with new solaris version.
* sunrpc/rpc_main.c: Fix bug in generating Makefile name (malloc
doesn't zero allocated memory).
* sunrpc/rpc_svcout.c: Local variables now starts with a _ to avoid
conflicts with xdr functions. Solves PR libc/877.
* nis/rpcsvc/nis.x: Use always uint32_t.
* nis/rpcsvc/nis.h: Likewise.
* nis/rpcsvc/nis_object.x: Likewise.
1998-12-01 Ulrich Drepper <drepper@cygnus.com>
* math/libm-test.c: Various cleanups. Patch by Zack Weinberg.
* sysdeps/unix/sysv/linux/alpha/setfpucw.c: Use correct type for
parameter. Patch by Christian Gafton.
* string/envz.h: Add prototype for envz_remove.
Reported by Andreas Jaeger.
1998-11-30 Mark Kettenis <kettenis@phys.uva.nl>
* mach/Versions [libc, GLIBC_2.0]: Add __spin_lock,

10
FAQ.in
View File

@ -1140,6 +1140,16 @@ taken care in user programs using the firewall structures and therefore
those programs (ipfw is AFAIK the only one) should deal with this problem
themselves.
?? I get floods of warnings when I use -Wconversion and include
<string.h> or <math.h>.
{ZW} <string.h> and <math.h> intentionally use prototypes to override
argument promotion. -Wconversion warns about all these. You can safely
ignore the warnings.
-Wconversion isn't really intended for production use, only for shakedown
compiles after converting an old program to standard C.
? Miscellaneous

View File

@ -17,9 +17,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/*
Part of testsuite for libm.
/* Part of testsuite for libm.
This file has to be included by a master file that defines:
@ -58,7 +56,7 @@
ccos, ccosh, cexp, clog, cpow, csin, csinh, csqrt, ctan, ctanh.
At the moment the following functions aren't tested:
OB conj, cproj, cimag, creal, drem,
conj, cproj, cimag, creal, drem,
j0, j1, jn, y0, y1, yn,
significand,
nan
@ -112,7 +110,6 @@ OB conj, cproj, cimag, creal, drem,
- Compiler has errors
With e.g. gcc 2.7.2.2 the test for cexp fails because of a compiler error.
*/
#ifndef _GNU_SOURCE
@ -166,23 +163,22 @@ typedef MATHTYPE (*mathfunc) (MATHTYPE);
isinf (x) : isinfl (x))
/*
Test if Floating-Point stack hasn't changed
*/
/* Test if Floating-Point stack hasn't changed */
static void
fpstack_test (const char *test_name)
{
#ifdef i386
static int old_stack;
int sw;
asm ("fnstsw":"=a" (sw));
sw >>= 11;
sw &= 7;
if (sw != old_stack)
{
printf ("FP-Stack wrong after test %s\n", test_name);
if (verbose > 2)
printf ("=======> stack = %d\n", sw);
printf ("FP-Stack wrong after test %s (%d, should be %d)\n",
test_name, sw, old_stack);
++noErrors;
old_stack = sw;
}
@ -190,11 +186,9 @@ asm ("fnstsw":"=a" (sw));
}
/*
Get a random value x with min_value < x < max_value
/* Get a random value x with min_value < x < max_value
and min_value, max_value finite,
max_value and min_value shouldn't be too close together
*/
max_value and min_value shouldn't be too close together */
static MATHTYPE
random_value (MATHTYPE min_value, MATHTYPE max_value)
{
@ -214,6 +208,7 @@ random_value (MATHTYPE min_value, MATHTYPE max_value)
return x;
}
/* Get a random value x with x > min_value. */
static MATHTYPE
random_greater (MATHTYPE min_value)
@ -221,6 +216,7 @@ random_greater (MATHTYPE min_value)
return random_value (min_value, 1e6); /* CHOOSE(LDBL_MAX, DBL_MAX, FLT_MAX) */
}
/* Get a random value x with x < max_value. */
static MATHTYPE
random_less (MATHTYPE max_value)
@ -362,14 +358,14 @@ check_equal (MATHTYPE computed, MATHTYPE supplied, MATHTYPE eps, MATHTYPE * diff
ret_value = (*diff <= eps &&
(signbit (computed) == signbit (supplied) || eps != 0.0));
/* Make sure the subtraction/comparison have no influence on the exceptions. */
/* Make sure the subtraction/comparison
have no influence on the exceptions. */
feclearexcept (FE_ALL_EXCEPT);
return ret_value;
}
static void
output_result_bool (const char *test_name, int result)
{
@ -504,9 +500,8 @@ output_result_ext (const char *test_name, int result,
fpstack_test (test_name);
}
/*
check that computed and expected values are the same
*/
/* check that computed and expected values are the same */
static void
check (const char *test_name, MATHTYPE computed, MATHTYPE expected)
{
@ -521,10 +516,8 @@ check (const char *test_name, MATHTYPE computed, MATHTYPE expected)
}
/*
check that computed and expected values are the same,
outputs the parameter to the function
*/
/* check that computed and expected values are the same,
outputs the parameter to the function */
static void
check_ext (const char *test_name, MATHTYPE computed, MATHTYPE expected,
MATHTYPE parameter)
@ -540,10 +533,8 @@ check_ext (const char *test_name, MATHTYPE computed, MATHTYPE expected,
}
/*
check that computed and expected values are the same and
checks also for exception flags
*/
/* check that computed and expected values are the same and
checks also for exception flags */
static void
check_exc (const char *test_name, MATHTYPE computed, MATHTYPE expected,
short exception)
@ -558,9 +549,8 @@ check_exc (const char *test_name, MATHTYPE computed, MATHTYPE expected,
computed, expected, diff, PRINT, PRINT);
}
/*
check that computed and expected values are close enough
*/
/* check that computed and expected values are close enough */
static void
check_eps (const char *test_name, MATHTYPE computed, MATHTYPE expected,
MATHTYPE epsilon)
@ -575,9 +565,8 @@ check_eps (const char *test_name, MATHTYPE computed, MATHTYPE expected,
computed, expected, diff, PRINT, PRINT);
}
/*
check a boolean condition
*/
/* check a boolean condition */
static void
check_bool (const char *test_name, int computed)
{
@ -587,10 +576,7 @@ check_bool (const char *test_name, int computed)
}
/*
check that computed and expected values are equal (int values)
*/
/* check that computed and expected values are equal (int values) */
static void
check_int (const char *test_name, int computed, int expected)
{
@ -620,9 +606,7 @@ check_int (const char *test_name, int computed, int expected)
}
/*
check that computed and expected values are equal (long int values)
*/
/* check that computed and expected values are equal (long int values) */
static void
check_long (const char *test_name, long int computed, long int expected)
{
@ -652,9 +636,8 @@ check_long (const char *test_name, long int computed, long int expected)
fpstack_test (test_name);
}
/*
check that computed and expected values are equal (long long int values)
*/
/* check that computed and expected values are equal (long long int values) */
static void
check_longlong (const char *test_name, long long int computed,
long long int expected)
@ -685,9 +668,8 @@ check_longlong (const char *test_name, long long int computed,
fpstack_test (test_name);
}
/*
check that computed value is not-a-number
*/
/* check that computed value is not-a-number */
static void
check_isnan (const char *test_name, MATHTYPE computed)
{
@ -697,9 +679,7 @@ check_isnan (const char *test_name, MATHTYPE computed)
}
/*
check that computed value is not-a-number and test for exceptions
*/
/* check that computed value is not-a-number and test for exceptions */
static void
check_isnan_exc (const char *test_name, MATHTYPE computed,
short exception)
@ -710,9 +690,7 @@ check_isnan_exc (const char *test_name, MATHTYPE computed,
}
/*
check that computed value is not-a-number and test for exceptions
*/
/* check that computed value is not-a-number and test for exceptions */
static void
check_isnan_maybe_exc (const char *test_name, MATHTYPE computed,
short exception)
@ -722,9 +700,8 @@ check_isnan_maybe_exc (const char *test_name, MATHTYPE computed,
output_isvalue (test_name, isnan (computed), computed);
}
/*
check that computed value is not-a-number and supply parameter
*/
/* check that computed value is not-a-number and supply parameter */
#ifndef TEST_INLINE
static void
check_isnan_ext (const char *test_name, MATHTYPE computed,
@ -736,10 +713,8 @@ check_isnan_ext (const char *test_name, MATHTYPE computed,
}
#endif
/*
check that computed value is not-a-number, test for exceptions
and supply parameter
*/
/* check that computed value is not-a-number, test for exceptions
and supply parameter */
static void
check_isnan_exc_ext (const char *test_name, MATHTYPE computed,
short exception, MATHTYPE parameter)
@ -760,6 +735,7 @@ check_isinfp (const char *test_name, MATHTYPE computed)
}
/* Tests if computed is +Inf and supply parameter */
static void
check_isinfp_ext (const char *test_name, MATHTYPE computed,
MATHTYPE parameter)
@ -770,7 +746,7 @@ check_isinfp_ext (const char *test_name, MATHTYPE computed,
}
/* Tests if computed is +Inf */
/* Tests if computed is +Inf and check exceptions */
static void
check_isinfp_exc (const char *test_name, MATHTYPE computed,
int exception)
@ -780,6 +756,7 @@ check_isinfp_exc (const char *test_name, MATHTYPE computed,
output_isvalue (test_name, (ISINF (computed) == +1), computed);
}
/* Tests if computed is -Inf */
static void
check_isinfn (const char *test_name, MATHTYPE computed)
@ -790,6 +767,7 @@ check_isinfn (const char *test_name, MATHTYPE computed)
}
/* Tests if computed is -Inf and supply parameter */
#ifndef TEST_INLINE
static void
check_isinfn_ext (const char *test_name, MATHTYPE computed,
@ -801,8 +779,7 @@ check_isinfn_ext (const char *test_name, MATHTYPE computed,
}
#endif
/* Tests if computed is -Inf */
/* Tests if computed is -Inf and check exceptions */
static void
check_isinfn_exc (const char *test_name, MATHTYPE computed,
int exception)
@ -854,7 +831,6 @@ acos_test (void)
check_eps ("acos (0.7) == 0.795398830...", FUNC(acos) (0.7),
0.7953988301841435554L, CHOOSE(7e-17L, 0, 0));
}
@ -910,7 +886,6 @@ asin_test (void)
static void
asinh_test (void)
{
check ("asinh(+0) == +0", FUNC(asinh) (0), 0);
#ifndef TEST_INLINE
check ("asinh(-0) == -0", FUNC(asinh) (minus_zero), minus_zero);
@ -919,7 +894,6 @@ asinh_test (void)
#endif
check_eps ("asinh(0.7) == 0.652666566...", FUNC(asinh) (0.7),
0.652666566082355786L, CHOOSE(4e-17L, 0, 6e-8));
}
@ -1021,7 +995,6 @@ atan2_test (void)
0.6107259643892086165L, CHOOSE(3e-17L, 0, 0));
check_eps ("atan2 (0.4,0.0003) == 1.57004...", FUNC(atan2) (0.4, 0.0003),
1.5700463269355215718L, CHOOSE(2e-19L, 0, 1.2e-7));
}
@ -1075,7 +1048,6 @@ cbrt_test (void)
CHOOSE(2e-17L, 2e-16, 0));
check_eps ("cbrt (0.7) == .8879040017...", FUNC(cbrt) (0.7),
0.8879040017426007084L, CHOOSE(2e-17L, 6e-16, 0));
}
@ -1095,7 +1067,6 @@ ceil_test (void)
static void
cos_test (void)
{
check ("cos (+0) == 1", FUNC(cos) (0), 1);
check ("cos (-0) == 1", FUNC(cos) (minus_zero), 1);
check_isnan_exc ("cos (+inf) == NaN plus invalid exception",
@ -1116,6 +1087,7 @@ cos_test (void)
0.7648421872844884262L, CHOOSE(3e-17, 2e-16, 6e-8));
}
static void
cosh_test (void)
{
@ -1258,8 +1230,6 @@ expm1_test (void)
}
static void
check_frexp (const char *test_name, MATHTYPE computed, MATHTYPE expected,
int comp_int, int exp_int)
@ -1324,29 +1294,11 @@ frexp_test (void)
check_frexp ("frexp: 12.8 == 0.8 * 2^4", result, 0.8L, x_int, 4);
result = FUNC(frexp) (-27.34L, &x_int);
check_frexp ("frexp: -27.34 == -0.854375 * 2^5", result, -0.854375L, x_int, 5);
check_frexp ("frexp: -27.34 == -0.854375 * 2^5",
result, -0.854375L, x_int, 5);
}
#if __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
/* All floating-point numbers can be put in one of these categories. */
enum
{
FP_NAN,
#define FP_NAN FP_NAN
FP_INFINITE,
#define FP_INFINITE FP_INFINITE
FP_ZERO,
#define FP_ZERO FP_ZERO
FP_SUBNORMAL,
#define FP_SUBNORMAL FP_SUBNORMAL
FP_NORMAL
#define FP_NORMAL FP_NORMAL
};
#endif
static void
fpclassify_test (void)
{
@ -1390,7 +1342,6 @@ isnormal_test (void)
check_bool ("isnormal (+inf) == 0", isnormal (plus_infty) == 0);
check_bool ("isnormal (-inf) == 0", isnormal (minus_infty) == 0);
check_bool ("isnormal (NaN) == 0", isnormal (nan_value) == 0);
}
@ -1409,7 +1360,6 @@ signbit_test (void)
x = random_greater (0);
check_bool ("signbit (x) == 0 for x > 0", signbit (x) == 0);
}
@ -1464,7 +1414,6 @@ tgamma_test (void)
return;
feclearexcept (FE_ALL_EXCEPT);
check_isinfp ("tgamma (+inf) == +inf", FUNC(tgamma) (plus_infty));
check_isnan_exc ("tgamma (0) == NaN plus invalid exception",
FUNC(tgamma) (0), INVALID_EXCEPTION);
@ -1474,10 +1423,8 @@ tgamma_test (void)
check_isnan_exc ("tgamma (-inf) == NaN plus invalid exception",
FUNC(tgamma) (minus_infty), INVALID_EXCEPTION);
#ifdef TODO
check_eps ("tgamma (0.5) == sqrt(pi)", FUNC(tgamma) (0.5),
FUNC(sqrt) (M_PIl), CHOOSE(0, 5e-16, 2e-7));
#endif
check_eps ("tgamma (-0.5) == -2*sqrt(pi)", FUNC(tgamma) (-0.5),
-2*FUNC(sqrt) (M_PIl), CHOOSE(0, 5e-16, 3e-7));
@ -1538,7 +1485,6 @@ lgamma_test (void)
check_eps ("lgamma (1.2) == -0.08537...", FUNC(lgamma) (1.2),
-0.853740900033158497197e-1L, CHOOSE(0, 2e-17, 2e-8));
check_int ("lgamma (1.2) sets signgam to 1", signgam, 1);
}
@ -1560,7 +1506,6 @@ ilogb_test (void)
i = FUNC(ilogb) (nan_value);
feclearexcept (FE_ALL_EXCEPT);
check_int ("ilogb (NaN) == FP_ILOGBNAN", i, FP_ILOGBNAN);
}
@ -1580,7 +1525,6 @@ ldexp_test (void)
x = random_greater (0.0);
check_ext ("ldexp (x, 0) == x", FUNC(ldexp) (x, 0L), x, x);
}
@ -1682,7 +1626,6 @@ log2_test (void)
check ("log2 (256) == 8", FUNC(log2) (256.0), 8);
check_eps ("log2 (0.7) == -0.5145731728...", FUNC(log2) (0.7),
-0.51457317282975824043L, CHOOSE(1e-16L, 2e-16, 6e-8));
}
@ -1702,7 +1645,6 @@ logb_test (void)
check ("logb (e) == 1", FUNC(logb) (M_El), 1);
check ("logb (1024) == 10", FUNC(logb) (1024), 10);
check ("logb (-2000) == 10", FUNC(logb) (-2000), 10);
}
@ -2369,8 +2311,6 @@ fmod_test (void)
CHOOSE(5e-16, 1e-15, 2e-7));
check_eps ("fmod (-6.5, -2.3) == -1.9", FUNC(fmod) (-6.5, -2.3), -1.9,
CHOOSE(5e-16, 1e-15, 2e-7));
}
@ -2500,6 +2440,7 @@ sqrt_test (void)
0.83666002653407554798L, CHOOSE(3e-17L, 0, 0));
}
static void
remainder_test (void)
{
@ -2628,11 +2569,6 @@ cexp_test (void)
check_isnan ("imag(cexp(0 + i inf)) = NaN plus invalid exception",
__imag__ result);
#if defined __GNUC__ && __GNUC__ <= 2 && __GNUC_MINOR__ <= 7
if (verbose)
printf ("The following test for cexp might fail due to a gcc compiler error!\n");
#endif
result = FUNC(cexp) (BUILD_COMPLEX(minus_zero, plus_infty));
check_isnan_exc ("real(cexp(-0 + i inf)) = NaN plus invalid exception",
__real__ result, INVALID_EXCEPTION);
@ -5324,7 +5260,6 @@ carg_test (void)
check ("carg (-inf -i inf) == -3*pi/4",
FUNC(carg) (BUILD_COMPLEX(minus_infty, minus_infty)), -3 * M_PI_4l);
}
@ -5570,9 +5505,7 @@ fma_test (void)
}
/*
Tests for the comparison macros
*/
/* Tests for the comparison macros */
typedef enum { is_less, is_equal, is_greater, is_unordered } comp_result;
@ -5618,7 +5551,6 @@ comparison2_test (MATHTYPE x, MATHTYPE y, comp_result comp)
expected);
result = (isunordered (x, y) == expected);
check_bool (buf, result);
}
@ -5694,13 +5626,15 @@ inverse_functions (void)
inverse_func_pair_test ("cos(acos(x)) == x",
FUNC(acos), FUNC(cos), 1.0, 0.0);
inverse_func_pair_test ("atan(tan(x)) == x",
FUNC(tan), FUNC(atan), 1.0, CHOOSE (2e-18L, 0, 0));
FUNC(tan), FUNC(atan), 1.0,
CHOOSE(2e-18L, 0, 0));
inverse_func_pair_test ("tan(atan(x)) == x",
FUNC(atan), FUNC(tan), 1.0,
CHOOSE(2e-18L, 1e-15L, 2e-7));
inverse_func_pair_test ("asinh(sinh(x)) == x",
FUNC(sinh), FUNC(asinh), 1.0, CHOOSE (1e-18L, 0, 1e-7));
FUNC(sinh), FUNC(asinh), 1.0,
CHOOSE(1e-18L, 0, 1e-7));
inverse_func_pair_test ("sinh(asinh(x)) == x",
FUNC(asinh), FUNC(sinh), 1.0,
CHOOSE(2e-18L, 2e-16L, 2e-7));
@ -5712,12 +5646,13 @@ inverse_functions (void)
FUNC(acosh), FUNC(cosh), 1.0, 0.0);
inverse_func_pair_test ("atanh(tanh(x)) == x",
FUNC(tanh), FUNC(atanh), 1.0, CHOOSE (1e-18L, 1e-15L, 0));
FUNC(tanh), FUNC(atanh), 1.0,
CHOOSE(1e-18L, 1e-15L, 0));
inverse_func_pair_test ("tanh(atanh(x)) == x",
FUNC(atanh), FUNC(tanh), 1.0, 0.0);
}
/* Test sin and cos with the identity: sin(x)^2 + cos(x)^2 = 1. */
static void
identities1_test (MATHTYPE x, MATHTYPE epsilon)
@ -5878,7 +5813,6 @@ basic_tests (void)
check_bool ("isinf (HUGE_VALx) == +1", ISINF (x1) == +1);
x1 = -CHOOSE(HUGE_VALL, HUGE_VAL, HUGE_VALF);
check_bool ("isinf (-HUGE_VALx) == -1", ISINF (x1) == -1);
}

View File

@ -119,7 +119,7 @@ enum nstype {
typedef enum nstype nstype;
struct oar_mask {
u_int oa_rights;
uint32_t oa_rights;
zotypes oa_otype;
};
typedef struct oar_mask oar_mask;
@ -137,7 +137,7 @@ struct nis_server {
u_int ep_len;
endpoint *ep_val;
} ep;
u_int key_type;
uint32_t key_type;
netobj pkey;
};
typedef struct nis_server nis_server;
@ -164,7 +164,7 @@ typedef struct directory_obj directory_obj;
#define EN_ASN1 64
struct entry_col {
u_int ec_flags;
uint32_t ec_flags;
struct {
u_int ec_value_len;
char *ec_value_val;
@ -182,7 +182,7 @@ struct entry_obj {
typedef struct entry_obj entry_obj;
struct group_obj {
u_int gr_flags;
uint32_t gr_flags;
struct {
u_int gr_members_len;
nis_name *gr_members_val;
@ -210,8 +210,8 @@ typedef struct link_obj link_obj;
struct table_col {
char *tc_name;
u_int tc_flags;
u_int tc_rights;
uint32_t tc_flags;
uint32_t tc_rights;
};
typedef struct table_col table_col;
@ -255,7 +255,7 @@ struct nis_object {
nis_name zo_owner;
nis_name zo_group;
nis_name zo_domain;
u_int zo_access;
uint32_t zo_access;
uint32_t zo_ttl;
objdata zo_data;
};
@ -344,7 +344,7 @@ struct ib_request {
u_int ibr_srch_len;
nis_attr *ibr_srch_val;
} ibr_srch;
u_int ibr_flags;
uint32_t ibr_flags;
struct {
u_int ibr_obj_len;
nis_object *ibr_obj_val;
@ -408,7 +408,7 @@ struct cp_result {
typedef struct cp_result cp_result;
struct nis_tag {
u_int tag_type;
uint32_t tag_type;
char *tag_val;
};
typedef struct nis_tag nis_tag;

View File

@ -51,9 +51,6 @@
#if RPC_HDR
%#include <rpc/xdr.h>
#endif
#if RPC_SVC
%#include "nis_svc.h"
#endif
/* Include the RPC Language description of NIS objects */
#include "nis_object.x"
@ -153,7 +150,7 @@ struct ns_request {
struct ib_request {
nis_name ibr_name; /* The name of the Table */
nis_attr ibr_srch<>; /* The search critereia */
u_int ibr_flags; /* Optional flags */
uint32_t ibr_flags; /* Optional flags */
nis_object ibr_obj<1>; /* optional object (add/modify) */
nis_server ibr_cbhost<1>; /* Optional callback info */
u_int ibr_bufsize; /* Optional first/next bufsize */
@ -225,7 +222,7 @@ struct cp_result {
* and to set or reset state variables.
*/
struct nis_tag {
u_int tag_type; /* Statistic tag (may vary) */
uint32_t tag_type; /* Statistic tag (may vary) */
string tag_val<>; /* Statistic value may also vary */
};
@ -258,7 +255,7 @@ struct nis_bound_endpoint {
endpoint ep;
int generation;
int rank;
u_int flags;
uint32_t flags;
int hostnum;
int epnum;
nis_name uaddr;
@ -292,22 +289,6 @@ typedef struct nis_active_endpoint nis_active_endpoint;
%#define NIS_BOUND 0x1
%#define NIS_TRANSIENT_ERRORS 0x2
/*
* What's going on here? Well, it's like this. When the service
* is being compiled it wants to have the service definition specific
* info included, and when the client is being compiled it wants that
* info. This includes the appropriate file which was generated by
* make in the protocols directory (probably /usr/include/rpcsvc).
*/
#ifdef RPC_SVC
%#include "nis_svc.h"
#endif
#ifdef RPC_CLNT
%#include "nis_clnt.h"
#endif
program NIS_PROG {
/* RPC Language description of the NIS+ protocol */

View File

@ -124,7 +124,7 @@ enum nstype {
* administrator's approval.
*/
struct oar_mask {
u_int oa_rights; /* Access rights mask */
uint32_t oa_rights; /* Access rights mask */
zotypes oa_otype; /* Object type */
};
@ -142,7 +142,7 @@ struct endpoint {
struct nis_server {
nis_name name; /* Principal name of the server */
endpoint ep<>; /* Universal addr(s) for server */
u_int key_type; /* Public key type */
uint32_t key_type; /* Public key type */
netobj pkey; /* server's public key */
};
@ -170,7 +170,7 @@ const EN_MODIFIED = 8; /* Indicates entry is modified. */
const EN_ASN1 = 64; /* Means contents use ASN.1 encoding */
struct entry_col {
u_int ec_flags; /* Flags for this value */
uint32_t ec_flags; /* Flags for this value */
opaque ec_value<>; /* It's textual value */
};
@ -186,7 +186,7 @@ struct entry_obj {
* name.directory and recursive groups are expressed as @groupname.directory
*/
struct group_obj {
u_int gr_flags; /* Flags controlling group */
uint32_t gr_flags; /* Flags controlling group */
nis_name gr_members<>; /* List of names in group */
};
@ -229,8 +229,8 @@ const TA_ASN1 = 64; /* Means contents use ASN.1 encoding */
struct table_col {
string tc_name<64>; /* Column Name */
u_int tc_flags; /* control flags */
u_int tc_rights; /* Access rights mask */
uint32_t tc_flags; /* control flags */
uint32_t tc_rights; /* Access rights mask */
};
struct table_obj {
@ -291,7 +291,7 @@ struct nis_object {
nis_name zo_owner; /* NIS name of object owner. */
nis_name zo_group; /* NIS name of access group. */
nis_name zo_domain; /* The administrator for the object */
u_int zo_access; /* Access rights (owner, group, world) */
uint32_t zo_access; /* Access rights (owner, group, world) */
uint32_t zo_ttl; /* Object's time to live in seconds. */
objdata zo_data; /* Data structure for this type */
};

View File

@ -1,5 +1,5 @@
/* Routines for dealing with '\0' separated environment vectors
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
The GNU C Library is free software; you can redistribute it and/or
@ -55,6 +55,10 @@ extern error_t envz_merge __P ((char **__envz, size_t *__envz_len,
__const char *__envz2, size_t __envz2_len,
int __override));
/* Remove the entry for NAME from ENVZ & ENVZ_LEN, if any. */
extern void envz_remove __P ((char **__envz, size_t *__envz_len,
__const char *__name));
/* Remove null entries. */
extern void envz_strip __P ((char **__envz, size_t *__envz_len));

View File

@ -70,8 +70,7 @@ static void authdes_destroy (AUTH *);
static bool_t synchronize (struct sockaddr *, struct timeval *)
internal_function;
static struct auth_ops authdes_ops =
{
static struct auth_ops authdes_ops = {
authdes_nextverf,
authdes_marshal,
authdes_validate,
@ -83,13 +82,12 @@ static struct auth_ops authdes_ops =
/*
* This struct is pointed to by the ah_private field of an "AUTH *"
*/
struct ad_private
{
struct ad_private {
char *ad_fullname; /* client's full name */
u_int ad_fullnamelen; /* length of name, rounded up */
char *ad_servername; /* server's full name */
u_int ad_servernamelen; /* length of name, rounded up */
u_int ad_window; /* client specified window */
uint32_t ad_window; /* client specified window */
bool_t ad_dosync; /* synchronize? */
struct sockaddr ad_syncaddr; /* remote host to synch with */
struct timeval ad_timediff; /* server's time - client's time */
@ -236,7 +234,7 @@ authdes_marshal (AUTH * auth, XDR * xdrs)
des_block cryptbuf[2];
des_block ivec;
int status;
int len;
unsigned int len;
register long *ixdr;
/*
@ -255,14 +253,15 @@ authdes_marshal (AUTH * auth, XDR * xdrs)
/*
* XDR the timestamp and possibly some other things, then
* encrypt them.
* XXX We have a real Year 2038 problem here.
*/
ixdr = (long *) cryptbuf;
IXDR_PUT_LONG (ixdr, ad->ad_timestamp.tv_sec);
IXDR_PUT_LONG (ixdr, ad->ad_timestamp.tv_usec);
if (ad->ad_cred.adc_namekind == ADN_FULLNAME)
{
IXDR_PUT_U_LONG (ixdr, ad->ad_window);
IXDR_PUT_U_LONG (ixdr, ad->ad_window - 1);
IXDR_PUT_U_INT32 (ixdr, ad->ad_window);
IXDR_PUT_U_INT32 (ixdr, ad->ad_window - 1);
ivec.key.high = ivec.key.low = 0;
status = cbc_crypt ((char *) &auth->ah_key, (char *) cryptbuf,
2 * sizeof (des_block), DES_ENCRYPT | DES_HW, (char *) &ivec);
@ -304,29 +303,29 @@ authdes_marshal (AUTH * auth, XDR * xdrs)
if ((ixdr = xdr_inline (xdrs, 2 * BYTES_PER_XDR_UNIT)) != NULL)
{
IXDR_PUT_LONG (ixdr, AUTH_DES);
IXDR_PUT_LONG (ixdr, len);
IXDR_PUT_INT32 (ixdr, AUTH_DES);
IXDR_PUT_U_INT32 (ixdr, len);
}
else
{
ATTEMPT (xdr_putlong (xdrs, (long *)&auth->ah_cred.oa_flavor));
ATTEMPT (xdr_putlong (xdrs, (long *)&len));
ATTEMPT (xdr_putint32 (xdrs, &auth->ah_cred.oa_flavor));
ATTEMPT (xdr_putint32 (xdrs, &len));
}
ATTEMPT (xdr_authdes_cred (xdrs, cred));
len = (2 + 1) * BYTES_PER_XDR_UNIT;
if ((ixdr = xdr_inline (xdrs, 2 * BYTES_PER_XDR_UNIT)) != NULL)
{
IXDR_PUT_LONG (ixdr, AUTH_DES);
IXDR_PUT_LONG (ixdr, len);
IXDR_PUT_INT32 (ixdr, AUTH_DES);
IXDR_PUT_U_INT32 (ixdr, len);
}
else
{
ATTEMPT (xdr_putlong (xdrs, (long *)&auth->ah_verf.oa_flavor));
ATTEMPT (xdr_putlong (xdrs, (long *)&len));
ATTEMPT (xdr_putint32 (xdrs, &auth->ah_verf.oa_flavor));
ATTEMPT (xdr_putint32 (xdrs, &len));
}
ATTEMPT (xdr_authdes_verf (xdrs, verf));
return (TRUE);
return TRUE;
}
@ -358,7 +357,7 @@ authdes_validate (AUTH * auth, struct opaque_auth *rverf)
if (DES_FAILED (status))
{
debug ("authdes_validate: DES decryption failure");
return (FALSE);
return FALSE;
}
/*
@ -375,7 +374,7 @@ authdes_validate (AUTH * auth, struct opaque_auth *rverf)
sizeof (struct timeval)) != 0)
{
debug ("authdes_validate: verifier mismatch\n");
return (FALSE);
return FALSE;
}
/*
@ -383,7 +382,7 @@ authdes_validate (AUTH * auth, struct opaque_auth *rverf)
*/
ad->ad_nickname = verf.adv_nickname;
ad->ad_cred.adc_namekind = ADN_NICKNAME;
return (TRUE);
return TRUE;
}
/*
@ -411,12 +410,12 @@ authdes_refresh (AUTH * auth)
if (key_encryptsession_pk (ad->ad_servername, &pkey, &ad->ad_xkey) < 0)
{
debug ("authdes_create: unable to encrypt conversation key");
return (FALSE);
return FALSE;
}
cred->adc_fullname.key = ad->ad_xkey;
cred->adc_namekind = ADN_FULLNAME;
cred->adc_fullname.name = ad->ad_fullname;
return (TRUE);
return TRUE;
}
/*
@ -447,7 +446,7 @@ synchronize (struct sockaddr *syncaddr, struct timeval *timep)
timeout.tv_sec = RTIME_TIMEOUT;
timeout.tv_usec = 0;
if (rtime ((struct sockaddr_in *) syncaddr, timep, &timeout) < 0)
return (FALSE);
return FALSE;
__gettimeofday (&mytime, (struct timezone *) NULL);
timep->tv_sec -= mytime.tv_sec;
@ -457,5 +456,5 @@ synchronize (struct sockaddr *syncaddr, struct timeval *timep)
timep->tv_usec += MILLION;
}
timep->tv_usec -= mytime.tv_usec;
return (TRUE);
return TRUE;
}

View File

@ -154,6 +154,7 @@ struct XDR
*/
typedef bool_t (*xdrproc_t) __PMT ((XDR *, void *,...));
/*
* Operations defined on a XDR handle
*
@ -247,20 +248,28 @@ struct xdr_discrim
* N.B. and frozen for all time: each data type here uses 4 bytes
* of external representation.
*/
#define IXDR_GET_INT32(buf) ((int32_t)ntohl((uint32_t)*(buf)++))
#define IXDR_PUT_INT32(buf, v) (*(buf)++ = (int32_t)htonl((uint32_t)v))
#define IXDR_GET_U_INT32(buf) ((uint32_t)IXDR_GET_INT32(buf))
#define IXDR_PUT_U_INT32(buf, v) IXDR_PUT_INT32((buf), ((int32_t)(v)))
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_INT32(buf))
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_INT32(buf))
#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_INT32(buf))
#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_INT32(buf))
#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_INT32((buf), ((int)(v)))
#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_INT32((buf), ((int)(v)))
#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_INT32((buf), ((int)(v)))
#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_INT32((buf), ((int)(v)))
/* This defines are removed from Sun for new platforms and shouldn't
be used any longer. */
#define IXDR_GET_LONG(buf) ((long)ntohl((u_long)*((u_int32_t*)buf)++))
#define IXDR_PUT_LONG(buf, v) (*((u_int32_t*)(buf))++ = (long)htonl((u_long)v))
#define IXDR_GET_BOOL(buf) ((bool_t)IXDR_GET_LONG(buf))
#define IXDR_GET_ENUM(buf, t) ((t)IXDR_GET_LONG(buf))
#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf))
#define IXDR_GET_SHORT(buf) ((short)IXDR_GET_LONG(buf))
#define IXDR_GET_U_SHORT(buf) ((u_short)IXDR_GET_LONG(buf))
#define IXDR_PUT_BOOL(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
#define IXDR_PUT_ENUM(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
#define IXDR_PUT_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
#define IXDR_PUT_U_SHORT(buf, v) IXDR_PUT_LONG((buf), ((long)(v)))
/*
* These are the "generic" xdr routines.

View File

@ -48,7 +48,6 @@ static void pargdef (definition * def);
static void pstructdef (definition * def);
static void puniondef (definition * def);
static void pdefine (const char *name, const char *num);
static void puldefine (const char *name, const char *num);
static int define_printed (proc_list * stop, version_list * start);
static void pprogramdef (definition * def);
static void parglist (proc_list * proc, const char *addargtype);
@ -251,12 +250,6 @@ pdefine (const char *name, const char *num)
f_print (fout, "#define %s %s\n", name, num);
}
static void
puldefine (const char *name, const char *num)
{
f_print (fout, "#define %s ((u_long)%s)\n", name, num);
}
static int
define_printed (proc_list *stop, version_list *start)
{
@ -302,7 +295,7 @@ pprogramdef (definition *def)
pargdef (def);
puldefine (def->def_name, def->def.pr.prog_num);
pdefine (def->def_name, def->def.pr.prog_num);
for (vers = def->def.pr.versions; vers != NULL; vers = vers->next)
{
if (tblflag)
@ -312,7 +305,7 @@ pprogramdef (definition *def)
f_print (fout, "extern %s_%s_nproc;\n",
locase (def->def_name), vers->vers_num);
}
puldefine (vers->vers_name, vers->vers_num);
pdefine (vers->vers_name, vers->vers_num);
/*
* Print out 2 definitions, one for ANSI-C, another for
@ -327,7 +320,7 @@ pprogramdef (definition *def)
{
if (!define_printed(proc, def->def.pr.versions))
{
puldefine (proc->proc_name, proc->proc_num);
pdefine (proc->proc_name, proc->proc_num);
}
f_print (fout, "%s", ext);
pprocdef (proc, vers, NULL, 0, 2);
@ -359,7 +352,7 @@ pprogramdef (definition *def)
{
if (!define_printed(proc, def->def.pr.versions))
{
puldefine(proc->proc_name, proc->proc_num);
pdefine(proc->proc_name, proc->proc_num);
}
f_print (fout, "%s", ext);
pprocdef (proc, vers, "CLIENT *", 0, i);

View File

@ -968,7 +968,6 @@ mkfile_output (struct commandline *cmd)
char *mkfilename;
const char *clientname, *clntname, *xdrname, *hdrname;
const char *servername, *svcname, *servprogname, *clntprogname;
char *temp;
svcname = file_name (cmd->infile, "_svc.c");
clntname = file_name (cmd->infile, "_clnt.c");
@ -990,12 +989,12 @@ mkfile_output (struct commandline *cmd)
if (allfiles)
{
mkfilename = alloc (strlen ("Makefile.") +
strlen (cmd->infile) + 1);
temp = (char *) rindex (cmd->infile, '.');
strcat (mkfilename, "Makefile.");
strncat (mkfilename, cmd->infile,
(temp - cmd->infile));
char *cp, *temp;
mkfilename = alloc (strlen ("Makefile.") + strlen (cmd->infile) + 1);
temp = rindex (cmd->infile, '.');
cp = stpcpy (mkfilename, "Makefile.");
strncpy (cp, cmd->infile, (temp - cmd->infile));
}
else
mkfilename = (char *) cmd->outfile;

View File

@ -72,10 +72,10 @@ static void
p_xdrfunc (const char *rname, const char *typename)
{
if (Cflag)
f_print (fout, "\t\txdr_%s = (xdrproc_t) xdr_%s;\n", rname,
f_print (fout, "\t\t_xdr_%s = (xdrproc_t) xdr_%s;\n", rname,
stringfix (typename));
else
f_print (fout, "\t\txdr_%s = xdr_%s;\n", rname, stringfix (typename));
f_print (fout, "\t\t_xdr_%s = xdr_%s;\n", rname, stringfix (typename));
}
void
@ -503,7 +503,7 @@ write_program (const definition * def, const char *storage)
if (Cflag)
{
f_print (fout, "\txdrproc_t xdr_%s, xdr_%s;\n", ARG, RESULT);
f_print (fout, "\txdrproc_t _xdr_%s, _xdr_%s;\n", ARG, RESULT);
if (mtflag)
f_print(fout,
"\tbool_t (*%s)(char *, void *, struct svc_req *);\n",
@ -619,11 +619,11 @@ write_program (const definition * def, const char *storage)
RETVAL, ROUTINE, ARG, RESULT, RQSTP);
if (mtflag)
f_print(fout,
"\tif (%s > 0 && !svc_sendreply(%s, xdr_%s, (char *)&%s)) {\n",
"\tif (%s > 0 && !svc_sendreply(%s, _xdr_%s, (char *)&%s)) {\n",
RETVAL, TRANSP, RESULT, RESULT);
else
f_print(fout,
"\tif (%s != NULL && !svc_sendreply(%s, xdr_%s, %s)) {\n",
"\tif (%s != NULL && !svc_sendreply(%s, _xdr_%s, %s)) {\n",
RESULT, TRANSP, RESULT, RESULT);
printerr ("systemerr", TRANSP);
@ -643,7 +643,7 @@ write_program (const definition * def, const char *storage)
{
f_print(fout,"\tif (!");
pvname(def->def_name, vp->vers_num);
f_print(fout,"_freeresult (%s, xdr_%s, (caddr_t) &%s))\n",
f_print(fout,"_freeresult (%s, _xdr_%s, (caddr_t) &%s))\n",
TRANSP, RESULT, RESULT);
(void) sprintf(_errbuf, "unable to free results");
print_err_message("\t\t");
@ -664,7 +664,7 @@ static void
printif (const char *proc, const char *transp, const char *prefix,
const char *arg)
{
f_print (fout, "\tif (!svc_%s (%s, xdr_%s, %s%s)) {\n",
f_print (fout, "\tif (!svc_%s (%s, _xdr_%s, %s%s)) {\n",
proc, transp, arg, prefix, arg);
}

View File

@ -1,5 +1,5 @@
/* Set FP exception mask and rounding mode.
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@ -41,7 +41,7 @@ wrfpcr (unsigned long fpcr)
void
__setfpucw (unsigned short fpu_control)
__setfpucw (fpu_control_t fpu_control)
{
unsigned long fpcr = 0, fpcw = 0;