[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: [PATCH] Fix KApplication for non-gui apps
From:       George Staikos <staikos () kde ! org>
Date:       2005-02-17 14:48:05
Message-ID: 200502170948.05696.staikos () kde ! org
[Download RAW message or body]

On Thursday 17 February 2005 05:13, Clarence Dang wrote:
> On Thu, 17 Feb 2005 01:40 pm, George Staikos wrote:
> >    This evening, on the second most lousy flight I've ever been on (Air
> > Canada can really suck sometimes), I got a chance to implement this patch
> > for KApplication that Lars and I (well, mostly Lars) came up with.  It
> > should fix the problems with creating a pixmap in non-gui mode.  It seems
> > to be binary compatible, but it needs testing on different platforms. 
> > Any comments?
>
> -  QPixmap aIconPixmap;
> -  QPixmap aMiniIconPixmap;
> +  mutable QPixmap *aIconPixmap;
> +  mutable QPixmap *aMiniIconPixmap;
> +  char unused[sizeof(QPixmap)*2 - sizeof(QPixmap*)*2];
>
> Aren't you making an assumption that the padding between the 2 QPixmap's is
> equal to that between the 2 QPixmap *'s?

   This is mostly the question.  Are there any alignment problems with this on 
platforms we target?  There are alternative approaches such as:

struct {
QPixmap foo, bar;
} justforadding;

char unused[sizeof(justforadding)*2 - sizeof(QPixmap*)*2];

If there's no alignment issue then we don't need it anyway.

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic