summaryrefslogtreecommitdiffstats
path: root/luni/src/main/native/NativeDecimalFormat.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make all filenames match their classes.Elliott Hughes2011-03-031-355/+0
| | | | Change-Id: I2c9f95a27ee3881fc609e3e4f1468205c701215d
* More icu4jni reshuffling.Elliott Hughes2010-10-011-6/+5
| | | | | Bug: 3045778 Change-Id: Iafb367f97d1fb169c6106adad0525cfcc0e10f25
* Use DecimalFormatSymbols.getExponentSeparator in DecimalFormat.Elliott Hughes2010-09-161-7/+9
| | | | | | | A last-minute bit of Java 6 work... Bug: 3008411 Change-Id: Ic197de8ddc92afcaa661875a2c99c8352237642a
* Return char[] instead of String from NativeDecimalFormat.Elliott Hughes2010-09-161-13/+15
| | | | | | | One last little speedup for Formatter %f before I call it a day for now... Bug: 2934304 Change-Id: I9edd02d1ba8dc40a2b28fea34d7bccf95eeb56ab
* Fix last few uses of "type *id" to be "type* id".Elliott Hughes2010-08-131-3/+3
| | | | | | We don't want anyone calling us unreformed C programmers... Change-Id: I79b12245b206495ca747b4027b2bca423c27aec0
* Remove most of our C-style casts.Elliott Hughes2010-08-121-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After being burned by an incorrect C-style cast that cast away const, I've been keen to remove them all and turn on -Wold-style-cast. This patch doesn't get us that far, but it does kill the majority of our C-style casts. In turn, the majority of the casts that it removes are the ones from our tables of native methods to be registered. The new NATIVE_METHOD macro also _enforces_ our convention of using the "Class_nativeMethod" style of naming. Mostly this works out fine. In some cases (most notably ExpatParser and ExpatAttributes) I've had to un-overload a few functions, but I don't like overloading anyway, and in the particular case of a native method, where the stack trace doesn't show a line number, overloading makes it one step harder to work out which native method you're actually in. So good riddance to that. The only unfortunate case is Math.copySign, where there are two overloads corresponding to copysign(3) and copysignf(3). I had to add an extra layer of indirection there. In my defense, we've never shipped these functions before, they're unlikely to become anyone's hotspot, and the right fix is to be doing such trivial work on the Java side anyway, with intrinsics making the conversion between float/double and int/long cheap. This patch also replaces other C-style casts, primarily in "OSNetworkSystem.cpp". This patch also removes unnecessary uses of the "struct" keyword. This patch also fixes a "may be used uninitialized" warning (now error) in the sim build for "ICU.cpp". The remaining C-style casts are in the hairy float-parsing code. That stuff -- and turning on -Wold-style-cast -- will have to wait for another day. Change-Id: I9b3ee14aefd4676f980f6a7ca757595d78d80e6a
* Remove more of our C-style casts, fix more of our native method names.Elliott Hughes2010-07-221-36/+34
| | | | Change-Id: I08d7915e22faf091489171240d2f9bf8b3acecca
* Add null-pointer checking to ScopedPrimitiveArray.Elliott Hughes2010-07-121-6/+7
| | | | | | | | | | | | | | This style worked well for ScopedUtfChars. It moves null-pointer checking inside the class, thereby encouraging us to remember to check for the unlikely out-of-memory failures too. I've also broken up some tests that were trying to check multiple scoped arrays at once. This idiom was broken because as soon as there's a pending exception, it's a JNI error to even attempt to set up the next scoped primitive array. In the absence of C++ exceptions, we have to check these one by one. Change-Id: I2f4b397ae2873597e309d86fcc5912f3fcf0f304
* Stop using GetStringChars/ReleaseStringChars.Elliott Hughes2010-06-221-69/+36
| | | | | | | | | | Also fix unused variable warnings in "ExpatParser.cpp". This fixes one actual bug in the regular expression code where we weren't returning after throwing an exception from JNI, in a case where executing the remaining code in the native method would cause a crash. Change-Id: Ib5ce7ea9a3b6476cf47bda2384d5ba43579c785a
* Remove dynamic calls to FindClass.Elliott Hughes2010-06-161-17/+8
| | | | | | | | | | | | | | | | | | | | | Initially, I was just fixing a threading bug in NativeDecimalFormat.cpp where we were bypassing GCC's built-in static initializer thread safety. This led me to the question of how expensive FindClass is, which led me to creating a new canonical cache of jclasses. Here's the motivating benchmark, showing the cost of calling an empty regular (non-native) method, an empty native method, a native method that calls FindClass, a native method that calls FindClass and GetFieldID, and a native method that calls FindClass and GetMethodID: benchmark ns logarithmic runtime NoArgsRegular 74 |||||||||||||| NoArgsNative 428 XX||||||||||||||||||| FindClass 3064 XXXXXXXXXXXXXXXX||||||||||| FindClassGetField 3654 XXXXXXXXXXXXXXXXXXX||||||||| FindClassGetMethod 5634 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Change-Id: I41ab2b347895f043a7e21d8fa19e4541e198c3fc
* Use Integer.valueOf rather than "new Integer" (et cetera) from JNI.Elliott Hughes2010-06-151-23/+13
| | | | | | Also factor it out rather than keep duplicating it. Change-Id: I6349668f4676f1e0a7dd6fdc101dd1784c5465fb
* ICU4.4.1 upgradeclaireho2010-06-041-326/+127
| | | | | | | | | | 1. Replaced the temp Android patch for BigDecimal support with ICU APIs. 2. Changed ICU.cpp for resource re-structure in ICU4.4 release. 3. Fixed the test data for NumberFormat test caused by the locale data changes. Change-Id: I307e798f1a135a5024a693d23363733d020ed22f
* Enable -Wall -Wextra for libcore and cleanup all but one warningBrian Carlstrom2010-05-071-17/+13
| | | | Change-Id: Ied76662c470ba878cec61189acf29f5cbbd4ccd4
* Merge awt-kernel, icu, luni-kernel, prefs, security-kernel, x-net into luniPeter Hallam2010-05-041-0/+608
Merge xml except xmlpull and kxml into luni