[PATCH 2/7] reg: Split reg_printfW into separate functions

Hugh McMaster hugh.mcmaster at outlook.com
Mon Feb 8 23:23:42 CST 2016


On Mon, 8 Feb 2016 22:12:05 +0900, Alexandre Julliard wrote:
> 
> Hugh McMaster writes:
> 
> > On Monday, 8 February 2016 20:06:55 +0900, Alexandre Julliard wrote:
> >> 
> >> Hugh McMaster writes:
> >> 
> >>> +static void __cdecl output_array(const WCHAR *fmt, ...)
> >>> +{
> >>> +    __ms_va_list va_args;
> >>> +
> >>> +    __ms_va_start(va_args, fmt);
> >>> +    output_formatstring(fmt, va_args);
> >>> +    __ms_va_end(va_args);
> >>>  }
> >> 
> >> That's a strange name, why "array"?
> >
> > Well, we use array syntax for string literals. So it's just for differentiating between string resources (as messages)
> > and string literals (as arrays).
> >
> > I also used the name in http://source.winehq.org/git/wine.git/commitdiff/4335c464c358d15024e76c918efb7721ff0d9cce
> > and it slipped past back then!  :-)
> 
> Right, I probably assumed that you meant the uninstalled programs array
> back then, not the string. Of course technically strings are also
> arrays, but that's a confusing name. Just name it output_string or
> something like that.

I considered output_string, but I thought it might cause confusion. Consider this:

output_message(STRING_INVALID_KEY);  // message as resource string
output_string(pointer to some array of WCHAR, ...) // we pass in a pointer. Why don't we do output_string(STRING_INVALID_KEY)?

So the reference to a string in the function name and in the resource identifier could cause confusion because it looks as though
they should be related. Or that's my reading of it, at least.

Is either output_arraystr or output_strarray suitable?
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20160209/564e567f/attachment.html>


More information about the wine-devel mailing list