This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch for Review: JvGetStringUTF and JvTempCString
- From: Mohan Embar <gnustuff at thisiscool dot com>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>, tromey at redhat dot com
- Cc: java-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2003 18:26:51 -0500
- Subject: Re: Patch for Review: JvGetStringUTF and JvTempCString
- Reply-to: gnustuff at thisiscool dot com
Hi Tom & Bryce,
>So maybe Mohan's class isn't needed after all...
Like I said here:
http://gcc.gnu.org/ml/java-patches/2003-q3/msg00311.html
These three lines of code:
char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (path) + 1);
jsize total = JvGetStringUTFRegion (path, 0, path->length(), buf);
buf[total] = '\0';
...are like fingernails on a blackboard for me, and they're not
limited to just natFile*.cc. I like the idea of encapsulating this
by a class and doing any necessary cleanup in the destructor.
Originally, I had put this in win32.h/.cc and you had asked me to
promote this to a more common area. If you now have a change of
heart, may I still use this in win32.h/.cc?
-- Mohan
http://www.thisiscool.com/
http://www.animalsong.org/