[glibmm/vector] Fixed examples and tests.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm/vector] Fixed examples and tests.
- Date: Sat, 22 Jan 2011 11:06:14 +0000 (UTC)
commit 879f1c65a4910a3d511a00427ee2c7614cebe458
Author: Krzesimir Nowak <qdlacz gmail com>
Date: Sat Jan 22 12:05:44 2011 +0100
Fixed examples and tests.
examples/child_watch/main.cc | 7 +++++--
examples/network/socket-client.cc | 8 +++++---
examples/network/socket-server.cc | 6 ++++--
tests/giomm_asyncresult_sourceobject/main.cc | 6 ++++--
4 files changed, 18 insertions(+), 9 deletions(-)
---
diff --git a/examples/child_watch/main.cc b/examples/child_watch/main.cc
index 3bbc368..d162eb2 100644
--- a/examples/child_watch/main.cc
+++ b/examples/child_watch/main.cc
@@ -15,11 +15,14 @@
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-#include <glibmm.h>
#include <sys/types.h>
#include <unistd.h>
+
+#include <cstdlib>
#include <iostream>
+#include <glibmm.h>
+
using namespace std;
class ChildWatch : public sigc::trackable
@@ -43,7 +46,7 @@ void ChildWatch::run()
if(pid==0)
{
sleep(5);
- exit(0);
+ std::exit(EXIT_SUCCESS);
}
std:: cout << "Child " << pid << " created" << std::endl;
diff --git a/examples/network/socket-client.cc b/examples/network/socket-client.cc
index 33428b2..9afa4d6 100644
--- a/examples/network/socket-client.cc
+++ b/examples/network/socket-client.cc
@@ -1,8 +1,10 @@
#include <cstring>
-#include <giomm.h>
-#include <glibmm.h>
+#include <cstdlib>
#include <iostream>
+#include <glibmm.h>
+#include <giomm.h>
+
Glib::RefPtr<Glib::MainLoop> loop;
gboolean verbose = FALSE;
@@ -81,7 +83,7 @@ ensure_condition (const Glib::RefPtr<Gio::Socket>& socket,
{
std::cerr << Glib::ustring::compose("condition wait error for %1: %2\n",
where, error.what ());
- exit (1);
+ std::exit (EXIT_FAILURE);
}
}
}
diff --git a/examples/network/socket-server.cc b/examples/network/socket-server.cc
index d2dc315..cc406c6 100644
--- a/examples/network/socket-server.cc
+++ b/examples/network/socket-server.cc
@@ -1,6 +1,8 @@
+#include <cstdlib>
#include <iostream>
-#include <giomm.h>
+
#include <glibmm.h>
+#include <giomm.h>
Glib::RefPtr<Glib::MainLoop> loop;
@@ -86,7 +88,7 @@ ensure_condition (const Glib::RefPtr<Gio::Socket>& socket,
{
std::cerr << Glib::ustring::compose("condition wait error for %1: %2\n",
where, error.what ());
- exit (1);
+ std::exit (EXIT_FAILURE);
}
}
}
diff --git a/tests/giomm_asyncresult_sourceobject/main.cc b/tests/giomm_asyncresult_sourceobject/main.cc
index 1c9f1a1..957ed83 100644
--- a/tests/giomm_asyncresult_sourceobject/main.cc
+++ b/tests/giomm_asyncresult_sourceobject/main.cc
@@ -1,6 +1,8 @@
-#include <giomm.h>
+#include <cstdlib>
#include <iostream>
+#include <giomm.h>
+
void on_read_async(const Glib::RefPtr<Gio::AsyncResult>& result)
{
std::cout << "Testing result ... "
@@ -12,7 +14,7 @@ void on_read_async(const Glib::RefPtr<Gio::AsyncResult>& result)
std::cout << "Testing Gio::AsyncResult's get_source_object ... "
<< (result->get_source_object_base() ? "OK!" : "FAILED!") << std::endl;
- exit(EXIT_SUCCESS);
+ std::exit(EXIT_SUCCESS);
}
int main(int, char**)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]