[interfacekit] Re: A little help...

"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


Other related posts: