summaryrefslogtreecommitdiffstats
path: root/libdecnumber/decNumber.c
Commit message (Collapse)AuthorAgeFilesLines
* libdecnumber: Fix warnings from smatch (missing static, boolean operations)Stefan Weil2014-08-241-10/+11
| | | | | Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* libdecnumber: Fix decNumberSetBCDTom Musta2014-06-161-1/+1
| | | | | | | | | | | Fix a simple bug in the decNumberSetBCD() function. This function encodes a decNumber with "n" BCD digits. The original code erroneously computed the number of declets from the dn argument, which is the output decNumber value, and hence may contain garbage. Instead, the input "n" value is used. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* libdecnumber: Introduce decNumberIntegralToInt64Tom Musta2014-06-161-1/+45
| | | | | | | | | | | | Introduce a new conversion function to the libdecnumber library. This function converts a decNumber to a signed 64-bit integer. In order to support 64-bit integers (which may have up to 19 decimal digits), the existing "powers of 10" array is expanded from 10 to 19 entries. Signed-off-by: Tom Musta <tommusta@gmail.com> [agraf: fix 32bit host compile] Signed-off-by: Alexander Graf <agraf@suse.de>
* libdecnumber: Introduce decNumberFrom[U]Int64Tom Musta2014-06-161-0/+30
| | | | | | | | | Introduce two conversion functions to the libdecnumber library. These conversions transform 64 bit integers to the internal decNumber representation. Both a signed and unsigned version is added. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* libdecnumber: Eliminate Unused Variable in decSetSubnormalTom Musta2014-06-161-2/+0
| | | | | | | | | Eliminate an unused variable in the decSetSubnormal routine. The variable dnexp is declared and eventually set but never used, and thus may trigger an unused-but-set-variable warning. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* libdecnumber: Prepare libdecnumber for QEMU include structureTom Musta2014-06-161-3/+3
| | | | | | | | | | | | | | | | | | Consistent with other libraries in QEMU, the libdecnumber header files were placed in include/libdecnumber, separate from the C code. This is different from the original libdecnumber source, where they were co-located. Change the libdecnumber source code so that it reflects this split. Specifically, modify directives of the form: #include "xxx.h" to look like: #include "libdecnumber/xxx.h" Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
* libdecnumber: Introduce libdecnumber CodeTom Musta2014-06-161-0/+8122
Add files from the libdecnumber decimal floating point library to QEMU. The libdecnumber library was originally part of GCC and contains code that is useful in emulating the PowerPC decimal floating point (DFP) instructions. This particular copy of the source comes from GCC 4.3 and is licensed at GPLv2+. Signed-off-by: Tom Musta <tommusta@gmail.com> Signed-off-by: Alexander Graf <agraf@suse.de>
OpenPOWER on IntegriCloud