|
From: Julian S. <js...@ac...> - 2009-05-17 22:30:49
|
On Monday 18 May 2009, Nicholas Nethercote wrote:
> On Mon, May 18, 2009 at 2:29 AM, <sv...@va...> wrote:
> > --- branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17 16:26:48 UTC
> > (rev 9863) +++ branches/MESSAGING_TIDYUP/drd/drd_error.c 2009-05-17
> > 16:29:20 UTC (rev 9864) @@ -194,6 +194,12 @@
> > return False;
> > }
> >
> > +static void drd_tool_error_before_pp(Error* const e)
> > +{
> > + /* No need to do anything; drd_tool_error_pp does all
> > + the work. */
> > +}
> > +
>
> It's probably nicer to allow NULL to be passed as the before_pp()
> function, to save writing functions like this. Passing NULL works
> with at least some of the other initialisation functions, eg.
> VG_(track_*)().
Oh, definitely. I just wasn't sure if that was allowable style
(or even if it's possible). Since we have
#define VG_TDICT_CALL(fn, args...) \
( tl_assert2(VG_(tdict).fn, \
"you forgot to set VgToolInterface function '" #fn "'"), \
VG_(tdict).fn(args) )
then I'd have to test the fn at the call points, hence,
VG_TDICT_CALL( tool_before_pp_Error, err );
would become
if (VG_(tdict).tool_before_pp_Error)
VG_TDICT_CALL( tool_before_pp_Error, err );
In short I wasn't aware of any macros to support checking whether a
particular dictionary function is NULL or not. So played safe.
J
|