[libnet-dbus-perl] 288/335: Require min dbus == 1.00. Fix all compile warnings
Intrigeri
intrigeri at moszumanska.debian.org
Sat Mar 21 01:08:11 UTC 2015
This is an automated email from the git hooks/post-receive script.
intrigeri pushed a commit to branch experimental
in repository libnet-dbus-perl.
commit 78f9593eb36c7ac7844c6e19ad5debfa2dcb4b45
Author: Daniel P. Berrange <dan at berrange.com>
Date: Wed Jun 29 07:53:03 2011 +0100
Require min dbus == 1.00. Fix all compile warnings
---
DBus.xs | 21 +++++++++++----------
Makefile.PL | 7 +------
README | 6 ++----
3 files changed, 14 insertions(+), 20 deletions(-)
diff --git a/DBus.xs b/DBus.xs
index 681b423..2c000db 100644
--- a/DBus.xs
+++ b/DBus.xs
@@ -30,6 +30,11 @@ static int net_dbus_debug = 0;
#define DEBUG_MSG(...)
#endif
+#ifdef __GNUC__
+# define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; }))
+#else
+# define ignore_value(x) x
+#endif
/*
* On 32-bit OS (and some 64-bit) Perl does not have an
@@ -130,7 +135,7 @@ _watch_generic(DBusWatch *watch, void *data, char *key, dbus_bool_t server) {
if (!call) {
warn("Could not find watch callback %s for fd %d\n",
- key, dbus_watch_get_fd(watch));
+ key, dbus_watch_get_unix_fd(watch));
return FALSE;
}
@@ -435,8 +440,8 @@ _sv_from_error (DBusError *error)
hv = newHV ();
/* map DBusError attributes to hash keys */
- hv_store (hv, "name", 4, newSVpv (error->name, 0), 0);
- hv_store (hv, "message", 7, newSVpv (error->message, 0), 0);
+ ignore_value(hv_store (hv, "name", 4, newSVpv (error->name, 0), 0));
+ ignore_value(hv_store (hv, "message", 7, newSVpv (error->message, 0), 0));
return sv_bless (newRV_noinc ((SV*) hv), gv_stashpv ("Net::DBus::Error", TRUE));
}
@@ -455,7 +460,7 @@ _croak_error (DBusError *error)
void
_populate_constant(HV *href, char *name, int val)
{
- hv_store(href, name, strlen(name), newSViv(val), 0);
+ ignore_value(hv_store(href, name, strlen(name), newSViv(val), 0));
}
#define REGISTER_CONSTANT(name, key) _populate_constant(constants, #key, name)
@@ -569,11 +574,7 @@ dbus_connection_disconnect(con)
DBusConnection *con;
CODE:
DEBUG_MSG("Closing connection %p\n", con);
-#if HAVE_CONN_DISCONNECT
- dbus_connection_disconnect(con);
-#else
dbus_connection_close(con);
-#endif
void
dbus_connection_ref(con)
@@ -1198,7 +1199,7 @@ int
get_fileno(watch)
DBusWatch *watch;
CODE:
- RETVAL = dbus_watch_get_fd(watch);
+ RETVAL = dbus_watch_get_unix_fd(watch);
OUTPUT:
RETVAL
@@ -1223,7 +1224,7 @@ handle(watch, flags)
DBusWatch *watch;
unsigned int flags;
CODE:
- DEBUG_MSG("Handling event %d on fd %d (%p)\n", flags, dbus_watch_get_fd(watch), watch);
+ DEBUG_MSG("Handling event %d on fd %d (%p)\n", flags, dbus_watch_get_unix_fd(watch), watch);
dbus_watch_handle(watch, flags);
diff --git a/Makefile.PL b/Makefile.PL
index 8f62152..2973a69 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -3,9 +3,6 @@ use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
-`pkg-config --atleast-version=0.90 dbus-1`;
-my $has_0_90 = (($? >> 8) == 0 ? 1 : 0);
-
my $DBUS_LIBS = `pkg-config --libs dbus-1`;
my $DBUS_CFLAGS = `pkg-config --cflags dbus-1`;
@@ -31,9 +28,7 @@ WriteMakefile(
},
'AUTHOR' => 'Daniel Berrange <dan at berrange.com>',
'LIBS' => [$DBUS_LIBS],
- 'DEFINE' => ($has_0_90 ?
- "-DDBUS_API_SUBJECT_TO_CHANGE -DHAVE_CONN_DISCONNECT=0 -DNET_DBUS_DEBUG=1" :
- "-DDBUS_API_SUBJECT_TO_CHANGE -DHAVE_CONN_DISCONNECT=1 -DNET_DBUS_DEBUG=1"),
+ 'DEFINE' => ("-DNET_DBUS_DEBUG=1"),
'INC' => "$wall $DBUS_CFLAGS",
'NO_META' => 1,
'depend' => {
diff --git a/README b/README
index 5df3453..7d51005 100644
--- a/README
+++ b/README
@@ -9,9 +9,7 @@ project website at:
http://www.freedesktop.org/software/dbus/
-This version operates against DBus 0.33, through 0.60, and
-possibly later versions, if there have been no serious API
-changes.
+This version operates against DBus 1.00, and later
INSTALLATION
------------
@@ -113,7 +111,7 @@ Daniel Berrange <dan at berrange dot com>
COPYRIGHT AND LICENCE
---------------------
-Copyright (C) 2004-2008 Daniel Berrange
+Copyright (C) 2004-2011 Daniel Berrange
Net-DBus may be redistributed and/or modified under the terms of Perl itself.
Either:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libnet-dbus-perl.git
More information about the Pkg-perl-cvs-commits
mailing list