Closed GoogleCodeExporter closed 8 years ago
Ok, I see, but the problem of using GParamSpecLong and GParamSpecInt64 to hold
ULONG and UINT64 properties is that overflows can occur if the property value
is too large for the signed type.
Original comment by andres.c...@gmail.com
on 28 Feb 2011 at 4:02
This issue was closed by revision r482.
Original comment by andres.c...@gmail.com
on 1 Mar 2011 at 8:51
Ok, after some more thinking, there is no problem of using the long and int64
param types to hold the ulong and uint64 property values. But the programmer
has to be careful later to treat the values appropriately since in artithmetic
operations Java will consider them as signed. There are ways to handle these
situations, for example using the BigInteger type:
http://download.oracle.com/javase/1.4.2/docs/api/java/math/BigInteger.html
or doing some tricks:
http://www.javamex.com/java_equivalents/unsigned_arithmetic.shtml
Original comment by andres.c...@gmail.com
on 1 Mar 2011 at 8:51
I'm not sure if overflows could be occur. The unsigned keyword affects the
interpretation, not the representation of a number-. In cases where we aren't
interpreting a value arithmetically it makes essentially no difference whether
a value is marked as "signed" or "unsigned". Moreover, UINT64 and ULONG are so
bigger that it rarely will use in a simple property, i think.
Otherwise, i found lots of properties in different elements that i couldn't
use, cause of this restriction. In my opinion, i prefer have access to this
properties than gets an IllegalArgumentException.
Original comment by Drako...@gmail.com
on 1 Mar 2011 at 9:40
oh sorry, I have answered about your monday's response. I agree with you. In
addition, we read the same documentation.
Regards,
David.
Original comment by Drako...@gmail.com
on 1 Mar 2011 at 9:46
Original issue reported on code.google.com by
Drako...@gmail.com
on 7 Feb 2011 at 9:58