On 03.03.2015 12:23, Martin Buchholz wrote:


On Tue, Mar 3, 2015 at 12:15 AM, Ivan Gerasimov <[email protected] <mailto:[email protected]>> wrote:

    Thanks Martin for the suggestion!

    On 03.03.2015 0:08, Martin Buchholz wrote:
    slightly safer (more likely to compile everywhere) might be to
    convert input length into a size_t immediately and to

    I'm not quite sure it would be correct.
    If size_t happens to be 32-bit int, then the length could
    overflow, since it represents the size of the array in bytes,
    while we're operating on the the array of shorts, ints and longs.
    I would feel more comfortable if length gets cast to size_t only
    when it is guaranteed to be in the range (0, 1048576).


Sounds good to me!
It's still good practice to have both branches of a ternary expression have the same signedness.

Okay. But I don't want to make MBYTE unsigned, or we'll have '/comparing signed to unsigned/' compile-time warning.

BTW, it seems those static native methods like copyFromShortArray should have a jclass clazz second arg, not a jobject this.
Cool! I'll include fixing that too.

http://cr.openjdk.java.net/~igerasim/8074067/2/webrev/src/java.base/share/native/libjava/Bits.c.sdiff.html

Sincerely yours,
Ivan


Reply via email to