activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Timothy Bish <tab...@twcny.rr.com>
Subject Re: char signedness
Date Wed, 06 Jun 2007 22:52:26 GMT
Agreed, unsigned makes much more sense.

Hiram Chirino wrote:
> I vote keep it unsigned.  Signed bytes in Java were a mistake IMO.
> Almost every time I have to work with bytes in Java I have to do the
> "& 0xFF" tricks to turn it unsigned.
>
> Regards,
> Hiram
>
> On 5/25/07, Motl <motl@orcsoftware.com> wrote:
>>
>> At the moment, 'unsigned char' is used for BytesMessage 
>> representation in
>> C++,  whereas signed char is used in Java, that means the same 
>> message will
>> be encoded differently in Java and C++! I agree that 'unsigned char' 
>> (or,
>> precisely,  uint8_t) is more suitable for 'byte' type in C/C++, but 
>> if we
>> follow JMS standard, we should use 'signed char' instead. The 
>> representation
>> of signed chars isn't a part of ANSI C Standard, but most compilers 
>> use 2's
>> complement, and so Java does.
>> Hereby, I propose to replace unsigned char with signed one.
>>
>> -- 
>> View this message in context: 
>> http://www.nabble.com/char-signedness-tf3814717s2354.html#a10798606
>> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
>>
>>
>
>





Mime
View raw message