Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • "Should be zero" assuming appropriate endianess. Commented Aug 7, 2010 at 1:05
  • No, "should be zero" meaning that he explicitly said ContentID=0 in the example, and given that the second piece of code ANDs the result with 0x7ff, it looks like he's going for ContentID. Commented Aug 7, 2010 at 1:08
  • Why define an intermediate pointer to SysData ? Just read MsgHdr.SystemID or MsgHdr.ContentID as needed. Commented Aug 7, 2010 at 1:16
  • Depends on what type MsgHdr is - My guess was that the second code block read a data stream, and MsgHdr was a pointer to raw data or something. I have no explanation why else he would go through the complicated way of extracting the information via bit-shifts rather than just reading the members directly. Commented Aug 7, 2010 at 1:19
  • Your guess may be right or it could be some newbie error. I don't understand either why he is doing things that way. The question probably need some more details (and fully working code sample instead of fragments would also be cool). Commented Aug 7, 2010 at 1:31