Avoiding FunctionA/W Duplication

Alexandre Julliard julliard at winehq.com
Tue Nov 5 19:23:44 CST 2002

"Dimitrie O. Paun" <dpaun at rogers.com> writes:

>   5. Implement the meat in a funcT that takes a boolean as an argument
>      telling it if the input is A or W, and just have the func[AW]
>      forward the call to funcT
> This works only within one module, and there are other problems. That is,
> if it does any non-trivial work with the string, that might require that
> be converted between A<->W, it's better to go for 4, to avoid multiple
> conversions (which are expensive).

Of course another problem with option 5 is that you lose all type
checking, so the compiler cannot warn you when you confuse the string
types, plus it requires ugly casts. Better avoided IMO.

Alexandre Julliard
julliard at winehq.com

More information about the wine-devel mailing list