cppexp.c (num_trim): Use 1UL instead of 1 for long int.

2002-05-27  H.J. Lu  (hjl@gnu.org)

	* cppexp.c (num_trim): Use 1UL instead of 1 for long int.
	(num_positive): Likewise.
	(num_div_op): Likewise.

From-SVN: r53939
This commit is contained in:
H.J. Lu 2002-05-27 20:54:50 +00:00 committed by H.J. Lu
parent 2530d6aa59
commit d51b0053f5
2 changed files with 14 additions and 8 deletions

View File

@ -1,3 +1,9 @@
2002-05-27 H.J. Lu (hjl@gnu.org)
* cppexp.c (num_trim): Use 1UL instead of 1 for long int.
(num_positive): Likewise.
(num_div_op): Likewise.
2002-05-27 Neil Booth <neil@daikokuya.demon.co.uk>
* c-common.c (c_common_init): Always use intmax_t.

View File

@ -787,12 +787,12 @@ num_trim (num, precision)
{
precision -= PART_PRECISION;
if (precision < PART_PRECISION)
num.high &= (1 << precision) - 1;
num.high &= (1UL << precision) - 1;
}
else
{
if (precision < PART_PRECISION)
num.low &= (1 << precision) - 1;
num.low &= (1UL << precision) - 1;
num.high = 0;
}
@ -808,10 +808,10 @@ num_positive (num, precision)
if (precision > PART_PRECISION)
{
precision -= PART_PRECISION;
return (num.high & (1 << (precision - 1))) == 0;
return (num.high & (1UL << (precision - 1))) == 0;
}
return (num.low & (1 << (precision - 1))) == 0;
return (num.low & (1UL << (precision - 1))) == 0;
}
/* Returns the negative of NUM. */
@ -1245,7 +1245,7 @@ num_div_op (pfile, lhs, rhs, op)
if (rhs.high)
{
i = precision - 1;
mask = 1 << (i - PART_PRECISION);
mask = 1UL << (i - PART_PRECISION);
for (; ; i--, mask >>= 1)
if (rhs.high & mask)
break;
@ -1256,7 +1256,7 @@ num_div_op (pfile, lhs, rhs, op)
i = precision - PART_PRECISION - 1;
else
i = precision - 1;
mask = 1 << i;
mask = 1UL << i;
for (; ; i--, mask >>= 1)
if (rhs.low & mask)
break;
@ -1284,9 +1284,9 @@ num_div_op (pfile, lhs, rhs, op)
{
lhs = num_binary_op (pfile, lhs, sub, CPP_MINUS);
if (i >= PART_PRECISION)
result.high |= 1 << (i - PART_PRECISION);
result.high |= 1UL << (i - PART_PRECISION);
else
result.low |= 1 << i;
result.low |= 1UL << i;
}
if (i-- == 0)
break;