This site is no longer active and is available for archival purposes only. Registration and login is disabled.

datatype misalignment


Re: datatype misalignment

Postby Dan East » Jan 6, 2002 @ 10:00pm

That would work, but the additional overhead of calling memcpy to copy 4 bytes is not worth it. I would (and did) just copy the bytes over one at time.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: datatype misalignment

Postby simonjacobs » Jan 6, 2002 @ 10:45pm

sure, i totally agree. but if rob is having difficulty with the btye copy, and this is only being called once in a load file function where the speed penalty is irrelevant maybe its the best solution.<br><br>the byte copy is clearly best, and shouldnt be too hard to get working.
User avatar
simonjacobs
pm Insider
 
Posts: 311
Joined: Nov 27, 2001 @ 4:51pm
Location: London, UK


Re: datatype misalignment

Postby Digby » Jan 6, 2002 @ 11:45pm

Would this help?<br><br>*(__unaligned ULONG*)p = wadfiles->filesize;<br>p += sizeof(ULONG);<br><br>The advantage of this is that the compiler generates the code inline to do what Dan did with the shifting and byte loading (stores in your case).<br><br><br>Sorry about my wisecracks before.  I should add to my list of New Year's resolutions to hold off posting a message for 30 mins or so after I type it.  That would make me think twice about posting such drivel.  I suppose I was a bit frustrated that I couldn't seem help you solve your problem when the answer was so obvious to me.<br><br>
Digby
pm Insider
 
Posts: 1011
Joined: Apr 29, 2001 @ 1:53pm


Re: datatype misalignment

Postby R0B » Jan 7, 2002 @ 5:19pm

That's cool.  Yeah, guess I was a little frustrated too.  If I hadn't stopped to fix the palette, I probably would have tossed my 720 out the window (In a well protected case of course so it wouldn't get injured).  Let's hope this works.
"1011001010 NNNNNNNNNNOOOOOOOOOOOOOOOO!!!!!!" -Bender
User avatar
R0B
got muffins?
 
Posts: 1894
Joined: Jun 22, 2001 @ 12:04pm


Re: datatype misalignment

Postby R0B » Jan 7, 2002 @ 6:37pm

You can put a fork in this thread because it is done.  Thanks Digby, your last sugestion works like a charm.
"1011001010 NNNNNNNNNNOOOOOOOOOOOOOOOO!!!!!!" -Bender
User avatar
R0B
got muffins?
 
Posts: 1894
Joined: Jun 22, 2001 @ 12:04pm


Previous

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum