activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Motl <m...@orcsoftware.com>
Subject Re: char signedness
Date Fri, 08 Jun 2007 15:03:46 GMT

Yes, I'm doing it right now ) It's not a problem for me, so I just proposed.


Tim Bish wrote:
> 
> There really isn't any interoperability issues, if you want a signed 
> byte on the C++ side just cast and you are done. 
> 
> Motl wrote:
>> I do agree 'unsigned' is much more suitable for 'byte'. But the problem
>> here
>> is that we can't have Java-to-C++ interoperability if we leave different
>> signedness for 'byte'. If it's not critical,  okay.
>>
>>
>> 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.
>>>>
>>>>
>>>>       
>>> -- 
>>> Regards,
>>> Hiram
>>>
>>> Blog: http://hiramchirino.com
>>>
>>>
>>>     
>>
>>   
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/char-signedness-tf3814717s2354.html#a11028214
Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.


Mime
View raw message