This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch for Review: JvGetStringUTF and JvTempCString


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/





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]