diff options
Diffstat (limited to 'src/dbusbind.c')
| -rw-r--r-- | src/dbusbind.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/dbusbind.c b/src/dbusbind.c index b06077d3b58..cca5f13907d 100644 --- a/src/dbusbind.c +++ b/src/dbusbind.c | |||
| @@ -209,9 +209,12 @@ xd_dbus_type_to_symbol (int type) | |||
| 209 | : Qnil; | 209 | : Qnil; |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | #define XD_KEYWORDP(object) !NILP (Fkeywordp (object)) | ||
| 213 | |||
| 212 | /* Check whether a Lisp symbol is a predefined D-Bus type symbol. */ | 214 | /* Check whether a Lisp symbol is a predefined D-Bus type symbol. */ |
| 213 | #define XD_DBUS_TYPE_P(object) \ | 215 | #define XD_DBUS_TYPE_P(object) \ |
| 214 | (SYMBOLP (object) && ((xd_symbol_to_dbus_type (object) != DBUS_TYPE_INVALID))) | 216 | XD_KEYWORDP (object) && \ |
| 217 | ((xd_symbol_to_dbus_type (object) != DBUS_TYPE_INVALID)) | ||
| 215 | 218 | ||
| 216 | /* Determine the DBusType of a given Lisp OBJECT. It is used to | 219 | /* Determine the DBusType of a given Lisp OBJECT. It is used to |
| 217 | convert Lisp objects, being arguments of `dbus-call-method' or | 220 | convert Lisp objects, being arguments of `dbus-call-method' or |
| @@ -463,6 +466,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) | |||
| 463 | CHECK_CONS (object); | 466 | CHECK_CONS (object); |
| 464 | 467 | ||
| 465 | elt = XD_NEXT_VALUE (elt); | 468 | elt = XD_NEXT_VALUE (elt); |
| 469 | CHECK_CONS (elt); | ||
| 466 | subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); | 470 | subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); |
| 467 | xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); | 471 | xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); |
| 468 | 472 | ||
| @@ -474,11 +478,12 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) | |||
| 474 | break; | 478 | break; |
| 475 | 479 | ||
| 476 | case DBUS_TYPE_STRUCT: | 480 | case DBUS_TYPE_STRUCT: |
| 477 | /* A struct list might contain any number of elements with | 481 | /* A struct list might contain any (but zero) number of elements |
| 478 | different types. No further check needed. */ | 482 | with different types. No further check needed. */ |
| 479 | CHECK_CONS (object); | 483 | CHECK_CONS (object); |
| 480 | 484 | ||
| 481 | elt = XD_NEXT_VALUE (elt); | 485 | elt = XD_NEXT_VALUE (elt); |
| 486 | CHECK_CONS (elt); | ||
| 482 | 487 | ||
| 483 | /* Compose the signature from the elements. It is enclosed by | 488 | /* Compose the signature from the elements. It is enclosed by |
| 484 | parentheses. */ | 489 | parentheses. */ |
| @@ -509,6 +514,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) | |||
| 509 | 514 | ||
| 510 | /* First element. */ | 515 | /* First element. */ |
| 511 | elt = XD_NEXT_VALUE (elt); | 516 | elt = XD_NEXT_VALUE (elt); |
| 517 | CHECK_CONS (elt); | ||
| 512 | subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); | 518 | subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); |
| 513 | xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); | 519 | xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); |
| 514 | xd_signature_cat (signature, x); | 520 | xd_signature_cat (signature, x); |
| @@ -518,6 +524,7 @@ xd_signature (char *signature, int dtype, int parent_type, Lisp_Object object) | |||
| 518 | 524 | ||
| 519 | /* Second element. */ | 525 | /* Second element. */ |
| 520 | elt = CDR_SAFE (XD_NEXT_VALUE (elt)); | 526 | elt = CDR_SAFE (XD_NEXT_VALUE (elt)); |
| 527 | CHECK_CONS (elt); | ||
| 521 | subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); | 528 | subtype = XD_OBJECT_TO_DBUS_TYPE (CAR_SAFE (elt)); |
| 522 | xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); | 529 | xd_signature (x, subtype, dtype, CAR_SAFE (XD_NEXT_VALUE (elt))); |
| 523 | xd_signature_cat (signature, x); | 530 | xd_signature_cat (signature, x); |
| @@ -1227,7 +1234,7 @@ this connection to those buses. */) | |||
| 1227 | xd_add_watch, | 1234 | xd_add_watch, |
| 1228 | xd_remove_watch, | 1235 | xd_remove_watch, |
| 1229 | xd_toggle_watch, | 1236 | xd_toggle_watch, |
| 1230 | SYMBOLP (bus) | 1237 | XD_KEYWORDP (bus) |
| 1231 | ? (void *) XSYMBOL (bus) | 1238 | ? (void *) XSYMBOL (bus) |
| 1232 | : (void *) XSTRING (bus), | 1239 | : (void *) XSTRING (bus), |
| 1233 | NULL)) | 1240 | NULL)) |
| @@ -1793,7 +1800,7 @@ xd_read_queued_messages (int fd, void *data) | |||
| 1793 | while (!NILP (busp)) | 1800 | while (!NILP (busp)) |
| 1794 | { | 1801 | { |
| 1795 | key = CAR_SAFE (CAR_SAFE (busp)); | 1802 | key = CAR_SAFE (CAR_SAFE (busp)); |
| 1796 | if ((SYMBOLP (key) && XSYMBOL (key) == data) | 1803 | if ((XD_KEYWORDP (key) && XSYMBOL (key) == data) |
| 1797 | || (STRINGP (key) && XSTRING (key) == data)) | 1804 | || (STRINGP (key) && XSTRING (key) == data)) |
| 1798 | bus = key; | 1805 | bus = key; |
| 1799 | busp = CDR_SAFE (busp); | 1806 | busp = CDR_SAFE (busp); |