aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2011-03-13 20:21:32 -0700
committerPaul Eggert2011-03-13 20:21:32 -0700
commit59d6fe8344313c6e31a06b7ebd666e9f7be27ff2 (patch)
treebebe39deea0cadab438e73b0bc59e2c03814be13 /src
parentcffc6f3bd9b5dbb9825502928bd9dd58ddbac02e (diff)
downloademacs-59d6fe8344313c6e31a06b7ebd666e9f7be27ff2.tar.gz
emacs-59d6fe8344313c6e31a06b7ebd666e9f7be27ff2.zip
* dbusbind.c: Pointer signedness fixes.
(xd_signature, xd_append_arg, xd_initialize): (Fdbus_call_method, Fdbus_call_method_asynchronously): (Fdbus_method_return_internal, Fdbus_method_error_internal): (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service): (Fdbus_register_signal): Use SSDATA when the context wants char *.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/dbusbind.c45
2 files changed, 31 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index bad9b8dd4b7..b062bfdf06d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12011-03-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 * dbusbind.c: Pointer signedness fixes.
4 (xd_signature, xd_append_arg, xd_initialize):
5 (Fdbus_call_method, Fdbus_call_method_asynchronously):
6 (Fdbus_method_return_internal, Fdbus_method_error_internal):
7 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
8 (Fdbus_register_signal): Use SSDATA when the context wants char *.
9
12011-03-13 Chong Yidong <cyd@stupidchicken.com> 102011-03-13 Chong Yidong <cyd@stupidchicken.com>
2 11
3 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT) 12 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 7e5104026cd..bf19605a346 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -325,7 +325,7 @@ xd_signature (char *signature, unsigned int dtype, unsigned int parent_type, Lis
325 if ((subtype == DBUS_TYPE_SIGNATURE) 325 if ((subtype == DBUS_TYPE_SIGNATURE)
326 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (elt))) 326 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (elt)))
327 && NILP (CDR_SAFE (XD_NEXT_VALUE (elt)))) 327 && NILP (CDR_SAFE (XD_NEXT_VALUE (elt))))
328 strcpy (x, SDATA (CAR_SAFE (XD_NEXT_VALUE (elt)))); 328 strcpy (x, SSDATA (CAR_SAFE (XD_NEXT_VALUE (elt))));
329 329
330 while (!NILP (elt)) 330 while (!NILP (elt))
331 { 331 {
@@ -531,7 +531,7 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
531 but by not encoding it, we guarantee it's valid utf-8, even if 531 but by not encoding it, we guarantee it's valid utf-8, even if
532 it contains eight-bit-bytes. Of course, you can still send 532 it contains eight-bit-bytes. Of course, you can still send
533 manually-crafted junk by passing a unibyte string. */ 533 manually-crafted junk by passing a unibyte string. */
534 char *val = SDATA (object); 534 char *val = SSDATA (object);
535 XD_DEBUG_MESSAGE ("%c %s", dtype, val); 535 XD_DEBUG_MESSAGE ("%c %s", dtype, val);
536 if (!dbus_message_iter_append_basic (iter, dtype, &val)) 536 if (!dbus_message_iter_append_basic (iter, dtype, &val))
537 XD_SIGNAL2 (build_string ("Unable to append argument"), object); 537 XD_SIGNAL2 (build_string ("Unable to append argument"), object);
@@ -569,7 +569,7 @@ xd_append_arg (unsigned int dtype, Lisp_Object object, DBusMessageIter *iter)
569 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (object))) 569 && STRINGP (CAR_SAFE (XD_NEXT_VALUE (object)))
570 && NILP (CDR_SAFE (XD_NEXT_VALUE (object)))) 570 && NILP (CDR_SAFE (XD_NEXT_VALUE (object))))
571 { 571 {
572 strcpy (signature, SDATA (CAR_SAFE (XD_NEXT_VALUE (object)))); 572 strcpy (signature, SSDATA (CAR_SAFE (XD_NEXT_VALUE (object))));
573 object = CDR_SAFE (XD_NEXT_VALUE (object)); 573 object = CDR_SAFE (XD_NEXT_VALUE (object));
574 } 574 }
575 575
@@ -789,7 +789,7 @@ xd_initialize (Lisp_Object bus, int raise_error)
789 dbus_error_init (&derror); 789 dbus_error_init (&derror);
790 790
791 if (STRINGP (bus)) 791 if (STRINGP (bus))
792 connection = dbus_connection_open (SDATA (bus), &derror); 792 connection = dbus_connection_open (SSDATA (bus), &derror);
793 else 793 else
794 if (EQ (bus, QCdbus_system_bus)) 794 if (EQ (bus, QCdbus_system_bus))
795 connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror); 795 connection = dbus_bus_get (DBUS_BUS_SYSTEM, &derror);
@@ -1089,10 +1089,10 @@ usage: (dbus-call-method BUS SERVICE PATH INTERFACE METHOD &optional :timeout TI
1089 connection = xd_initialize (bus, TRUE); 1089 connection = xd_initialize (bus, TRUE);
1090 1090
1091 /* Create the message. */ 1091 /* Create the message. */
1092 dmessage = dbus_message_new_method_call (SDATA (service), 1092 dmessage = dbus_message_new_method_call (SSDATA (service),
1093 SDATA (path), 1093 SSDATA (path),
1094 SDATA (interface), 1094 SSDATA (interface),
1095 SDATA (method)); 1095 SSDATA (method));
1096 UNGCPRO; 1096 UNGCPRO;
1097 if (dmessage == NULL) 1097 if (dmessage == NULL)
1098 XD_SIGNAL1 (build_string ("Unable to create a new message")); 1098 XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1272,10 +1272,10 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1272 connection = xd_initialize (bus, TRUE); 1272 connection = xd_initialize (bus, TRUE);
1273 1273
1274 /* Create the message. */ 1274 /* Create the message. */
1275 dmessage = dbus_message_new_method_call (SDATA (service), 1275 dmessage = dbus_message_new_method_call (SSDATA (service),
1276 SDATA (path), 1276 SSDATA (path),
1277 SDATA (interface), 1277 SSDATA (interface),
1278 SDATA (method)); 1278 SSDATA (method));
1279 if (dmessage == NULL) 1279 if (dmessage == NULL)
1280 XD_SIGNAL1 (build_string ("Unable to create a new message")); 1280 XD_SIGNAL1 (build_string ("Unable to create a new message"));
1281 1281
@@ -1386,7 +1386,7 @@ usage: (dbus-method-return-internal BUS SERIAL SERVICE &rest ARGS) */)
1386 dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN); 1386 dmessage = dbus_message_new (DBUS_MESSAGE_TYPE_METHOD_RETURN);
1387 if ((dmessage == NULL) 1387 if ((dmessage == NULL)
1388 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial))) 1388 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial)))
1389 || (!dbus_message_set_destination (dmessage, SDATA (service)))) 1389 || (!dbus_message_set_destination (dmessage, SSDATA (service))))
1390 { 1390 {
1391 UNGCPRO; 1391 UNGCPRO;
1392 XD_SIGNAL1 (build_string ("Unable to create a return message")); 1392 XD_SIGNAL1 (build_string ("Unable to create a return message"));
@@ -1475,7 +1475,7 @@ usage: (dbus-method-error-internal BUS SERIAL SERVICE &rest ARGS) */)
1475 if ((dmessage == NULL) 1475 if ((dmessage == NULL)
1476 || (!dbus_message_set_error_name (dmessage, DBUS_ERROR_FAILED)) 1476 || (!dbus_message_set_error_name (dmessage, DBUS_ERROR_FAILED))
1477 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial))) 1477 || (!dbus_message_set_reply_serial (dmessage, XUINT (serial)))
1478 || (!dbus_message_set_destination (dmessage, SDATA (service)))) 1478 || (!dbus_message_set_destination (dmessage, SSDATA (service))))
1479 { 1479 {
1480 UNGCPRO; 1480 UNGCPRO;
1481 XD_SIGNAL1 (build_string ("Unable to create a error message")); 1481 XD_SIGNAL1 (build_string ("Unable to create a error message"));
@@ -1591,9 +1591,9 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1591 connection = xd_initialize (bus, TRUE); 1591 connection = xd_initialize (bus, TRUE);
1592 1592
1593 /* Create the message. */ 1593 /* Create the message. */
1594 dmessage = dbus_message_new_signal (SDATA (path), 1594 dmessage = dbus_message_new_signal (SSDATA (path),
1595 SDATA (interface), 1595 SSDATA (interface),
1596 SDATA (signal)); 1596 SSDATA (signal));
1597 UNGCPRO; 1597 UNGCPRO;
1598 if (dmessage == NULL) 1598 if (dmessage == NULL)
1599 XD_SIGNAL1 (build_string ("Unable to create a new message")); 1599 XD_SIGNAL1 (build_string ("Unable to create a new message"));
@@ -1745,11 +1745,11 @@ xd_read_message_1 (DBusConnection *connection, Lisp_Object bus)
1745 /* key has the structure (UNAME SERVICE PATH HANDLER). */ 1745 /* key has the structure (UNAME SERVICE PATH HANDLER). */
1746 if (((uname == NULL) 1746 if (((uname == NULL)
1747 || (NILP (CAR_SAFE (key))) 1747 || (NILP (CAR_SAFE (key)))
1748 || (strcmp (uname, SDATA (CAR_SAFE (key))) == 0)) 1748 || (strcmp (uname, SSDATA (CAR_SAFE (key))) == 0))
1749 && ((path == NULL) 1749 && ((path == NULL)
1750 || (NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (key))))) 1750 || (NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
1751 || (strcmp (path, 1751 || (strcmp (path,
1752 SDATA (CAR_SAFE (CDR_SAFE (CDR_SAFE (key))))) 1752 SSDATA (CAR_SAFE (CDR_SAFE (CDR_SAFE (key)))))
1753 == 0)) 1753 == 0))
1754 && (!NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key))))))) 1754 && (!NILP (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (key)))))))
1755 { 1755 {
@@ -1921,7 +1921,7 @@ usage: (dbus-register-service BUS SERVICE &rest FLAGS) */)
1921 1921
1922 /* Request the known name from the bus. */ 1922 /* Request the known name from the bus. */
1923 dbus_error_init (&derror); 1923 dbus_error_init (&derror);
1924 result = dbus_bus_request_name (connection, SDATA (service), flags, 1924 result = dbus_bus_request_name (connection, SSDATA (service), flags,
1925 &derror); 1925 &derror);
1926 if (dbus_error_is_set (&derror)) 1926 if (dbus_error_is_set (&derror))
1927 XD_ERROR (derror); 1927 XD_ERROR (derror);
@@ -2019,8 +2019,8 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
2019 name of "org.freedesktop.DBus" is that string itself. */ 2019 name of "org.freedesktop.DBus" is that string itself. */
2020 if ((STRINGP (service)) 2020 if ((STRINGP (service))
2021 && (SBYTES (service) > 0) 2021 && (SBYTES (service) > 0)
2022 && (strcmp (SDATA (service), DBUS_SERVICE_DBUS) != 0) 2022 && (strcmp (SSDATA (service), DBUS_SERVICE_DBUS) != 0)
2023 && (strncmp (SDATA (service), ":", 1) != 0)) 2023 && (strncmp (SSDATA (service), ":", 1) != 0))
2024 { 2024 {
2025 uname = call2 (intern ("dbus-get-name-owner"), bus, service); 2025 uname = call2 (intern ("dbus-get-name-owner"), bus, service);
2026 /* When there is no unique name, we mark it with an empty 2026 /* When there is no unique name, we mark it with an empty
@@ -2350,4 +2350,3 @@ be called when the D-Bus reply message arrives. */);
2350} 2350}
2351 2351
2352#endif /* HAVE_DBUS */ 2352#endif /* HAVE_DBUS */
2353