[PATCH] oledlg: Make object name menu item localized

Alex Henrie alexhenrie24 at gmail.com
Mon May 18 01:17:46 CDT 2015


+    WCHAR objectW[50]; /* should be enough*/

In the past I was told to always allocate memory in multiplies of 8
bytes,[1] and I personally have started to prefer powers of 2 in
particular. Alexandre seems to prefer allocating at least 64 characters
for short strings like this, judging from how he amended a proposed
patch of mine several years ago.[2]

+    if (!LoadStringW(OLEDLG_hInstance, IDS_VERBMENU_OBJECT, objectW, sizeof(objectW)/sizeof(WCHAR))) {
+        static const WCHAR enobjectW[] = {'&','O','b','j','e','c','t',0};
+        strcpyW(objectW, enobjectW);
+    }

Is this really necessary? How could LoadString fail? I recently
submitted a very similar patch [3] and didn't have to provide a special
fallback.

Just to be clear, I do really appreciate you taking the time to make
sure that Wine is properly localized :-) I just don't want to see the
codebase made unnecessarily complicated or inefficient.

-Alex

[1] https://www.winehq.org/pipermail/wine-devel/2011-December/093516.html
[2] https://source.winehq.org/git/wine.git/commitdiff/6e5bba1b60f97fce34415ea30ebecd5bd20dae20
[3] https://www.winehq.org/pipermail/wine-patches/2015-May/139132.html



More information about the wine-devel mailing list