javaprims.h (_Jv_FormatInt): New declaration.

* gcj/javaprims.h (_Jv_FormatInt):  New declaration.
	* java/lang/natString.cc (_JvFormatInt):  New primitive, with logic
	taken from old Integer.toString code.
	(Integer::valueOf):  Use _Jv_FormatInt.
	* java/lang/Integer.java (toString):  Just use call String.valueOf.
	* java/lang/Long.java (toString):  Fix typo in comment.
	* java/lang/String.java (valueOf(int)):  Make native.
	* java/lang/StringBuffer.java (append(int)):  Make native.
	* java/lang/natStringBuffer.cc:  New file, for append(jint).
	* Makefile.am (ant_source_files):  Add java/lang/natStringBuffer.cc.

From-SVN: r42419
This commit is contained in:
Per Bothner 2001-05-21 21:38:37 -07:00 committed by Per Bothner
parent f5d6a24c2e
commit ef0a7b49a9
10 changed files with 98 additions and 40 deletions

View file

@ -273,7 +273,7 @@ public final class Long extends Number implements Comparable
if (num <= Integer.MAX_VALUE && num >= Integer.MIN_VALUE)
return Integer.toString((int) num);
// Use an arrary large enough for "-9223372036854775808"; i.e. 11 chars.
// Use an array large enough for "-9223372036854775808"; i.e. 20 chars.
char[] buffer = new char[20];
int i = 20;
boolean isNeg;