RE: Use of "unsigned" for non-enumeration values

> -----Original Message-----
> From:	Arnold, Curt [SMTP:Curt.Arnold@hyprotech.com]
> Sent:	Thursday, March 28, 2002 6:34 PM
> To:	'www-dom@w3.org'
> Subject:	Use of "unsigned" for non-enumeration values
> 
> Except when there is need for that extra bit of range, it seems undesirable
> to make integer arguments or writable attributes that are not enumerations
> "unsigned".  It doesn't matter in Java or JavaScript, since neither supports
> the concept of unsigned numbers.  It does, however, make implementations in
> other language either fail differently or incorrectly succeed, since C and
> C++ will transparently convert a negative signed number into a large
> positive number.
> 
	Actually in C at least I believe most users would prefer 'int' because it's much easier to type and on most systems INT_MAX is 2GB whereas UINT_MAX is 4GB which means using unsigned is only
(maybe) useful for marking stream positions and file sizes. The use of unsigned long in methods like:

	    void deleteData(in unsigned long offset, 
	                                       in unsigned long count)
	                                       raises(DOMException);

	is obviously not necessary. On systems where int is 16 bits or less a dom should probably not be manipulating continuous strings of 32K considering the machine probably wouldn't have much more
main memory than that.

	Mike

Received on Thursday, 28 March 2002 18:53:59 UTC