[CONFIGURATION]
* BUG: Pass the -fsigned-char option to gcc so that gambas compiles on architectures where char is unsigned by default. [INTERPRETER] * BUG: Fixed the conversion from negative integer to string. git-svn-id: svn://localhost/gambas/trunk@1110 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
a0ecaa77e6
commit
39ca9e0a69
@ -196,8 +196,8 @@ AC_DEFUN([GB_INIT],
|
||||
|
||||
AM_CONDITIONAL(OPTIMIZE, test "$gambas_optimization" = yes)
|
||||
|
||||
AM_CFLAGS="$AM_CFLAGS -pipe -Wall -Wno-unused-value"
|
||||
AM_CXXFLAGS="$AM_CXXFLAGS -pipe -Wall -fno-exceptions -Wno-unused-value"
|
||||
AM_CFLAGS="$AM_CFLAGS -pipe -Wall -Wno-unused-value -fsigned-char"
|
||||
AM_CXXFLAGS="$AM_CXXFLAGS -pipe -Wall -fno-exceptions -Wno-unused-value -fsigned-char"
|
||||
|
||||
have_gcc_visibility=no
|
||||
AX_CFLAGS_GCC_OPTION([-fvisibility=hidden],,
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Gambas Project File 2.0
|
||||
Title=Gambas settings management
|
||||
Startup=Main
|
||||
Version=1.9.90
|
||||
Version=2.2.1
|
||||
VersionProgram=gbx2 -V
|
||||
Authors=Benoît Minisini
|
||||
TabSize=2
|
||||
|
@ -382,6 +382,9 @@ void NUMBER_int_to_string(uint64_t nbr, int prec, int base, VALUE *value)
|
||||
|
||||
neg = (nbr & (1LL << 63)) != 0;
|
||||
|
||||
if (base == 10 && neg)
|
||||
nbr = 1 + ~nbr;
|
||||
|
||||
while (nbr > 0)
|
||||
{
|
||||
digit = nbr % base;
|
||||
@ -404,6 +407,13 @@ void NUMBER_int_to_string(uint64_t nbr, int prec, int base, VALUE *value)
|
||||
len = prec;
|
||||
}
|
||||
|
||||
if (base == 10)
|
||||
{
|
||||
len++;
|
||||
ptr--;
|
||||
*ptr = '-';
|
||||
}
|
||||
|
||||
STRING_new_temp_value(value, NULL, len);
|
||||
src = value->_string.addr;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user