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: Tom Tromey <tromey at redhat dot com>
- To: gnustuff at thisiscool dot com
- Cc: GCJ Patches <java-patches at gcc dot gnu dot org>
- Date: 07 Aug 2003 17:40:49 -0600
- Subject: Re: Patch for Review: JvGetStringUTF and JvTempCString
- References: <MIROKJ51QPGD93GDXRTNDBTSIH85JEXS.3f2fe614@d7500>
- Reply-to: tromey at redhat dot com
>>>>> "Mohan" == Mohan Embar <gnustuff@thisiscool.com> writes:
Mohan> * gcj/cni.h: Added function JvGetStringUTF (puts and null
Mohan> terminates a jstring into a character buffer) and class
Mohan> JvTempCString (helper class for getting a temporary C string
Mohan> from a jstring)
Sorry for yet another go around on this...
I'm not ready to put this class in cni.h yet. How about jvm.h? And
change it to _Jv_TempUTFString. I think we want to be explicit about
the UTF, we'll probably want another version that converts to the
default encoding.
As for the function, it can definitely go in cni.h. However, you'll
also need to update gcj.texi to document it. Shouldn't we call it
"JvGetStringUTFChars"?
Mohan> + operator const char*() const {return buf_;}
These should be formatted like:
operator const char*() const
{
return buf_;
}
Mohan> +inline JvTempCString::JvTempCString (jstring jstr):
Mohan> + buf_(0)
The ":" should be on the next line.
inline JvTempCString::JvTempCString (jstring jstr)
: buf_(0)
Mohan> + if (len < jsize(sizeof(stackbuf_)-1))
Mohan> + {
Mohan> + buf_ = stackbuf_;
Mohan> + }
And there's no need to put braces around a single statement.
Tom