summaryrefslogtreecommitdiff
path: root/gcc/wide-int-print.cc
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-07 09:23:32 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2013-09-07 09:23:32 +0000
commit796b6678b7a5be26e44d64a3b299ac5a8f0877e2 (patch)
tree4e81b82b3b3a04b8f3a48aa7c3dc3d336f8a185c /gcc/wide-int-print.cc
parente02d19d4264184dbf4aec0a7f1a31db9a6471ff4 (diff)
downloadgcc-796b6678b7a5be26e44d64a3b299ac5a8f0877e2.tar.gz
Reorganise wide-int classes so that they are all instantiations of a
generic_wide_int class, parameterised by storage. Move all real work outside the main wide_int classes into separate functions. Add a wi:: namespace. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@202354 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/wide-int-print.cc')
-rw-r--r--gcc/wide-int-print.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/wide-int-print.cc b/gcc/wide-int-print.cc
index 29eb9299f79..c83d9e44a0d 100644
--- a/gcc/wide-int-print.cc
+++ b/gcc/wide-int-print.cc
@@ -61,7 +61,7 @@ print_decs (const wide_int &wi, char *buf)
if ((wi.get_precision () <= HOST_BITS_PER_WIDE_INT)
|| (wi.get_len () == 1))
{
- if (wi.neg_p ())
+ if (wi::neg_p (wi))
sprintf (buf, "-" HOST_WIDE_INT_PRINT_UNSIGNED, -wi.to_shwi ());
else
sprintf (buf, HOST_WIDE_INT_PRINT_DEC, wi.to_shwi ());
@@ -88,7 +88,7 @@ void
print_decu (const wide_int &wi, char *buf)
{
if ((wi.get_precision () <= HOST_BITS_PER_WIDE_INT)
- || (wi.get_len () == 1 && !wi.neg_p ()))
+ || (wi.get_len () == 1 && !wi::neg_p (wi)))
sprintf (buf, HOST_WIDE_INT_PRINT_UNSIGNED, wi.to_uhwi ());
else
print_hex (wi, buf);
@@ -110,11 +110,11 @@ print_hex (const wide_int &wi, char *buf)
{
int i = wi.get_len ();
- if (wi.zero_p ())
+ if (wi == 0)
buf += sprintf (buf, "0x0");
else
{
- if (wi.neg_p ())
+ if (wi::neg_p (wi))
{
int j;
/* If the number is negative, we may need to pad value with