widl [2/2]: Implement pointer descriptions for complex structures
dsh at linux.ucla.edu
Tue Sep 18 17:47:03 CDT 2007
On Tue, Sep 18, 2007 at 11:15:26PM +0100, Robert Shearman wrote:
> >Sorry, I missed your last three patches somehow. My patch not only uses
> >RPC_FC_POINTER instead of RPC_FC_LONG here, but it also implements the
> >pointer description section for complex structures.
> Right, but I was really talking about the approach of passing a flag
> into write_member_types or passing the containing type in. I think it is
> slightly cleaner to do the former, but your patch works very well for
> the case I was trying to fix.
Well, it's such a small section of code it probably doesn't matter much
either way. I tend to avoid boolean arguments because when you look at
the call to the function and just see a bunch of TRUEs and FALSEs, it's
hard to remember what they mean.
> >I actually left
> >these as RPC_FC_LONG on purpose, until the pointer description part was
> >finished. Isn't using RPC_FC_POINTER with a pointer description offset
> >of zero just going to crash? It's not really any more correct in that
> >case. There are no tests, so I'm not sure what it would do.
> Sure, but it was slightly better than the existing code, which would
> have appeared to correctly unmarshal data, but fail in strange ways. If
> you want to always output correct format strings then you have to detect
> unimplemented cases and output an error!
I agree. It's much better to crash than to do the wrong thing without
warning. In both cases, though, it was impossible to write tests since
the output was wrong, so there wasn't much point worrying about it. If
I had gone to the effort of doing anything about it, I would have just
implemented what was needed. I just didn't get around to it until now.
Thanks for the comments.
More information about the wine-devel