Gerald Pfeifer <gerald(a)pfeifer.com> writes:
> So, I admit I don't really know this code, but looking at it (triggered
> by a warning issued by GCC development versions), I noticed that this
> variable passed by reference is not initialized here.
It's initialized when we return a type, and it doesn't need to be
initialized on NULL return. The code is correct, but you could probably
set the variable to NULL in the caller to silence the warning.
--
Alexandre Julliard
julliard(a)winehq.org
Looking at
RPC_STATUS WINAPI RpcBindingVectorFree( RPC_BINDING_VECTOR** BindingVector )
{
RPC_STATUS status;
ULONG c;
TRACE("(%p)\n", BindingVector);
for (c=0; c<(*BindingVector)->Count; c++) {
status = RpcBindingFree(&(*BindingVector)->BindingH[c]);
}
HeapFree(GetProcessHeap(), 0, *BindingVector);
*BindingVector = NULL;
return RPC_S_OK;
}
we currently always ignore the outcome of RpcBindingFree and return
RPC_S_OK.
However, there is one case where RpcBindingFree returns something
different (which is if *Binding is null when RPC_S_INVALID_BINDING
is returned).
What is the proper way of handling this? Just keeping the code as
is and removing the unused status variable? Breaking the loop once
RpcBindingFree returns something different from RPC_S_OK? Continuing
and returning the first / the last status different from RPC_S_OK?
Gerald
Yesterday I added an option to let the TestBot administrator decide
whether to run all the tests in Wine for every Wine patch. I have not
activated it yet.
But I set it to run all of a dll's tests on Wine whenever that dll is
patched. So for instance because job 43715 patched dinput the TestBot
reran all of the dinput tests. In contrast, for dinput8 the patch only
modified dinput8:dinput so only that test was rerun. And yes, this also
illustrates that this mode does not take PARENTSRC into account (yet)
:-(
https://testbot.winehq.org/JobDetails.pl?Key=43715&f601=win32.report#k601
If this does not cause too many issues (false positives, long processing
times) I'll change it to run all the tests all the time in a few days.
The remaining todo list for the TestBot:
* Add support for locales in Wine VMs.
* Fix the performance issues caused by running all the tests on Wine for
every Wine patch (I expect we can get by with just duplicating the
Debian VM so we can run all the win32 tests on one host while another
runs the module-level wow32 + wow64 + locale ones).
* Allow submitting Windows test executables to run in Wine.
* Allow specifying a locale for jobs running in Wine.
* Better locale handling when submitting a job on the Windows VMs
(duplicating the VM on the submit page is fine as long as there are
only a couple locales but will get unwieldly as more are added).
* Fix date/time handling on Wine VMs (the time is not updated when the
task starts and risks getting too far off).
* Support for Wine's other source repositories to limit the risk of
misidentifying Wine patches.
* Have the TestBot build its own WineTest executables.
* Split the "Update Wine VMs" job in two so it does not hog the Debian
VM for hours.
* Testing vkd3d's patches... somehow.
* Monitoring the VM disk sizes (the Debian one grows particularly fast).
* Fix monitoring of WineTest log sizes.
* Update the Windows VMs (Windows+TestAgentd). The Windows 10 one
obviously but also the slow reverting ones (w7u 3mn, wvista 1mn, w864
1mn).
* Automate creating locale snapshots for the Windows Ultimate VMs
somehow (either via Ansible or through TestAgentd).
* Add more locale snapshots for the Windows Ultimate VMs (w7u and
wvistau64).
* Remember the user's VM preferences for jobs.
* Let users change their email, password, etc.
* One day maybe: rewrite the web interface using "modern" technologies
to avoid page reloads.
--
Francois Gouget <fgouget(a)codeweavers.com>
From: Michał Janiszewski <janisozaur(a)gmail.com>
Inspired by kernel check and recent unification of ARRAY_SIZE, provide
a way of enforcing the macro can only be applied to actual arrays and
not to pointers.
v2: Fix parentheses
Signed-off-by: Michał Janiszewski <janisozaur(a)gmail.com>
---
include/winnt.h | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/include/winnt.h b/include/winnt.h
index 7f822c4aec..b99a375ab0 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -760,7 +760,26 @@ typedef struct _MEMORY_BASIC_INFORMATION
((type *)((PCHAR)(address) - offsetof(type, field)))
#ifdef __WINESRC__
-# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+// Validate types used in the expression.
+// Based on https://elixir.bootlin.com/linux/v4.17.4/source/include/linux/kernel.h#L71
+
+#ifdef __GNUC__
+/**
+ * Force a compilation error if condition is true, but also produce a
+ * result (of value 0 and type size_t), so the expression can be used
+ * e.g. in a structure initializer (or where-ever else comma expressions
+ * aren't permitted).
+ */
+#define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
+
+/* &a[0] degrades to a pointer: a different type from an array */
+#define __must_be_array(a) \
+ BUILD_BUG_ON_ZERO(__builtin_types_compatible_p(typeof(a), typeof(&a[0])))
+#else
+#define __must_be_array(a) 0
+#endif
+
+# define ARRAY_SIZE(x) ((sizeof(x) / sizeof((x)[0])) + __must_be_array(x))
#endif
/* Types */
--
2.18.0