From 8e3e5bd0ce836c3f4e5b8a5318eccd701d8b3643 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Wed, 25 Aug 2004 20:45:23 +0000 Subject: [PATCH] Sun Workshop warning fixes Use new not malloc in C++ code git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6147 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/allegrocl.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/Modules/allegrocl.cxx b/Source/Modules/allegrocl.cxx index d29059003..860253602 100644 --- a/Source/Modules/allegrocl.cxx +++ b/Source/Modules/allegrocl.cxx @@ -16,7 +16,7 @@ public: static File *f_cl=0; static File *f_null=0; -char *identifier_converter="identifier-convert-null"; +const char *identifier_converter="identifier-convert-null"; int any_varargs(ParmList *pl) { Parm *p; @@ -206,8 +206,9 @@ void ALLEGROCL :: main(int argc, char *argv[]) { identifier_converter="identifier-convert-null"; } else { /* Must be user defined */ - identifier_converter = (char *)malloc(strlen(conv)+1); - strcpy(identifier_converter, conv); + char *idconv = new char[strlen(conv)+1]; + strcpy(idconv, conv); + identifier_converter=idconv; } }