From 786b26b1341a43a2b7fdffee3fd003375e9d32fc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 8 May 2012 07:05:32 +0200 Subject: Fix int/size_t conversion warnings --- tests/cxx/tree/binary/xdr/driver.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/cxx') 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 (p)); - std::size_t size (dst->size ()); + size_t n (static_cast (in)), size (dst->size ()); dst->size (size + n); memcpy (dst->data () + size, buf, n); - return n; + return static_cast (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 (p)); - std::size_t size (ui->buf->size () - ui->pos); + size_t n (static_cast (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 (n); } int -- cgit v1.1