* src/reader.c (reader_read_identifier_or_number): Support 64 bit.
(reader_read_binary): Likewise.
(reader_read_octal): Likewise.
(reader_read_hex): Likewise.
{
char buf[MAX_STRING];
int i = 0;
- int n = 0;
+ long n = 0;
int negative_p = 0;
if (c == '+' && isdigit (peekchar ()))
c = readchar ();
SCM
reader_read_binary ()
{
- int n = 0;
+ long n = 0;
int c = peekchar ();
- int s = 1;
+ int negative_p = 0;
if (c == '-')
{
- s = -1;
+ negative_p = 1;
readchar ();
c = peekchar ();
}
readchar ();
c = peekchar ();
}
- return MAKE_NUMBER (s*n);
+ if (negative_p)
+ n = 0 - n;
+ return MAKE_NUMBER (n);
}
SCM
reader_read_octal ()
{
- int n = 0;
+ long n = 0;
int c = peekchar ();
- int s = 1;
+ int negative_p = 0;
if (c == '-')
{
- s = -1;
+ negative_p = 1;
readchar ();
c = peekchar ();
}
readchar ();
c = peekchar ();
}
- return MAKE_NUMBER (s*n);
+ if (negative_p)
+ n = 0 - n;
+ return MAKE_NUMBER (n);
}
SCM
reader_read_hex ()
{
- int n = 0;
+ long n = 0;
int c = peekchar ();
- int s = 1;
+ int negative_p = 0;
if (c == '-')
{
- s = -1;
+ negative_p = 1;
readchar ();
c = peekchar ();
}
readchar ();
c = peekchar ();
}
- return MAKE_NUMBER (s*n);
+ if (negative_p)
+ n = 0 - n;
+ return MAKE_NUMBER (n);
}
SCM