[daemon-fix] fixed querying about name information
[platform/upstream/dbus.git] / tools / dbus-print-message.c
index 8a8e351..75d00ac 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  *
  */
+
+#include <config.h>
 #include "dbus-print-message.h"
 
 #include <stdlib.h>
+#include "config.h"
 
 static const char*
 type_to_name (int message_type)
@@ -53,7 +56,7 @@ indent (int depth)
 static void
 print_hex (unsigned char *bytes, unsigned int len, int depth)
 {
-  int i, columns;
+  unsigned int i, columns;
 
   printf ("array of bytes [\n");
 
@@ -225,7 +228,11 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
          {
            dbus_int64_t val;
            dbus_message_iter_get_basic (iter, &val);
-           printf ("int64 %lld\n", val);
+#ifdef DBUS_INT64_PRINTF_MODIFIER
+        printf ("int64 %" DBUS_INT64_PRINTF_MODIFIER "d\n", val);
+#else
+        printf ("int64 (omitted)\n");
+#endif
            break;
          }
 
@@ -233,7 +240,11 @@ print_iter (DBusMessageIter *iter, dbus_bool_t literal, int depth)
          {
            dbus_uint64_t val;
            dbus_message_iter_get_basic (iter, &val);
-           printf ("uint64 %llu\n", val);
+#ifdef DBUS_INT64_PRINTF_MODIFIER
+        printf ("uint64 %" DBUS_INT64_PRINTF_MODIFIER "u\n", val);
+#else
+        printf ("uint64 (omitted)\n");
+#endif
            break;
          }