widl: Fix optimisation for writing out ref pointers to simple structs and base types.
commitcc51c30a63ae3e6b9c06d65b030b46248216f972
authorRob Shearman <robertshearman@gmail.com>
Sun, 30 Nov 2008 16:25:06 +0000 (30 16:25 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Mon, 1 Dec 2008 11:46:46 +0000 (1 12:46 +0100)
tree588c1503e9d4351514d23e17ecfdbd842ad9ce46
parent41152b7929a07131623e6e4635560982a9ab8e28
widl: Fix optimisation for writing out ref pointers to simple structs and base types.

The optimisation in write_remoting_arg for sizing, marshalling,
unmarshalling and freeing ref pointers to base types directly was
broken in d458a599eb8efa192004e0a0bea745be0d1cc0be and caused
unnecessary calls to pointer marshalling functions.

The same was true for a similar optimisation for simple structures
where their size can be pre-calculated, freeing omitted and the
NdrSimpleStructMarshall/Unmarshall functions called directly instead
of calling NdrPointerMarshall/Unmarshall first.

Fix this by looking at the type of the referrent instead of the type
of the pointer, making sure to not classify user types as simple
structures.

Additionally remove some dead code that would never be executed
because the code is in an RPC_FC_RP case, inside a !is_ptr if block
(and RPC_FC_RP is a pointer type).
tools/widl/typegen.c