Eric Blake
96e0d6774f
dbus: fix arrays of bools
...
Commit 2aa167ca tried to fix the DBus interaction code to allow
callers to use native types instead of 4-byte bools. But in
fixing the issue, I missed the case of an arrayref; Conrad Meyer
shows the following valid complaint issued by clang:
CC util/libvirt_util_la-virdbus.lo
util/virdbus.c:956:13: error: cast from 'bool *' to 'dbus_bool_t *' (aka 'unsigned int *') increases required alignment from 1 to 4 [-Werror,-Wcast-align]
GET_NEXT_VAL(dbus_bool_t, bool_val, bool, "%d");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
util/virdbus.c:858:17: note: expanded from macro 'GET_NEXT_VAL'
x = (dbustype *)(*xptrptr + (*narrayptr - 1)); \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.
But fixing that points out that we have NEVER supported arrayrefs
of sub-int types (byte, i16, u16, and now bool). Again, while raw
types promote, arrays do not; so the macros HAVE to deal with both
size possibilities rather than assuming that an arrayref uses the
same sizing as the promoted raw type.
Obviously, our testsuite wasn't covering as much as it should have.
* src/util/virdbus.c (GET_NEXT_VAL): Also fix array cases.
(SET_NEXT_VAL): Fix uses of sub-int arrays.
* tests/virdbustest.c (testMessageArray, testMessageArrayRef):
Test it.
Signed-off-by: Eric Blake <eblake@redhat.com>
2014-11-25 08:47:12 -07:00
..
2014-11-13 15:40:48 +01:00
2014-04-08 20:50:36 +04:00
2013-10-29 07:06:04 -06:00
2014-09-03 09:36:13 -06:00
2012-03-27 09:54:49 -06:00
2014-09-05 12:45:19 +02:00
2014-09-17 16:29:49 +02:00
2014-02-20 15:50:46 +00:00
2014-09-10 09:38:07 +02:00
2014-04-16 10:45:55 +02:00
2014-01-29 12:56:35 +01:00
2013-05-13 17:24:18 +08:00
2014-06-20 11:50:41 +03:00
2014-07-23 15:12:37 +08:00
2014-07-30 14:21:55 +02:00
2013-11-07 18:43:15 +01:00
2014-03-26 16:42:43 +02:00
2014-04-25 15:44:09 +01:00
2014-10-06 11:49:10 -04:00
2014-10-06 11:49:10 -04:00
2013-08-28 08:05:46 +02:00
2014-02-04 12:00:26 +02:00
2014-07-21 12:55:11 -04:00
2014-06-20 15:59:08 +02:00
2014-04-25 15:44:10 +01:00
2012-05-21 06:26:34 -04:00
2012-05-21 06:26:34 -04:00
2014-11-24 10:29:16 -05:00
2014-11-24 22:05:56 +01:00
2014-03-26 13:41:25 +01:00
2014-11-13 21:25:50 +01:00
2014-11-24 22:05:55 +01:00
2013-11-08 09:44:36 +01:00
2014-11-24 22:20:13 +01:00
2014-11-24 22:20:13 +01:00
2013-09-02 16:53:39 -04:00
2014-02-14 16:47:14 +01:00
2014-03-07 14:02:10 +01:00
2013-08-20 10:46:58 -06:00
2014-09-10 09:38:07 +02:00
2013-05-17 08:33:22 +02:00
2014-11-12 10:18:28 -05:00
2014-11-12 10:18:28 -05:00
2013-05-17 08:35:08 +02:00
2014-08-01 15:42:28 +02:00
2014-07-16 13:35:26 +02:00
2014-07-16 13:35:26 +02:00
2014-01-01 16:34:13 +00:00
2014-06-18 15:19:18 +02:00
2014-06-05 13:58:13 +02:00
2013-11-28 11:49:01 +00:00
2014-01-25 12:53:11 +01:00
2014-03-29 21:14:15 +01:00
2014-03-03 14:35:22 +01:00
2014-06-11 14:56:18 +02:00
2014-02-19 09:16:31 +01:00
2011-11-30 10:12:30 +00:00
2014-09-10 09:38:07 +02:00
2012-04-02 09:33:54 -06:00
2013-10-15 11:39:02 +01:00
2013-08-01 17:04:28 -04:00
2014-09-18 13:37:12 +04:00
2014-11-13 15:40:48 +01:00
2014-04-08 20:50:36 +04:00
2010-01-15 16:28:05 +00:00
2014-11-14 17:13:36 +01:00
2014-09-03 09:36:13 -06:00
2013-08-22 11:38:36 +02:00
2014-09-05 12:45:19 +02:00
2012-05-08 16:57:37 -06:00
2014-07-03 12:22:37 +02:00
2014-09-18 13:37:12 +04:00
2014-03-25 14:58:41 +01:00
2014-07-29 09:52:16 +04:00
2010-05-20 13:50:03 -04:00
2014-07-03 10:48:14 +02:00
2014-11-14 17:13:36 +01:00
2014-11-14 17:13:36 +01:00
2014-03-25 14:58:41 +01:00
2014-04-25 11:59:46 +01:00
2011-07-29 17:17:21 +02:00
2010-01-15 16:28:05 +00:00
2014-03-18 11:29:44 +01:00
2014-03-25 14:58:41 +01:00
2009-10-07 12:18:13 +02:00
2009-10-07 12:18:13 +02:00
2014-08-20 14:50:21 +02:00
2014-03-25 14:58:41 +01:00
2014-07-30 14:21:55 +02:00
2014-11-24 10:29:16 -05:00
2014-07-17 17:04:12 +02:00
2010-01-15 16:28:05 +00:00
2014-03-25 14:58:41 +01:00
2014-04-30 10:16:09 +02:00
2014-08-21 15:55:07 +02:00
2014-03-25 14:58:41 +01:00
2010-01-15 16:28:05 +00:00
2014-07-21 12:55:11 -04:00
2014-06-20 15:59:08 +02:00
2014-04-30 12:51:38 -04:00
2010-04-06 11:09:46 -04:00
2014-04-25 15:44:10 +01:00
2014-03-25 14:58:41 +01:00
2014-09-15 10:44:27 -04:00
2014-03-18 10:20:49 +01:00
2012-07-30 13:09:57 +01:00
2014-11-14 17:13:36 +01:00
2011-06-01 11:58:15 +02:00
2011-07-22 15:18:32 +01:00
2014-11-24 10:29:16 -05:00
2014-08-26 10:41:24 +02:00
2014-09-23 08:11:49 +02:00
2014-07-14 08:00:46 -06:00
2014-11-13 21:25:50 +01:00
2014-03-26 13:49:47 +01:00
2014-11-24 08:58:30 +01:00
2013-10-08 12:39:30 +01:00
2014-06-03 17:19:24 +02:00
2013-10-01 10:48:47 +02:00
2014-11-06 15:13:55 +01:00
2014-11-24 22:20:13 +01:00
2014-11-21 11:00:11 +01:00
2014-11-03 16:43:22 +01:00
2012-07-27 07:42:34 -06:00
2012-07-27 07:42:34 -06:00
2014-03-03 12:40:32 -07:00
2013-08-23 15:23:44 -06:00
2014-07-21 12:55:11 -04:00
2014-09-04 15:18:43 -06:00
2014-02-14 16:47:14 +01:00
2014-03-25 14:58:41 +01:00
2014-05-28 16:52:48 -06:00
2014-11-14 17:13:36 +01:00
2014-03-25 14:58:41 +01:00
2014-08-18 20:36:24 -06:00
2014-03-20 17:06:38 +01:00
2014-11-14 17:13:36 +01:00
2014-10-15 09:25:33 +02:00
2013-07-29 13:09:39 -06:00
2012-07-27 07:42:34 -06:00
2014-07-15 22:00:59 +04:00
2014-04-02 06:03:00 -06:00
2013-05-17 08:33:22 +02:00
2014-11-12 10:18:28 -05:00
2013-05-17 08:35:08 +02:00
2014-08-01 15:42:28 +02:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2014-09-03 15:00:19 -04:00
2013-03-19 13:13:28 -06:00
2013-09-13 10:25:56 +02:00
2014-11-21 11:00:10 +01:00
2014-11-21 11:00:10 +01:00
2014-07-14 08:00:46 -06:00
2014-03-18 12:17:12 +01:00
2014-09-05 08:35:34 +02:00
2014-07-03 12:22:37 +02:00
2014-07-14 08:00:46 -06:00
2014-03-18 12:17:12 +01:00
2014-11-24 22:05:55 +01:00
2014-07-01 16:46:29 +02:00
2014-06-12 14:06:21 +02:00
2014-04-25 11:29:55 +01:00
2013-11-20 09:14:55 -07:00
2014-03-25 14:58:41 +01:00
2014-11-04 07:03:36 +01:00
2014-11-14 17:13:36 +01:00
2014-07-14 08:00:46 -06:00
2014-07-14 08:00:46 -06:00
2014-03-25 14:58:41 +01:00
2014-04-09 16:24:08 +02:00
2014-03-10 16:39:18 +00:00
2014-11-25 08:47:12 -07:00
2014-08-27 07:41:48 +02:00
2014-03-25 14:58:41 +01:00
2013-11-28 11:49:01 +00:00
2014-09-11 15:40:50 -06:00
2012-01-26 14:11:13 +00:00
2014-11-14 17:13:36 +01:00
2014-10-29 09:55:09 -06:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2013-10-14 10:31:01 +01:00
2014-09-11 15:40:50 -06:00
2014-05-20 15:16:22 -06:00
2014-11-06 14:28:37 +01:00
2014-11-06 14:28:37 +01:00
2014-03-25 14:58:41 +01:00
2013-09-24 09:37:26 +01:00
2013-10-08 12:39:30 +01:00
2014-03-25 14:58:41 +01:00
2014-09-04 11:56:39 +02:00
2014-07-16 09:39:57 +02:00
2013-08-09 11:54:41 +01:00
2014-09-04 11:56:39 +02:00
2014-04-08 11:15:55 +01:00
2014-03-25 14:58:41 +01:00
2014-09-24 15:29:22 +01:00
2014-10-29 09:55:09 -06:00
2014-10-29 09:55:09 -06:00
2013-08-12 18:47:56 +02:00
2014-03-18 08:27:29 +01:00
2013-04-03 08:49:30 +02:00
2012-07-27 07:42:34 -06:00
2012-09-12 11:27:22 -06:00
2013-09-13 10:25:56 +02:00
2014-03-25 14:58:41 +01:00
2014-11-21 14:37:02 +01:00
2014-10-29 17:10:42 +01:00
2014-09-11 15:40:50 -06:00
2014-11-24 22:05:55 +01:00
2014-11-14 17:13:36 +01:00
2014-10-29 17:10:42 +01:00
2014-03-25 14:58:41 +01:00
2014-03-25 14:58:41 +01:00
2014-06-11 14:56:18 +02:00
2014-11-14 17:13:36 +01:00
2014-03-20 17:06:38 +01:00
2014-08-18 20:36:24 -06:00
2014-08-18 20:36:24 -06:00
2014-11-14 17:13:36 +01:00