Click here to Skip to main content
15,906,106 members

Comments by Dan page (Top 53 by date)

Dan page 4-Jul-13 8:39am View    
nv3 One more thing. You write:

"And all that under the assumption that the binary format of the Blob object is really compatible to an array of SomeStructure"

Now that I read it this is *really* important right, otherwise members of the SomeStructure will not get correctly initialized (if the format of Blob does not reflect structure of SomeStructure)?? right?? Thanks.
Dan page 4-Jul-13 2:28am View    
Hi, yes, but if we forget efficiency for a moment - it works at least right. It seemed bit suspicious to me too initially, but now that I look at it I think it will work. The cast will seem to work and ptr++ will also move to the next SomeStruct element appropriately.
Dan page 3-Jul-13 10:49am View    
hi H.Brydon, what do you mean with "Go for it"? as I mentioned this is not my code, I am analyzing reading someone else's code; I might need to modify it at times though.
Dan page 3-Jul-13 10:31am View    
Hi, the data inside the Blob class I think is stored as: void * data; (so it may indeed contain contigious array of SomeStructure objects).
This is not my code.
Sometimes they use this keyword in data structures: __packed (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/CJAFJHJD.html) - maybe that is how they defeat issues with the padding?
thanks.
Dan page 2-Jul-13 17:04pm View    
Hi CPallini, thanks, just as I remember it was other way around, meaning in my example, say CustomStruct contains four elements first three int-s and one char. Then, OtherCustomStruct would contain just those first three int-s.