delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/03/02/15:38:30

From: werewolf AT stad DOT dsl DOT nl (Shadow Seeker)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Real stupid problem.
Date: Tue, 02 Mar 1999 20:10:32 GMT
Organization: Shimmer Zone
Lines: 21
Message-ID: <36dc14d8.14275007@news.tudelft.nl>
References: <36db1881 DOT 8437368 AT news DOT tudelft DOT nl> <XUjXQRC1Sz22Ewil AT xemu DOT demon DOT co DOT uk>
NNTP-Posting-Host: willow.akira.tudelft.nl
X-Trace: news.tudelft.nl 920405603 25099 130.161.60.189 (2 Mar 1999 20:13:23 GMT)
X-Complaints-To: usenet AT news DOT tudelft DOT nl
NNTP-Posting-Date: 2 Mar 1999 20:13:23 GMT
X-Newsreader: Forte Free Agent 1.11/32.235
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Tue, 2 Mar 1999 00:45:41 +0000, Dave Bird <dave AT xemu DOT demon DOT co DOT uk>
wrote:

>>And if so, how do I fix it?

>If you need to minimize this padding (e.g., if your program uses large
>arrays of such structs, where padding will waste a lot of memory), lay
>out structures so that the longer members are before the shorter ones. 
 No, that won't do, I can't design the structs, I read datafiles that
use them. But Endlisnis gave me a clue that works perfectly.

 Just add "__attribute__(packed)" behind the struct and things work
just fine.

>so try this....
 [Sniped struct]

  Then my data would be garbled wouldn't it :)
  But thanks anyway...

ShadSek

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019