You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING. If not, write to the Free
- Software Foundation, 59 Temple Place - Suite 330, Boston, MA
- 02111-1307, USA. */
+ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA. */
/* ------------------------------------------------------------------ */
/* This module comprises the routines for decimal128 format numbers. */
#include <stdio.h> /* [for printf] */
#define DECNUMDIGITS 34 /* we need decNumbers with space for 34 */
+#include "config.h"
#include "decNumber.h" /* base number library */
#include "decNumberLocal.h" /* decNumber local types, etc. */
#include "decimal128.h" /* our primary include */
#include "decUtility.h" /* utility routines */
#if DECTRACE || DECCHECK
-void decimal128Show (decimal128 *); /* for debug */
-void decNumberShow (decNumber *); /* .. */
+void decimal128Show (const decimal128 *); /* for debug */
+void decNumberShow (const decNumber *); /* .. */
#endif
/* Useful macro */
/* power of ten, or if the exponent on a zero had to be clamped. */
/* ------------------------------------------------------------------ */
decimal128 *
-decimal128FromNumber (decimal128 * d128, decNumber * dn, decContext * set)
+decimal128FromNumber (decimal128 * d128, const decNumber * dn, decContext * set)
{
uInt status = 0; /* status accumulator */
Int pad = 0; /* coefficient pad digits */
/* No error is possible. */
/* ------------------------------------------------------------------ */
decNumber *
-decimal128ToNumber (decimal128 * d128, decNumber * dn)
+decimal128ToNumber (const decimal128 * d128, decNumber * dn)
{
uInt msd; /* coefficient MSD */
decimal128 wk; /* working copy, if needed */
/* No error is possible, and no status can be set. */
/* ------------------------------------------------------------------ */
char *
-decimal128ToString (decimal128 * d128, char *string)
+decimal128ToString (const decimal128 * d128, char *string)
{
decNumber dn; /* work */
decimal128ToNumber (d128, &dn);
}
char *
-decimal128ToEngString (decimal128 * d128, char *string)
+decimal128ToEngString (const decimal128 * d128, char *string)
{
decNumber dn; /* work */
decimal128ToNumber (d128, &dn);
/* If an error occurs, the result will be a valid decimal128 NaN. */
/* ------------------------------------------------------------------ */
decimal128 *
-decimal128FromString (decimal128 * result, char *string, decContext * set)
+decimal128FromString (decimal128 * result, const char *string, decContext * set)
{
decContext dc; /* work */
decNumber dn; /* .. */
/* ------------------------------------------------------------------ */
/* Also shows sign/cob/expconfields extracted */
void
-decimal128Show (decimal128 * d128)
+decimal128Show (const decimal128 * d128)
{
char buf[DECIMAL128_Bytes * 2 + 1];
Int i, j;