delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/03/26/12:12:17

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
Message-ID: <49CBB9B4.3030707@gmail.com>
Date: Thu, 26 Mar 2009 17:21:56 +0000
From: Dave Korn <dave DOT korn DOT cygwin AT googlemail DOT com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: Problems when moving Ubuntu -> Cygwin -SOLVED
References: <fac6c19a0903260312p59871165gaf2e8fff62ac35d8 AT mail DOT gmail DOT com>
In-Reply-To: <fac6c19a0903260312p59871165gaf2e8fff62ac35d8@mail.gmail.com>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Mikael Normark wrote:
> I addedd __attrubute__((packed)) to both structures and that made it
> all work as supposed to. 

  Gah, ISHFRTT!  At least the use-specifically-sized-types advice is still good.

> Adding "packed" to the sample_pkg_t only
> saved 2 bytes, 

  What!?  That looks like a typo.  I think you mean 4 bytes.

> adding it to sample_t saved the rest down to 396 so
> obviously that structure is poorly aligned.

  No, it's just that it has more than one sample_t in it, and *each* sample_t
has four bytes of padding.  32 * 4 = 128 = the difference between the 396
bytes packed and the 524 bytes unpacked.  (SAMPLES_IN_PKG is 32, isn't it?)

    cheers,
      DaveK


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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