aboutsummaryrefslogtreecommitdiff
path: root/tests/cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-05-08 07:05:32 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-05-08 07:05:32 +0200
commit786b26b1341a43a2b7fdffee3fd003375e9d32fc (patch)
tree07606c6f33cf7094ba55ae46a721fce1293f4e76 /tests/cxx
parentc8990f28cd12b4ed61790c65078c7df61944e866 (diff)
Fix int/size_t conversion warnings
Diffstat (limited to 'tests/cxx')
-rw-r--r--tests/cxx/tree/binary/xdr/driver.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/cxx/tree/binary/xdr/driver.cxx b/tests/cxx/tree/binary/xdr/driver.cxx
index afce978..9c1e3c2 100644
--- a/tests/cxx/tree/binary/xdr/driver.cxx
+++ b/tests/cxx/tree/binary/xdr/driver.cxx
@@ -17,15 +17,15 @@ using namespace std;
using namespace test;
extern "C" int
-overflow (char* p, char* buf, int n)
+overflow (char* p, char* buf, int in)
{
xml_schema::buffer* dst (reinterpret_cast<xml_schema::buffer*> (p));
- std::size_t size (dst->size ());
+ size_t n (static_cast<size_t> (in)), size (dst->size ());
dst->size (size + n);
memcpy (dst->data () + size, buf, n);
- return n;
+ return static_cast<int> (n);
}
struct underflow_info
@@ -35,17 +35,17 @@ struct underflow_info
};
extern "C" int
-underflow (char* p, char* buf, int n)
+underflow (char* p, char* buf, int in)
{
underflow_info* ui (reinterpret_cast<underflow_info*> (p));
- std::size_t size (ui->buf->size () - ui->pos);
+ size_t n (static_cast<size_t> (in)), size (ui->buf->size () - ui->pos);
n = size > n ? n : size;
memcpy (buf, ui->buf->data () + ui->pos, n);
ui->pos += n;
- return n;
+ return static_cast<int> (n);
}
int