Re: Bug in reporter/stdrep in CS?

Mike Gist <[email protected]>
Newsgroups gmane.comp.graphics.crystalspace.devel
Message-ID <CAONw8qYZmw-AXu=araXuoo5MvMOotu0-s689UtQWDpyWJ5cp_w@mail.gmail.com>
Hey,

Your fix looks okay, though if you like you can simplify the code a little:

if (listeners[i]->ReportWait (this, severity, msgId, buf)->WasSuccessful ())
{
...
}

Mike

On 17 August 2012 08:18, Jorrit Tyberghein <[email protected]>wrote:

> Hi Mike,
>
> I think there is a bug in the reporter/stdrep introduced when you made the
> threaded loader in CS.
>
> First there is the iReporterListener interface which has the following
> function:
>
>   THREADED_INTERFACE4(Report, iReporter* reporter, int severity, const
> char* msgId,
>   const char* description);
>
> Before your conversion this function returned a bool. The only current
> implementation in the
> standard reporter listener plugin still returns that bool. However I have
> the feeling that it
> should actually return a iThreadReturn instance instead. However, how
> should the
> reporter plugin handle this? It currently does this:
>
>   for (i = 0 ; i < listeners.GetSize () ; i++)
>   {
>     iReporterListener* listener = listeners[i];
>     if (listener->Report (this, severity, msgId, buf))
>     {
>       add_msg = false;
>       break;
>     }
>   }
>
> i.e. it is *also* assuming that Report() returns a bool. However this no
> longer works. The reason
> this was undetected upto now is that by default the standard reporter
> listener does return true
> and so the 'if' will succeed as it should. However I now have a situation
> where I want the standard
> reporter listener to return false and that doesn't work.
>
> How should this be solved?
>
> Greetings,
>
> --
> Project Manager of Crystal Space (http://www.crystalspace3d.org)
> and CEL (http://cel.crystalspace3d.org)
> Support Crystal Space. Donate at
> https://sourceforge.net/donate/index.php?group_id=649
> Personal page: http://users.telenet.be/jorritTyberghein/
>



-- 
- Mike

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Crystal-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/crystal-develop
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.