emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src dbusbind.c [EMACS_23_1_RC]


From: Michael Albinus
Subject: [Emacs-diffs] emacs/src dbusbind.c [EMACS_23_1_RC]
Date: Sun, 28 Jun 2009 15:40:19 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_23_1_RC
Changes by:     Michael Albinus <albinus>       09/06/28 15:40:19

Modified files:
        src            : dbusbind.c 

Log message:
        * 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.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/dbusbind.c?cvsroot=emacs&only_with_tag=EMACS_23_1_RC&r1=1.37&r2=1.37.2.1

Patches:
Index: dbusbind.c
===================================================================
RCS file: /sources/emacs/emacs/src/dbusbind.c,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -u -b -r1.37 -r1.37.2.1
--- dbusbind.c  18 Jan 2009 03:58:10 -0000      1.37
+++ dbusbind.c  28 Jun 2009 15:40:19 -0000      1.37.2.1
@@ -155,30 +155,38 @@
    || (type ==  DBUS_TYPE_OBJECT_PATH)                                 \
    || (type ==  DBUS_TYPE_SIGNATURE))
 
+/* This was a macro.  On Solaris 2.11 it was said to compile for
+   hours, when optimzation is enabled.  So we have transferred it into
+   a function.  */
 /* Determine the DBusType of a given Lisp symbol.  OBJECT must be one
    of the predefined D-Bus type symbols.  */
-#define XD_SYMBOL_TO_DBUS_TYPE(object)                                 \
-  ((EQ (object, QCdbus_type_byte)) ? DBUS_TYPE_BYTE                    \
-   : (EQ (object, QCdbus_type_boolean)) ? DBUS_TYPE_BOOLEAN            \
-   : (EQ (object, QCdbus_type_int16)) ? DBUS_TYPE_INT16                        
\
-   : (EQ (object, QCdbus_type_uint16)) ? DBUS_TYPE_UINT16              \
-   : (EQ (object, QCdbus_type_int32)) ? DBUS_TYPE_INT32                        
\
-   : (EQ (object, QCdbus_type_uint32)) ? DBUS_TYPE_UINT32              \
-   : (EQ (object, QCdbus_type_int64)) ? DBUS_TYPE_INT64                        
\
-   : (EQ (object, QCdbus_type_uint64)) ? DBUS_TYPE_UINT64              \
-   : (EQ (object, QCdbus_type_double)) ? DBUS_TYPE_DOUBLE              \
-   : (EQ (object, QCdbus_type_string)) ? DBUS_TYPE_STRING              \
-   : (EQ (object, QCdbus_type_object_path)) ? DBUS_TYPE_OBJECT_PATH    \
-   : (EQ (object, QCdbus_type_signature)) ? DBUS_TYPE_SIGNATURE                
\
-   : (EQ (object, QCdbus_type_array)) ? DBUS_TYPE_ARRAY                        
\
-   : (EQ (object, QCdbus_type_variant)) ? DBUS_TYPE_VARIANT            \
-   : (EQ (object, QCdbus_type_struct)) ? DBUS_TYPE_STRUCT              \
-   : (EQ (object, QCdbus_type_dict_entry)) ? DBUS_TYPE_DICT_ENTRY      \
-   : DBUS_TYPE_INVALID)
+static int
+xd_symbol_to_dbus_type (object)
+     Lisp_Object object;
+{
+  return
+    ((EQ (object, QCdbus_type_byte)) ? DBUS_TYPE_BYTE
+     : (EQ (object, QCdbus_type_boolean)) ? DBUS_TYPE_BOOLEAN
+     : (EQ (object, QCdbus_type_int16)) ? DBUS_TYPE_INT16
+     : (EQ (object, QCdbus_type_uint16)) ? DBUS_TYPE_UINT16
+     : (EQ (object, QCdbus_type_int32)) ? DBUS_TYPE_INT32
+     : (EQ (object, QCdbus_type_uint32)) ? DBUS_TYPE_UINT32
+     : (EQ (object, QCdbus_type_int64)) ? DBUS_TYPE_INT64
+     : (EQ (object, QCdbus_type_uint64)) ? DBUS_TYPE_UINT64
+     : (EQ (object, QCdbus_type_double)) ? DBUS_TYPE_DOUBLE
+     : (EQ (object, QCdbus_type_string)) ? DBUS_TYPE_STRING
+     : (EQ (object, QCdbus_type_object_path)) ? DBUS_TYPE_OBJECT_PATH
+     : (EQ (object, QCdbus_type_signature)) ? DBUS_TYPE_SIGNATURE
+     : (EQ (object, QCdbus_type_array)) ? DBUS_TYPE_ARRAY
+     : (EQ (object, QCdbus_type_variant)) ? DBUS_TYPE_VARIANT
+     : (EQ (object, QCdbus_type_struct)) ? DBUS_TYPE_STRUCT
+     : (EQ (object, QCdbus_type_dict_entry)) ? DBUS_TYPE_DICT_ENTRY
+     : DBUS_TYPE_INVALID);
+}
 
 /* Check whether a Lisp symbol is a predefined D-Bus type symbol.  */
 #define XD_DBUS_TYPE_P(object)                                         \
-  (SYMBOLP (object) && ((XD_SYMBOL_TO_DBUS_TYPE (object) != 
DBUS_TYPE_INVALID)))
+  (SYMBOLP (object) && ((xd_symbol_to_dbus_type (object) != 
DBUS_TYPE_INVALID)))
 
 /* Determine the DBusType of a given Lisp OBJECT.  It is used to
    convert Lisp objects, being arguments of `dbus-call-method' or
@@ -190,12 +198,12 @@
    : (INTEGERP (object)) ? DBUS_TYPE_INT32                             \
    : (FLOATP (object)) ? DBUS_TYPE_DOUBLE                              \
    : (STRINGP (object)) ? DBUS_TYPE_STRING                             \
-   : (XD_DBUS_TYPE_P (object)) ? XD_SYMBOL_TO_DBUS_TYPE (object)       \
+   : (XD_DBUS_TYPE_P (object)) ? xd_symbol_to_dbus_type (object)       \
    : (CONSP (object))                                                  \
    ? ((XD_DBUS_TYPE_P (CAR_SAFE (object)))                             \
-      ? ((XD_BASIC_DBUS_TYPE (XD_SYMBOL_TO_DBUS_TYPE (CAR_SAFE (object)))) \
+      ? ((XD_BASIC_DBUS_TYPE (xd_symbol_to_dbus_type (CAR_SAFE (object)))) \
         ? DBUS_TYPE_ARRAY                                              \
-        : XD_SYMBOL_TO_DBUS_TYPE (CAR_SAFE (object)))                  \
+        : xd_symbol_to_dbus_type (CAR_SAFE (object)))                  \
       : DBUS_TYPE_ARRAY)                                               \
    : DBUS_TYPE_INVALID)
 
@@ -210,7 +218,7 @@
    a type symbol.  PARENT_TYPE is the DBusType of a container this
    signature is embedded, or DBUS_TYPE_INVALID.  It is needed for the
    check that DBUS_TYPE_DICT_ENTRY occurs only as array element.  */
-void
+static void
 xd_signature (signature, dtype, parent_type, object)
      char *signature;
      unsigned int dtype, parent_type;
@@ -382,7 +390,7 @@
    objects, being arguments of `dbus-call-method' or
    `dbus-send-signal', into corresponding C values appended as
    arguments to a D-Bus message.  */
-void
+static void
 xd_append_arg (dtype, object, iter)
      unsigned int dtype;
      Lisp_Object object;
@@ -578,7 +586,7 @@
    a converted Lisp object.  The type DTYPE of the argument of the
    D-Bus message must be a valid DBusType.  Compound D-Bus types
    result always in a Lisp list.  */
-Lisp_Object
+static Lisp_Object
 xd_retrieve_arg (dtype, iter)
      unsigned int dtype;
      DBusMessageIter *iter;
@@ -682,7 +690,7 @@
 
 /* Initialize D-Bus connection.  BUS is a Lisp symbol, either :system
    or :session.  It tells which D-Bus to be initialized.  */
-DBusConnection *
+static DBusConnection *
 xd_initialize (bus)
      Lisp_Object bus;
 {
@@ -1404,7 +1412,7 @@
 
 /* Read queued incoming message of the D-Bus BUS.  BUS is a Lisp
    symbol, either :system or :session.  */
-Lisp_Object
+static Lisp_Object
 xd_read_message (bus)
      Lisp_Object bus;
 {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]