* valops.c (value_cast): Handle casts to and from TYPE_CODE_CHAR.
* ch-exp.c (match_integer_literal): Fix long long support. * gdbtypes.c (get_discrete_bounds): Make TYPE_LENGTH (type) == sizeof (LONGEST) case work OK.
This commit is contained in:
parent
406477a696
commit
f6d165855e
3 changed files with 16 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
Mon Dec 11 00:36:01 1995 Per Bothner <bothner@kalessin.cygnus.com>
|
||||||
|
|
||||||
|
* valops.c (value_cast): Handle casts to and from TYPE_CODE_CHAR.
|
||||||
|
* ch-exp.c (match_integer_literal): Fix long long support.
|
||||||
|
* gdbtypes.c (get_discrete_bounds): Make TYPE_LENGTH (type) ==
|
||||||
|
sizeof (LONGEST) case work OK.
|
||||||
|
|
||||||
Fri Dec 8 21:02:24 1995 Fred Fish <fnf@cygnus.com>
|
Fri Dec 8 21:02:24 1995 Fred Fish <fnf@cygnus.com>
|
||||||
|
|
||||||
* coffread.c, dbxread.c, dstread.c, objfiles.c, os9kread.c,
|
* coffread.c, dbxread.c, dstread.c, objfiles.c, os9kread.c,
|
||||||
|
|
|
@ -597,7 +597,7 @@ parse_primval ()
|
||||||
case CHARACTER_LITERAL:
|
case CHARACTER_LITERAL:
|
||||||
write_exp_elt_opcode (OP_LONG);
|
write_exp_elt_opcode (OP_LONG);
|
||||||
write_exp_elt_type (PEEK_LVAL ().typed_val.type);
|
write_exp_elt_type (PEEK_LVAL ().typed_val.type);
|
||||||
write_exp_elt_longcst ((LONGEST) (PEEK_LVAL ().typed_val.val));
|
write_exp_elt_longcst (PEEK_LVAL ().typed_val.val);
|
||||||
write_exp_elt_opcode (OP_LONG);
|
write_exp_elt_opcode (OP_LONG);
|
||||||
FORWARD_TOKEN ();
|
FORWARD_TOKEN ();
|
||||||
break;
|
break;
|
||||||
|
@ -1544,8 +1544,8 @@ match_integer_literal ()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
yylval.typed_val.val = ival;
|
yylval.typed_val.val = ival;
|
||||||
#ifdef CC_HAS_LONG_LONG
|
#if defined(CC_HAS_LONG_LONG) && defined(__STDC__)
|
||||||
if (ival > 2147483647 || ival < -2147483648)
|
if (ival > (LONGEST)2147483647U || ival < -(LONGEST)2147483648U)
|
||||||
yylval.typed_val.type = builtin_type_long_long;
|
yylval.typed_val.type = builtin_type_long_long;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -369,7 +369,7 @@ get_discrete_bounds (type, lowp, highp)
|
||||||
*highp = 1;
|
*highp = 1;
|
||||||
return 0;
|
return 0;
|
||||||
case TYPE_CODE_INT:
|
case TYPE_CODE_INT:
|
||||||
if (TYPE_LENGTH (type) >= sizeof (LONGEST)) /* Too big */
|
if (TYPE_LENGTH (type) > sizeof (LONGEST)) /* Too big */
|
||||||
return -1;
|
return -1;
|
||||||
if (!TYPE_UNSIGNED (type))
|
if (!TYPE_UNSIGNED (type))
|
||||||
{
|
{
|
||||||
|
@ -380,7 +380,11 @@ get_discrete_bounds (type, lowp, highp)
|
||||||
/* ... fall through for unsigned ints ... */
|
/* ... fall through for unsigned ints ... */
|
||||||
case TYPE_CODE_CHAR:
|
case TYPE_CODE_CHAR:
|
||||||
*lowp = 0;
|
*lowp = 0;
|
||||||
*highp = (1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT)) - 1;
|
/* This round-about calculation is to avoid shifting by
|
||||||
|
TYPE_LENGTH (type) * TARGET_CHAR_BIT, which will not work
|
||||||
|
if TYPE_LENGTH (type) == sizeof (LONGEST). */
|
||||||
|
*highp = 1 << (TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1);
|
||||||
|
*highp = (*highp - 1) | *highp;
|
||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
return -1;
|
return -1;
|
||||||
|
|
Loading…
Add table
Reference in a new issue