[glibmm] Fix make check when _WRAP_ENUM generates enum class
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Fix make check when _WRAP_ENUM generates enum class
- Date: Tue, 11 Apr 2017 17:38:29 +0000 (UTC)
commit c65601e351af5f5d4d8f741b2118913a727951ff
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Tue Apr 11 19:33:44 2017 +0200
Fix make check when _WRAP_ENUM generates enum class
Bug 86864
examples/dbus/client_bus_listnames.cc | 2 +-
examples/dbus/server_without_bus.cc | 3 ++-
examples/dbus/session_bus_service.cc | 2 +-
examples/iochannel_stream/main.cc | 4 ++--
examples/network/resolver.cc | 2 +-
examples/network/socket-client.cc | 10 +++++-----
examples/network/socket-server.cc | 12 ++++++------
tests/giomm_tls_client/main.cc | 2 +-
tests/glibmm_date/main.cc | 4 ++--
9 files changed, 21 insertions(+), 20 deletions(-)
---
diff --git a/examples/dbus/client_bus_listnames.cc b/examples/dbus/client_bus_listnames.cc
index c9a644f..a0d22fb 100644
--- a/examples/dbus/client_bus_listnames.cc
+++ b/examples/dbus/client_bus_listnames.cc
@@ -85,7 +85,7 @@ main(int, char**)
loop = Glib::MainLoop::create();
// Get the user session bus connection.
- auto connection = Gio::DBus::Connection::get_sync(Gio::DBus::BUS_TYPE_SESSION);
+ auto connection = Gio::DBus::Connection::get_sync(Gio::DBus::BusType::SESSION);
// Check for an unavailable connection.
if (!connection)
diff --git a/examples/dbus/server_without_bus.cc b/examples/dbus/server_without_bus.cc
index 953fd26..a474d79 100644
--- a/examples/dbus/server_without_bus.cc
+++ b/examples/dbus/server_without_bus.cc
@@ -124,7 +124,8 @@ on_server_new_connection(const Glib::RefPtr<Gio::DBus::Connection>& connection)
std::cout << "Client connected." << std::endl
<< "Peer credentials: " << credentials_str << std::endl
<< "Negotiated capabilities: unix-fd-passing="
- << (connection->get_capabilities() & Gio::DBus::CAPABILITY_FLAGS_UNIX_FD_PASSING)
+ << ((connection->get_capabilities() & Gio::DBus::CapabilityFlags::UNIX_FD_PASSING)
+ == Gio::DBus::CapabilityFlags::UNIX_FD_PASSING)
<< std::endl;
// If there is already an active connection, do not accept this new one.
diff --git a/examples/dbus/session_bus_service.cc b/examples/dbus/session_bus_service.cc
index b190db3..1c137a0 100644
--- a/examples/dbus/session_bus_service.cc
+++ b/examples/dbus/session_bus_service.cc
@@ -157,7 +157,7 @@ main(int, char**)
return 1;
}
- const auto id = Gio::DBus::own_name(Gio::DBus::BUS_TYPE_SESSION, "org.glibmm.DBusExample",
+ const auto id = Gio::DBus::own_name(Gio::DBus::BusType::SESSION, "org.glibmm.DBusExample",
sigc::ptr_fun(&on_bus_acquired), sigc::ptr_fun(&on_name_acquired),
sigc::ptr_fun(&on_name_lost));
diff --git a/examples/iochannel_stream/main.cc b/examples/iochannel_stream/main.cc
index 45a7721..8234ccd 100644
--- a/examples/iochannel_stream/main.cc
+++ b/examples/iochannel_stream/main.cc
@@ -44,7 +44,7 @@ Glib::RefPtr<Glib::MainLoop> mainloop;
bool
MyCallback(Glib::IOCondition io_condition)
{
- if ((io_condition & Glib::IO_IN) == 0)
+ if ((io_condition & Glib::IOCondition::IN) != Glib::IOCondition::IN)
{
std::cerr << "Invalid fifo response" << std::endl;
}
@@ -89,7 +89,7 @@ int main(/* int argc, char *argv[] */)
}
input_stream.attach(read_fd);
- input_stream.connect(sigc::ptr_fun(MyCallback), Glib::IO_IN);
+ input_stream.connect(sigc::ptr_fun(MyCallback), Glib::IOCondition::IN);
// and last but not least - run the application main loop
mainloop->run();
diff --git a/examples/network/resolver.cc b/examples/network/resolver.cc
index 6fb0780..d838213 100644
--- a/examples/network/resolver.cc
+++ b/examples/network/resolver.cc
@@ -466,7 +466,7 @@ main(int argc, char** argv)
signal(SIGINT, interrupted);
chan = Glib::IOChannel::create_from_fd(cancel_fds[0]);
- const auto source = chan->create_watch(Glib::IO_IN);
+ const auto source = chan->create_watch(Glib::IOCondition::IN);
watch_conn = source->connect(sigc::bind(sigc::ptr_fun(async_cancel), cancellable));
#endif
diff --git a/examples/network/socket-client.cc b/examples/network/socket-client.cc
index bf8dd4d..ed312aa 100644
--- a/examples/network/socket-client.cc
+++ b/examples/network/socket-client.cc
@@ -188,12 +188,12 @@ main(int argc, char* argv[])
loop = Glib::MainLoop::create();
- socket_type = use_udp ? Gio::SOCKET_TYPE_DATAGRAM : Gio::SOCKET_TYPE_STREAM;
- socket_family = use_ipv6 ? Gio::SOCKET_FAMILY_IPV6 : Gio::SOCKET_FAMILY_IPV4;
+ socket_type = use_udp ? Gio::SocketType::DATAGRAM : Gio::SocketType::STREAM;
+ socket_family = use_ipv6 ? Gio::SocketFamily::IPV6 : Gio::SocketFamily::IPV4;
try
{
- socket = Gio::Socket::create(socket_family, socket_type, Gio::SOCKET_PROTOCOL_DEFAULT);
+ socket = Gio::Socket::create(socket_family, socket_type, Gio::SocketProtocol::DEFAULT);
}
catch (const Gio::Error& error)
{
@@ -272,7 +272,7 @@ main(int argc, char* argv[])
buffer[to_send] = '\0';
while (to_send > 0)
{
- ensure_condition(socket, "send", cancellable, Glib::IO_OUT);
+ ensure_condition(socket, "send", cancellable, Glib::IOCondition::OUT);
try
{
if (use_udp)
@@ -305,7 +305,7 @@ main(int argc, char* argv[])
to_send -= size;
}
- ensure_condition(socket, "receive", cancellable, Glib::IO_IN);
+ ensure_condition(socket, "receive", cancellable, Glib::IOCondition::IN);
try
{
if (use_udp)
diff --git a/examples/network/socket-server.cc b/examples/network/socket-server.cc
index 8db9406..436e836 100644
--- a/examples/network/socket-server.cc
+++ b/examples/network/socket-server.cc
@@ -176,12 +176,12 @@ main(int argc, char* argv[])
loop = Glib::MainLoop::create();
- auto socket_type = use_udp ? Gio::SOCKET_TYPE_DATAGRAM : Gio::SOCKET_TYPE_STREAM;
- auto socket_family = use_ipv6 ? Gio::SOCKET_FAMILY_IPV6 : Gio::SOCKET_FAMILY_IPV4;
+ auto socket_type = use_udp ? Gio::SocketType::DATAGRAM : Gio::SocketType::STREAM;
+ auto socket_family = use_ipv6 ? Gio::SocketFamily::IPV6 : Gio::SocketFamily::IPV4;
try
{
- socket = Gio::Socket::create(socket_family, socket_type, Gio::SOCKET_PROTOCOL_DEFAULT);
+ socket = Gio::Socket::create(socket_family, socket_type, Gio::SocketProtocol::DEFAULT);
}
catch (const Gio::Error& error)
{
@@ -218,7 +218,7 @@ main(int argc, char* argv[])
std::cout << Glib::ustring::compose("listening on port %1...\n", port);
- ensure_condition(socket, "accept", cancellable, Glib::IO_IN);
+ ensure_condition(socket, "accept", cancellable, Glib::IOCondition::IN);
try
{
new_socket = socket->accept(cancellable);
@@ -257,7 +257,7 @@ main(int argc, char* argv[])
gchar buffer[4096] = {};
gssize size;
- ensure_condition(recv_socket, "receive", cancellable, Glib::IO_IN);
+ ensure_condition(recv_socket, "receive", cancellable, Glib::IOCondition::IN);
try
{
if (use_udp)
@@ -289,7 +289,7 @@ main(int argc, char* argv[])
while (to_send > 0)
{
- ensure_condition(recv_socket, "send", cancellable, Glib::IO_OUT);
+ ensure_condition(recv_socket, "send", cancellable, Glib::IOCondition::OUT);
try
{
if (use_udp)
diff --git a/tests/giomm_tls_client/main.cc b/tests/giomm_tls_client/main.cc
index beedd4c..e53c24b 100644
--- a/tests/giomm_tls_client/main.cc
+++ b/tests/giomm_tls_client/main.cc
@@ -77,7 +77,7 @@ main(int, char**)
<< std::endl;
auto socket = Gio::Socket::create(
- first_inet_address->get_family(), Gio::SOCKET_TYPE_STREAM, Gio::SOCKET_PROTOCOL_TCP);
+ first_inet_address->get_family(), Gio::SocketType::STREAM, Gio::SocketProtocol::TCP);
auto address = Gio::InetSocketAddress::create(first_inet_address, 443);
diff --git a/tests/glibmm_date/main.cc b/tests/glibmm_date/main.cc
index 1e6411d..e92559c 100644
--- a/tests/glibmm_date/main.cc
+++ b/tests/glibmm_date/main.cc
@@ -17,7 +17,7 @@ main(int, char**)
date.subtract_days(1);
date.add_years(1);
- ostr << "The date a year and a month from yesterday will be: " << date.get_month() << "/"
+ ostr << "The date a year and a month from yesterday will be: " << date.get_month_as_int() << "/"
<< (int)date.get_day() << "/" << date.get_year() << "." << std::endl;
Glib::Date copy_date(date);
@@ -25,7 +25,7 @@ main(int, char**)
assigned_date = copy_date;
- ostr << "The copied date is: " << copy_date.get_month() << "/" << (int)copy_date.get_day() << "/"
+ ostr << "The copied date is: " << copy_date.get_month_as_int() << "/" << (int)copy_date.get_day() << "/"
<< copy_date.get_year() << "." << std::endl;
return EXIT_SUCCESS;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]