[Yum-devel] [PATCH 2/6] Extract out a common set of SAXContext members for the three file types

James Antill jantill at redhat.com
Wed May 30 03:33:23 UTC 2007


On Tue, 2007-05-29 at 21:27 -0400, James Bowes wrote:
> This creates a new struct, SAXContext, that contains all common parts from
> the three other context, and teaches the PrimarySAXContext related code to
> use it.

 One minor comment:

> @@ -78,15 +84,17 @@ primary_parser_toplevel_start (PrimarySAXContext *ctx,
>                                 const char *name,
>                                 const char **attrs)
>  {
> +    SAXContext *sctx = (SAXContext *) ctx;
> +

 When doing conversions like this, I've found it's often better to use:

    SAXContext *sctx = &ctx->sctx;

...that way the compiler still does the type checking for you (and the
following code is obviously safe from aliasing).

-- 
James Antill <jantill at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20070529/698388a8/attachment.pgp 


More information about the Yum-devel mailing list