From 39ca9e0a69a91c2cb73b13862b8957ecbb5892df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Mon, 25 Feb 2008 15:34:04 +0000 Subject: [PATCH] [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 --- acinclude.m4 | 4 ++-- comp/src/gb.settings/.project | 2 +- main/gbx/gbx_number.c | 10 ++++++++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 078929ef3..035631354 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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],, diff --git a/comp/src/gb.settings/.project b/comp/src/gb.settings/.project index dcefd226a..292ed88a0 100644 --- a/comp/src/gb.settings/.project +++ b/comp/src/gb.settings/.project @@ -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 diff --git a/main/gbx/gbx_number.c b/main/gbx/gbx_number.c index df1ed3962..ad044efe1 100644 --- a/main/gbx/gbx_number.c +++ b/main/gbx/gbx_number.c @@ -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;