l4-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

_L4_msg_get_string_item


From: Daniel Godás
Subject: _L4_msg_get_string_item
Date: Thu, 7 Apr 2005 09:05:24 +0200

Hi,

i was reading some code when i came over this function. This is my version:

static inline _L4_word_t
_L4_attribute_always_inline
_L4_msg_get_string_item (_L4_msg_t msg, _L4_word_t nr, void *string_item)
{
  __L4_msg_tag_t tag = { .raw = _L4_msg_msg_tag (msg) };
  /* We do not break any strict aliasing rules here, as we only use
     the pointers for pointer arithmetic.  */
  _L4_word_t pos = 1 + tag.untyped + nr;
  int count;

  count = _L4_string_item_words (_string_item, 0);
  __builtin_memcpy (string_item, &msg[pos], sizeof (_L4_word_t) * count);

  return count;
}

I just dont understand the one on the cvs but i think it wouldnt work.
What do you think about it?

cheers,
Daniel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]