[interfacekit] Re: A little help...
- From: "Ingo Weinhold" <bonefish@xxxxxxxxxxxxxxx>
- To: interfacekit@xxxxxxxxxxxxx
- Date: Wed, 12 Mar 2003 00:34:58 +0100 CET
"Adi Oanca" <e2joseph@xxxxxxxxxx> wrote:
>
> How do I get rid of this error message:
> src/kits/interface/Window.cpp: In method `bool BWindow::NeedsUpdate()
> const':
> src/kits/interface/Window.cpp:1126: passing `const BLooper' as `this'
> argument of `bool BLooper::Lock()' discards qualifiers
> src/kits/interface/Window.cpp:1128: passing `const BWindow' as `this'
> argument of `void BLooper::Unlock()' discards qualifiers
>
>
> bool BWindow::NeedsUpdate() const{
> PortLink::ReplyData replyData;
>
> serverLink->SetOpCode( AS=5FNEEDS=5FUPDATE );
>
> Lock();
> serverLink->FlushWithReply( &replyData );
> Unlock();
>
> delete replyData.buffer;
>
> return replyData.code =3D=3D SERVER=5FTRUE;
> }
Either you don't declare the method const, or you need to cast the
const away. Like `const=5Fcast<BWindow*>(this)->Lock()'. Unless there
were good reasons not to do that, I would favor the former.
CU, Ingo
- References:
- [interfacekit] A little help...
- From: Adi Oanca
Other related posts:
- » [interfacekit] A little help...
- » [interfacekit] Re: A little help...
- » [interfacekit] Re: A little help...
- [interfacekit] A little help...
- From: Adi Oanca