From 5fd4b6122354ebd4ee76f80ea5f79fcbb331681b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 7 Oct 2010 14:46:39 +0200 Subject: Cast off constness when freeing with custom allocator --- xsde/cxx/serializer/attribute-validation-source.cxx | 4 ++-- xsde/cxx/serializer/element-validation-source.cxx | 4 ++-- xsde/cxx/serializer/serializer-source.cxx | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/xsde/cxx/serializer/attribute-validation-source.cxx b/xsde/cxx/serializer/attribute-validation-source.cxx index 7dea3c3..8bea35a 100644 --- a/xsde/cxx/serializer/attribute-validation-source.cxx +++ b/xsde/cxx/serializer/attribute-validation-source.cxx @@ -343,8 +343,8 @@ namespace CXX os << "delete[] ns;" << "delete[] name;"; else - os << "::xsde::cxx::free (ns);" - << "::xsde::cxx::free (name);"; + os << "::xsde::cxx::free (const_cast (ns));" + << "::xsde::cxx::free (const_cast (name));"; os << "}" << "if (!r)" << endl diff --git a/xsde/cxx/serializer/element-validation-source.cxx b/xsde/cxx/serializer/element-validation-source.cxx index ea5fec2..3ca784d 100644 --- a/xsde/cxx/serializer/element-validation-source.cxx +++ b/xsde/cxx/serializer/element-validation-source.cxx @@ -750,8 +750,8 @@ namespace CXX os << "delete[] ns;" << "delete[] name;"; else - os << "::xsde::cxx::free (ns);" - << "::xsde::cxx::free (name);"; + os << "::xsde::cxx::free (const_cast (ns));" + << "::xsde::cxx::free (const_cast (name));"; os << "}" << "if (!r)" << endl diff --git a/xsde/cxx/serializer/serializer-source.cxx b/xsde/cxx/serializer/serializer-source.cxx index 1dbe496..029fba3 100644 --- a/xsde/cxx/serializer/serializer-source.cxx +++ b/xsde/cxx/serializer/serializer-source.cxx @@ -1392,8 +1392,8 @@ namespace CXX os << "delete[] ns;" << "delete[] name;"; else - os << "::xsde::cxx::free (ns);" - << "::xsde::cxx::free (name);"; + os << "::xsde::cxx::free (const_cast (ns));" + << "::xsde::cxx::free (const_cast (name));"; os << "}" << "if (!r)" << endl @@ -1652,8 +1652,8 @@ namespace CXX os << "delete[] ns;" << "delete[] name;"; else - os << "::xsde::cxx::free (ns);" - << "::xsde::cxx::free (name);"; + os << "::xsde::cxx::free (const_cast (ns));" + << "::xsde::cxx::free (const_cast (name));"; os << "}" << "if (!r)" << endl -- cgit v1.1