summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2011-03-03 16:51:56 +0000
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2011-03-10 18:58:37 +0000
commitd60cc351feb6a06226ff76d4caba35bf785bfb80 (patch)
treed605e4bff8de5484a150c38bdc472743116d4ad5
parenteb6d268f581801d829f762daae399726e32a7b62 (diff)
dbus_type_is_basic etc.: it is an error to pass in bad typecodes
Previously, the comments said "this function will crash", but that's not strictly true (checks can be disabled or made non-fatal). Their behaviour is undefined if you do that, though. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=20496 Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
-rw-r--r--dbus/dbus-signature.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/dbus/dbus-signature.c b/dbus/dbus-signature.c
index ddc0bcc3..9c13ff43 100644
--- a/dbus/dbus-signature.c
+++ b/dbus/dbus-signature.c
@@ -283,9 +283,10 @@ dbus_signature_validate_single (const char *signature,
* A "container type" can contain basic types, or nested
* container types. #DBUS_TYPE_INVALID is not a container type.
*
- * This function will crash if passed a typecode that isn't
- * in dbus-protocol.h
+ * It is an error to pass an invalid type-code, other than DBUS_TYPE_INVALID,
+ * to this function. The valid type-codes are defined by dbus-protocol.h.
*
+ * @param typecode either a valid type-code or DBUS_TYPE_INVALID
* @returns #TRUE if type is a container
*/
dbus_bool_t
@@ -305,9 +306,10 @@ dbus_type_is_container (int typecode)
* variants are not basic types. #DBUS_TYPE_INVALID is not a basic
* type.
*
- * This function will crash if passed a typecode that isn't
- * in dbus-protocol.h
+ * It is an error to pass an invalid type-code, other than DBUS_TYPE_INVALID,
+ * to this function. The valid type-codes are defined by dbus-protocol.h.
*
+ * @param typecode either a valid type-code or DBUS_TYPE_INVALID
* @returns #TRUE if type is basic
*/
dbus_bool_t
@@ -334,9 +336,10 @@ dbus_type_is_basic (int typecode)
* but struct is not considered a fixed type for purposes of this
* function.
*
- * This function will crash if passed a typecode that isn't
- * in dbus-protocol.h
- *
+ * It is an error to pass an invalid type-code, other than DBUS_TYPE_INVALID,
+ * to this function. The valid type-codes are defined by dbus-protocol.h.
+ *
+ * @param typecode either a valid type-code or DBUS_TYPE_INVALID
* @returns #FALSE if the type can occupy different lengths
*/
dbus_bool_t