Eric Blake
6b74a9f5d9
string: make VIR_STRDUP easier to use
...
While reviewing proposed VIR_STRDUP conversions, I've already noticed
several places that do:
if (str && VIR_STRDUP(dest, str) < 0)
which can be simplified by allowing str to be NULL (something that
strdup() doesn't allow). Meanwhile, code that wants to ensure a
non-NULL dest regardless of the source can check for <= 0.
Also, make it part of the VIR_STRDUP contract that macro arguments
are evaluated exactly once.
* src/util/virstring.h (VIR_STRDUP, VIR_STRDUP_QUIET, VIR_STRNDUP)
(VIR_STRNDUP_QUIET): Improve contract.
* src/util/virstring.c (virStrdup, virStrndup): Change return
conventions.
* docs/hacking.html.in: Document this.
* HACKING: Regenerate.
Signed-off-by: Eric Blake <eblake@redhat.com>
2013-05-07 13:21:31 -06:00
..
2012-02-01 16:28:17 -07:00
2012-02-03 15:27:16 -07:00
2012-02-03 15:27:16 -07:00
2013-05-03 15:56:15 +01:00
2013-04-25 21:23:38 -04:00
2006-01-23 22:55:41 +00:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-04-24 10:59:53 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2011-10-28 10:11:16 +01:00
2005-12-21 16:59:34 +00:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 16:58:46 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2008-04-28 08:29:35 +00:00
2013-05-03 15:56:15 +01:00
2008-04-23 17:08:31 +00:00
2008-04-23 17:08:31 +00:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-01-18 15:36:38 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-07 13:21:31 -06:00
2013-05-03 15:56:15 +01:00
2013-05-07 11:19:04 +01:00
2013-05-03 15:56:15 +01:00
2013-02-07 19:52:44 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2009-07-16 15:06:42 +02:00
2011-10-28 10:11:16 +01:00
2012-07-23 16:07:13 -06:00
2011-10-28 10:11:16 +01:00
2012-07-23 16:07:13 -06:00
2008-04-23 17:08:31 +00:00
2008-04-23 17:08:31 +00:00
2011-10-28 10:11:16 +01:00
2012-07-23 16:07:13 -06:00
2011-10-28 10:11:16 +01:00
2012-07-23 16:07:13 -06:00
2011-10-28 10:11:16 +01:00
2012-07-23 16:07:13 -06:00
2013-03-04 17:36:03 -05:00
2013-03-04 17:36:03 -05:00
2013-02-01 08:47:38 +01:00
2012-06-18 20:10:29 +01:00
2006-02-09 17:45:11 +00:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2006-02-09 17:45:11 +00:00
2008-04-23 17:08:31 +00:00
2013-05-07 15:45:50 +01:00
2011-10-28 10:11:16 +01:00
2011-10-28 10:07:45 +01:00
2011-10-28 10:11:16 +01:00
2011-10-28 10:07:45 +01:00
2011-10-28 10:11:16 +01:00
2011-10-28 10:07:45 +01:00
2011-10-28 10:11:16 +01:00
2011-10-28 10:07:45 +01:00
2011-10-28 10:11:16 +01:00
2011-10-28 10:07:45 +01:00
2013-05-03 15:56:15 +01:00
2013-05-07 11:19:04 +01:00
2013-05-03 15:56:15 +01:00
2009-07-29 09:04:21 +01:00
2011-10-28 10:11:16 +01:00
2006-01-23 13:24:07 +00:00
2013-05-03 20:57:24 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2012-08-10 10:58:38 +02:00
2012-08-10 10:58:38 +02:00
2013-05-03 16:58:46 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2011-10-28 10:11:16 +01:00
2010-12-02 16:00:47 -07:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2010-10-12 11:26:52 +01:00
2013-05-07 11:19:04 +01:00
2013-05-03 15:56:15 +01:00
2013-05-03 15:56:15 +01:00
2013-05-07 15:29:37 +01:00
2010-11-12 19:47:20 +01:00