aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Albinus2009-06-28 15:22:37 +0000
committerMichael Albinus2009-06-28 15:22:37 +0000
commit78c383195cc7e9a0bc73cef25e42c868ee884c82 (patch)
treec7b00ef9629252f3858358430bfba6837ada4526 /src
parentcebabb67a3761fd9ef97d092ee767d48c326aaed (diff)
downloademacs-78c383195cc7e9a0bc73cef25e42c868ee884c82.tar.gz
emacs-78c383195cc7e9a0bc73cef25e42c868ee884c82.zip
* dbusbind.c (XD_SYMBOL_TO_DBUS_TYPE): Convert macro into function
xd_symbol_to_dbus_type. With Solaris 2.11, it was said to compile for hours, when optimzation is enabled. (xd_signature, xd_append_arg, xd_retrieve_arg, xd_initialize) (xd_read_message): Make them static.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/dbusbind.c62
2 files changed, 43 insertions, 27 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index d359d25e4c4..6177e71534d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12009-06-28 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbusbind.c (XD_SYMBOL_TO_DBUS_TYPE): Convert macro into function
4 xd_symbol_to_dbus_type. With Solaris 2.11, it was said to compile
5 for hours, when optimzation is enabled.
6 (xd_signature, xd_append_arg, xd_retrieve_arg, xd_initialize)
7 (xd_read_message): Make them static.
8
12009-06-27 Chuck Blake <cblake@pdos.csail.mit.edu> (tiny change) 92009-06-27 Chuck Blake <cblake@pdos.csail.mit.edu> (tiny change)
2 10
3 * term.c (turn_on_face): Allow simultaneously bold and dim 11 * term.c (turn_on_face): Allow simultaneously bold and dim
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 6e97f168ea4..670ef6b1afe 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -155,30 +155,38 @@ int xd_in_read_queued_messages = 0;
155 || (type == DBUS_TYPE_OBJECT_PATH) \ 155 || (type == DBUS_TYPE_OBJECT_PATH) \
156 || (type == DBUS_TYPE_SIGNATURE)) 156 || (type == DBUS_TYPE_SIGNATURE))
157 157
158/* This was a macro. On Solaris 2.11 it was said to compile for
159 hours, when optimzation is enabled. So we have transferred it into
160 a function. */
158/* Determine the DBusType of a given Lisp symbol. OBJECT must be one 161/* Determine the DBusType of a given Lisp symbol. OBJECT must be one
159 of the predefined D-Bus type symbols. */ 162 of the predefined D-Bus type symbols. */
160#define XD_SYMBOL_TO_DBUS_TYPE(object) \ 163static int
161 ((EQ (object, QCdbus_type_byte)) ? DBUS_TYPE_BYTE \ 164xd_symbol_to_dbus_type (object)
162 : (EQ (object, QCdbus_type_boolean)) ? DBUS_TYPE_BOOLEAN \ 165 Lisp_Object object;
163 : (EQ (object, QCdbus_type_int16)) ? DBUS_TYPE_INT16 \ 166{
164 : (EQ (object, QCdbus_type_uint16)) ? DBUS_TYPE_UINT16 \ 167 return
165 : (EQ (object, QCdbus_type_int32)) ? DBUS_TYPE_INT32 \ 168 ((EQ (object, QCdbus_type_byte)) ? DBUS_TYPE_BYTE
166 : (EQ (object, QCdbus_type_uint32)) ? DBUS_TYPE_UINT32 \ 169 : (EQ (object, QCdbus_type_boolean)) ? DBUS_TYPE_BOOLEAN
167 : (EQ (object, QCdbus_type_int64)) ? DBUS_TYPE_INT64 \ 170 : (EQ (object, QCdbus_type_int16)) ? DBUS_TYPE_INT16
168 : (EQ (object, QCdbus_type_uint64)) ? DBUS_TYPE_UINT64 \ 171 : (EQ (object, QCdbus_type_uint16)) ? DBUS_TYPE_UINT16
169 : (EQ (object, QCdbus_type_double)) ? DBUS_TYPE_DOUBLE \ 172 : (EQ (object, QCdbus_type_int32)) ? DBUS_TYPE_INT32
170 : (EQ (object, QCdbus_type_string)) ? DBUS_TYPE_STRING \ 173 : (EQ (object, QCdbus_type_uint32)) ? DBUS_TYPE_UINT32
171 : (EQ (object, QCdbus_type_object_path)) ? DBUS_TYPE_OBJECT_PATH \ 174 : (EQ (object, QCdbus_type_int64)) ? DBUS_TYPE_INT64
172 : (EQ (object, QCdbus_type_signature)) ? DBUS_TYPE_SIGNATURE \ 175 : (EQ (object, QCdbus_type_uint64)) ? DBUS_TYPE_UINT64
173 : (EQ (object, QCdbus_type_array)) ? DBUS_TYPE_ARRAY \ 176 : (EQ (object, QCdbus_type_double)) ? DBUS_TYPE_DOUBLE
174 : (EQ (object, QCdbus_type_variant)) ? DBUS_TYPE_VARIANT \ 177 : (EQ (object, QCdbus_type_string)) ? DBUS_TYPE_STRING
175 : (EQ (object, QCdbus_type_struct)) ? DBUS_TYPE_STRUCT \ 178 : (EQ (object, QCdbus_type_object_path)) ? DBUS_TYPE_OBJECT_PATH
176 : (EQ (object, QCdbus_type_dict_entry)) ? DBUS_TYPE_DICT_ENTRY \ 179 : (EQ (object, QCdbus_type_signature)) ? DBUS_TYPE_SIGNATURE
177 : DBUS_TYPE_INVALID) 180 : (EQ (object, QCdbus_type_array)) ? DBUS_TYPE_ARRAY
181 : (EQ (object, QCdbus_type_variant)) ? DBUS_TYPE_VARIANT
182 : (EQ (object, QCdbus_type_struct)) ? DBUS_TYPE_STRUCT
183 : (EQ (object, QCdbus_type_dict_entry)) ? DBUS_TYPE_DICT_ENTRY
184 : DBUS_TYPE_INVALID);
185}
178 186
179/* Check whether a Lisp symbol is a predefined D-Bus type symbol. */ 187/* Check whether a Lisp symbol is a predefined D-Bus type symbol. */
180#define XD_DBUS_TYPE_P(object) \ 188#define XD_DBUS_TYPE_P(object) \
181 (SYMBOLP (object) && ((XD_SYMBOL_TO_DBUS_TYPE (object) != DBUS_TYPE_INVALID))) 189 (SYMBOLP (object) && ((xd_symbol_to_dbus_type (object) != DBUS_TYPE_INVALID)))
182 190
183/* Determine the DBusType of a given Lisp OBJECT. It is used to 191/* Determine the DBusType of a given Lisp OBJECT. It is used to
184 convert Lisp objects, being arguments of `dbus-call-method' or 192 convert Lisp objects, being arguments of `dbus-call-method' or
@@ -190,12 +198,12 @@ int xd_in_read_queued_messages = 0;
190 : (INTEGERP (object)) ? DBUS_TYPE_INT32 \ 198 : (INTEGERP (object)) ? DBUS_TYPE_INT32 \
191 : (FLOATP (object)) ? DBUS_TYPE_DOUBLE \ 199 : (FLOATP (object)) ? DBUS_TYPE_DOUBLE \
192 : (STRINGP (object)) ? DBUS_TYPE_STRING \ 200 : (STRINGP (object)) ? DBUS_TYPE_STRING \
193 : (XD_DBUS_TYPE_P (object)) ? XD_SYMBOL_TO_DBUS_TYPE (object) \ 201 : (XD_DBUS_TYPE_P (object)) ? xd_symbol_to_dbus_type (object) \
194 : (CONSP (object)) \ 202 : (CONSP (object)) \
195 ? ((XD_DBUS_TYPE_P (CAR_SAFE (object))) \ 203 ? ((XD_DBUS_TYPE_P (CAR_SAFE (object))) \
196 ? ((XD_BASIC_DBUS_TYPE (XD_SYMBOL_TO_DBUS_TYPE (CAR_SAFE (object)))) \ 204 ? ((XD_BASIC_DBUS_TYPE (xd_symbol_to_dbus_type (CAR_SAFE (object)))) \
197 ? DBUS_TYPE_ARRAY \ 205 ? DBUS_TYPE_ARRAY \
198 : XD_SYMBOL_TO_DBUS_TYPE (CAR_SAFE (object))) \ 206 : xd_symbol_to_dbus_type (CAR_SAFE (object))) \
199 : DBUS_TYPE_ARRAY) \ 207 : DBUS_TYPE_ARRAY) \
200 : DBUS_TYPE_INVALID) 208 : DBUS_TYPE_INVALID)
201 209
@@ -210,7 +218,7 @@ int xd_in_read_queued_messages = 0;
210 a type symbol. PARENT_TYPE is the DBusType of a container this 218 a type symbol. PARENT_TYPE is the DBusType of a container this
211 signature is embedded, or DBUS_TYPE_INVALID. It is needed for the 219 signature is embedded, or DBUS_TYPE_INVALID. It is needed for the
212 check that DBUS_TYPE_DICT_ENTRY occurs only as array element. */ 220 check that DBUS_TYPE_DICT_ENTRY occurs only as array element. */
213void 221static void
214xd_signature (signature, dtype, parent_type, object) 222xd_signature (signature, dtype, parent_type, object)
215 char *signature; 223 char *signature;
216 unsigned int dtype, parent_type; 224 unsigned int dtype, parent_type;
@@ -382,7 +390,7 @@ xd_signature (signature, dtype, parent_type, object)
382 objects, being arguments of `dbus-call-method' or 390 objects, being arguments of `dbus-call-method' or
383 `dbus-send-signal', into corresponding C values appended as 391 `dbus-send-signal', into corresponding C values appended as
384 arguments to a D-Bus message. */ 392 arguments to a D-Bus message. */
385void 393static void
386xd_append_arg (dtype, object, iter) 394xd_append_arg (dtype, object, iter)
387 unsigned int dtype; 395 unsigned int dtype;
388 Lisp_Object object; 396 Lisp_Object object;
@@ -578,7 +586,7 @@ xd_append_arg (dtype, object, iter)
578 a converted Lisp object. The type DTYPE of the argument of the 586 a converted Lisp object. The type DTYPE of the argument of the
579 D-Bus message must be a valid DBusType. Compound D-Bus types 587 D-Bus message must be a valid DBusType. Compound D-Bus types
580 result always in a Lisp list. */ 588 result always in a Lisp list. */
581Lisp_Object 589static Lisp_Object
582xd_retrieve_arg (dtype, iter) 590xd_retrieve_arg (dtype, iter)
583 unsigned int dtype; 591 unsigned int dtype;
584 DBusMessageIter *iter; 592 DBusMessageIter *iter;
@@ -682,7 +690,7 @@ xd_retrieve_arg (dtype, iter)
682 690
683/* Initialize D-Bus connection. BUS is a Lisp symbol, either :system 691/* Initialize D-Bus connection. BUS is a Lisp symbol, either :system
684 or :session. It tells which D-Bus to be initialized. */ 692 or :session. It tells which D-Bus to be initialized. */
685DBusConnection * 693static DBusConnection *
686xd_initialize (bus) 694xd_initialize (bus)
687 Lisp_Object bus; 695 Lisp_Object bus;
688{ 696{
@@ -1404,7 +1412,7 @@ usage: (dbus-send-signal BUS SERVICE PATH INTERFACE SIGNAL &rest ARGS) */)
1404 1412
1405/* Read queued incoming message of the D-Bus BUS. BUS is a Lisp 1413/* Read queued incoming message of the D-Bus BUS. BUS is a Lisp
1406 symbol, either :system or :session. */ 1414 symbol, either :system or :session. */
1407Lisp_Object 1415static Lisp_Object
1408xd_read_message (bus) 1416xd_read_message (bus)
1409 Lisp_Object bus; 1417 Lisp_Object bus;
1410{ 1418{