paragui-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [paragui-users] PG_Rect and const


From: Alexander Pipelka
Subject: Re: [paragui-users] PG_Rect and const
Date: 03 Jun 2002 12:57:54 +0200

Am Son, 2002-06-02 um 10.22 schrieb Eric Ross:
> I've working on the pgmpeg stuff and i got some problem with the way the
> Width()/Height() methods are defined. I have this code:
> 
> 
> PG_MPEGPlayerWindow(char *file, PG_Widget *parent, const PG_Rect & r)
>           : PG_Window(parent, r, "The Player")
>       {
>               const Uint16 w = r.Width();      // Line 18
> ..
> 
> compiling this i got:
> 
> pgmpegplayerwindow.h:18: passing `const PG_Rect' as `this' argument of `Uint16
> PG_Rect::Width()' discards qualifiers
> 
> This is because 'r' is a const, and the method isn't. If i modify the relevant
> .h to:
> 
> inline Uint16 Width() const {
>       return w;
> }
> 
> it compiles fine. I propose changing the definition of these funciont and add 
> a
> "const", but i dont know if it breaks anything (i just modify the installed 
> .h,
> i didnt recompile). Any suggestion ?

Wow. I checked that. You're right :))

Ok. I fixed this for 1.0.2 ("devel-1-0" branch).
If you need this for 1.1.x you can safely change and commit that.

Alex






reply via email to

[Prev in Thread] Current Thread [Next in Thread]