[haiku-appserver] Re: BMessage AddData

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Tue, 12 Jul 2005 22:10:37 +0200 CEST

Korli <korli@xxxxxxxx> wrote:
> I'm having problems with BMessage::AddData(), typically when used 
> with a 
> B_UINT8_TYPE and with a size.

Is it used in the same way in BeOS? To me, using B_UINT8_TYPE with a 
size different of sizeof(uint8) looks wrong. And obviously, Eric (who 
wrote BMessage) thought in the same way.
Of course, maybe AddData() shouldn't care about this, but B_RAW_TYPE 
looks more appropriate here.

> As I don't understand fully this code, could someone have a look at 
> this 
> method ? It doesn't handle every type codes the same way which is 
> very 
> weird.

It can't treat every type in the same way, as all types have a special 
handling, ie. number types need to be endian-aware, same for entry_refs 
but even more complicated.

> I didn't find unit tests for this method. Having one would also be 
> great.

As every type adder uses this method, there are indirect unit tests for 
it - but that's obviously not enough :-)

> The problem appears in input_server : no key_states is found in input 
> messages, applications depending on these key states can't work as 
> expected.

See above.


Other related posts: