You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by mp...@apache.org on 2016/01/21 00:39:25 UTC
[1/3] mesos git commit: Removed `void` parameters in mesos.
Repository: mesos
Updated Branches:
refs/heads/master 037e0f83e -> 4d4d71664
Removed `void` parameters in mesos.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/4d4d7166
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/4d4d7166
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/4d4d7166
Branch: refs/heads/master
Commit: 4d4d7166414f0ebd8d5e40df34070446098a3c91
Parents: 05f9fb2
Author: Michael Park <mp...@apache.org>
Authored: Wed Jan 20 14:15:15 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jan 20 15:29:05 2016 -0800
----------------------------------------------------------------------
configure.ac | 8 ++++----
include/mesos/v1/scheduler.hpp | 4 ++--
m4/ax_pthread.m4 | 2 +-
src/master/validation.cpp | 8 ++++----
src/python/native/src/mesos/native/module.cpp | 2 +-
src/scheduler/scheduler.cpp | 12 ++++++------
src/tests/master_maintenance_tests.cpp | 4 ++--
src/tests/registrar_tests.cpp | 2 +-
src/tests/scheduler_tests.cpp | 4 ++--
9 files changed, 23 insertions(+), 23 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/configure.ac
----------------------------------------------------------------------
diff --git a/configure.ac b/configure.ac
index 40d60a6..70d1687 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1155,7 +1155,7 @@ set to an older version of Python.
# Render code that imports from the standard C++ library.
cat <<__EOF__ >testlib.cpp [
#include <string>
-std::string test(void)
+std::string test()
{
return std::string("42");
}]
@@ -1171,8 +1171,8 @@ __EOF__
#include <Python.h>
#include <string>
-std::string test(void);
-PyMODINIT_FUNC initminimal(void);
+std::string test();
+PyMODINIT_FUNC initminimal();
static PyObject *minimal_test(PyObject *self, PyObject* args)
{
@@ -1184,7 +1184,7 @@ static PyMethodDef minimal_methods[] = {
{ NULL, NULL }
};
-PyMODINIT_FUNC initminimal(void)
+PyMODINIT_FUNC initminimal()
{
PyImport_AddModule("minimal");
Py_InitModule("minimal", minimal_methods);
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/include/mesos/v1/scheduler.hpp
----------------------------------------------------------------------
diff --git a/include/mesos/v1/scheduler.hpp b/include/mesos/v1/scheduler.hpp
index fc8ae50..5e462c1 100644
--- a/include/mesos/v1/scheduler.hpp
+++ b/include/mesos/v1/scheduler.hpp
@@ -46,8 +46,8 @@ class Mesos
public:
Mesos(const std::string& master,
ContentType contentType,
- const std::function<void(void)>& connected,
- const std::function<void(void)>& disconnected,
+ const std::function<void()>& connected,
+ const std::function<void()>& disconnected,
const std::function<void(const std::queue<Event>&)>& received);
// Delete copy constructor.
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/m4/ax_pthread.m4
----------------------------------------------------------------------
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
index d383ad5..0b2071d 100644
--- a/m4/ax_pthread.m4
+++ b/m4/ax_pthread.m4
@@ -172,7 +172,7 @@ AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
save_CFLAGS="$CFLAGS"
ax_pthread_extra_flags="-Werror"
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo();],[foo()])],
[AC_MSG_RESULT([yes])],
[ax_pthread_extra_flags=
AC_MSG_RESULT([no])])
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/src/master/validation.cpp
----------------------------------------------------------------------
diff --git a/src/master/validation.cpp b/src/master/validation.cpp
index 98360b6..222bb34 100644
--- a/src/master/validation.cpp
+++ b/src/master/validation.cpp
@@ -495,7 +495,7 @@ Option<Error> validate(
// executed does matter! For example, 'validateResourceUsage'
// assumes that ExecutorInfo is valid which is verified by
// 'validateExecutorInfo'.
- vector<lambda::function<Option<Error>(void)>> validators = {
+ vector<lambda::function<Option<Error>()>> validators = {
lambda::bind(internal::validateTaskID, task),
lambda::bind(internal::validateUniqueTaskID, task, framework),
lambda::bind(internal::validateSlaveID, task, slave),
@@ -509,7 +509,7 @@ Option<Error> validate(
// TODO(jieyu): Add a validateCommandInfo function.
- foreach (const lambda::function<Option<Error>(void)>& validator, validators) {
+ foreach (const lambda::function<Option<Error>()>& validator, validators) {
Option<Error> error = validator();
if (error.isSome()) {
return error;
@@ -629,13 +629,13 @@ Option<Error> validate(
CHECK_NOTNULL(master);
CHECK_NOTNULL(framework);
- vector<lambda::function<Option<Error>(void)>> validators = {
+ vector<lambda::function<Option<Error>()>> validators = {
lambda::bind(validateUniqueOfferID, offerIds),
lambda::bind(validateFramework, offerIds, master, framework),
lambda::bind(validateSlave, offerIds, master)
};
- foreach (const lambda::function<Option<Error>(void)>& validator, validators) {
+ foreach (const lambda::function<Option<Error>()>& validator, validators) {
Option<Error> error = validator();
if (error.isSome()) {
return error;
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/src/python/native/src/mesos/native/module.cpp
----------------------------------------------------------------------
diff --git a/src/python/native/src/mesos/native/module.cpp b/src/python/native/src/mesos/native/module.cpp
index 6e672a2..9237361 100644
--- a/src/python/native/src/mesos/native/module.cpp
+++ b/src/python/native/src/mesos/native/module.cpp
@@ -71,7 +71,7 @@ PyMethodDef MODULE_METHODS[] = {
/**
* Entry point called by Python to initialize our module.
*/
-PyMODINIT_FUNC init_mesos(void)
+PyMODINIT_FUNC init_mesos()
{
// Ensure that the interpreter's threading support is enabled.
PyEval_InitThreads();
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/src/scheduler/scheduler.cpp
----------------------------------------------------------------------
diff --git a/src/scheduler/scheduler.cpp b/src/scheduler/scheduler.cpp
index a17872b..99a7d0d 100644
--- a/src/scheduler/scheduler.cpp
+++ b/src/scheduler/scheduler.cpp
@@ -105,8 +105,8 @@ public:
MesosProcess(
const string& master,
ContentType _contentType,
- const lambda::function<void(void)>& _connected,
- const lambda::function<void(void)>& _disconnected,
+ const lambda::function<void()>& _connected,
+ const lambda::function<void()>& _disconnected,
lambda::function<void(const queue<Event>&)> _received)
: ProcessBase(ID::generate("scheduler")),
contentType(_contentType),
@@ -494,8 +494,8 @@ private:
Mutex mutex; // Used to serialize the callback invocations.
- lambda::function<void(void)> connected;
- lambda::function<void(void)> disconnected;
+ lambda::function<void()> connected;
+ lambda::function<void()> disconnected;
lambda::function<void(const queue<Event>&)> received;
bool local; // Whether or not we launched a local cluster.
@@ -513,8 +513,8 @@ private:
Mesos::Mesos(
const string& master,
ContentType contentType,
- const lambda::function<void(void)>& connected,
- const lambda::function<void(void)>& disconnected,
+ const lambda::function<void()>& connected,
+ const lambda::function<void()>& disconnected,
const lambda::function<void(const queue<Event>&)>& received)
{
process = new MesosProcess(
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/src/tests/master_maintenance_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/master_maintenance_tests.cpp b/src/tests/master_maintenance_tests.cpp
index 2da6a2d..b98eede 100644
--- a/src/tests/master_maintenance_tests.cpp
+++ b/src/tests/master_maintenance_tests.cpp
@@ -156,8 +156,8 @@ protected:
class Callbacks
{
public:
- MOCK_METHOD0(connected, void(void));
- MOCK_METHOD0(disconnected, void(void));
+ MOCK_METHOD0(connected, void());
+ MOCK_METHOD0(disconnected, void());
MOCK_METHOD1(received, void(const std::queue<Event>&));
};
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/src/tests/registrar_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/registrar_tests.cpp b/src/tests/registrar_tests.cpp
index 8374742..58b3fcc 100644
--- a/src/tests/registrar_tests.cpp
+++ b/src/tests/registrar_tests.cpp
@@ -920,7 +920,7 @@ public:
MOCK_METHOD1(get, Future<Option<Entry> >(const string&));
MOCK_METHOD2(set, Future<bool>(const Entry&, const UUID&));
MOCK_METHOD1(expunge, Future<bool>(const Entry&));
- MOCK_METHOD0(names, Future<std::set<string> >(void));
+ MOCK_METHOD0(names, Future<std::set<string>>());
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/4d4d7166/src/tests/scheduler_tests.cpp
----------------------------------------------------------------------
diff --git a/src/tests/scheduler_tests.cpp b/src/tests/scheduler_tests.cpp
index 6743210..4e2db2a 100644
--- a/src/tests/scheduler_tests.cpp
+++ b/src/tests/scheduler_tests.cpp
@@ -84,8 +84,8 @@ protected:
class Callbacks
{
public:
- MOCK_METHOD0(connected, void(void));
- MOCK_METHOD0(disconnected, void(void));
+ MOCK_METHOD0(connected, void());
+ MOCK_METHOD0(disconnected, void());
MOCK_METHOD1(received, void(const std::queue<Event>&));
};
};
[2/3] mesos git commit: Removed `void` parameters in libprocess.
Posted by mp...@apache.org.
Removed `void` parameters in libprocess.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/05f9fb2f
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/05f9fb2f
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/05f9fb2f
Branch: refs/heads/master
Commit: 05f9fb2fa66968f37418d28fc8cebd0770a54dca
Parents: 93a5708
Author: Michael Park <mp...@apache.org>
Authored: Wed Jan 20 14:14:54 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jan 20 15:29:05 2016 -0800
----------------------------------------------------------------------
3rdparty/libprocess/include/process/async.hpp | 34 +++++++-------
3rdparty/libprocess/include/process/clock.hpp | 2 +-
3rdparty/libprocess/include/process/defer.hpp | 42 +++++------------
.../libprocess/include/process/deferred.hpp | 12 ++---
.../libprocess/include/process/dispatch.hpp | 48 +++++---------------
3rdparty/libprocess/include/process/future.hpp | 4 +-
.../include/process/metrics/gauge.hpp | 11 ++---
3rdparty/libprocess/include/process/run.hpp | 14 +++---
.../libprocess/include/process/sequence.hpp | 8 ++--
3rdparty/libprocess/include/process/timer.hpp | 4 +-
3rdparty/libprocess/m4/ax_pthread.m4 | 2 +-
3rdparty/libprocess/src/clock.cpp | 2 +-
3rdparty/libprocess/src/event_loop.hpp | 2 +-
3rdparty/libprocess/src/libev.cpp | 17 ++++---
3rdparty/libprocess/src/libev.hpp | 6 +--
3rdparty/libprocess/src/libevent.cpp | 12 ++---
3rdparty/libprocess/src/libevent.hpp | 2 +-
3rdparty/libprocess/src/tests/process_tests.cpp | 20 ++++----
.../libprocess/src/tests/sequence_tests.cpp | 14 +++---
19 files changed, 105 insertions(+), 151 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/async.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/async.hpp b/3rdparty/libprocess/include/process/async.hpp
index d2d6945..84fd211 100644
--- a/3rdparty/libprocess/include/process/async.hpp
+++ b/3rdparty/libprocess/include/process/async.hpp
@@ -34,15 +34,15 @@ namespace process {
// brittle).
template <typename F>
-Future<typename result_of<F(void)>::type> async(
+Future<typename result_of<F()>::type> async(
const F& f,
- typename boost::disable_if<boost::is_void<typename result_of<F(void)>::type> >::type* = NULL); // NOLINT(whitespace/line_length)
+ typename boost::disable_if<boost::is_void<typename result_of<F()>::type> >::type* = NULL); // NOLINT(whitespace/line_length)
template <typename F>
Future<Nothing> async(
const F& f,
- typename boost::enable_if<boost::is_void<typename result_of<F(void)>::type> >::type* = NULL); // NOLINT(whitespace/line_length)
+ typename boost::enable_if<boost::is_void<typename result_of<F()>::type> >::type* = NULL); // NOLINT(whitespace/line_length)
#define TEMPLATE(Z, N, DATA) \
@@ -77,9 +77,9 @@ private:
AsyncExecutorProcess& operator=(const AsyncExecutorProcess&);
template <typename F>
- typename result_of<F(void)>::type execute(
+ typename result_of<F()>::type execute(
const F& f,
- typename boost::disable_if<boost::is_void<typename result_of<F(void)>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
+ typename boost::disable_if<boost::is_void<typename result_of<F()>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
{
terminate(self()); // Terminate process after function returns.
return f();
@@ -88,7 +88,7 @@ private:
template <typename F>
Nothing execute(
const F& f,
- typename boost::enable_if<boost::is_void<typename result_of<F(void)>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
+ typename boost::enable_if<boost::is_void<typename result_of<F()>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
{
terminate(self()); // Terminate process after function returns.
f();
@@ -128,14 +128,14 @@ class AsyncExecutor
private:
// Declare async functions as friends.
template <typename F>
- friend Future<typename result_of<F(void)>::type> async(
+ friend Future<typename result_of<F()>::type> async(
const F& f,
- typename boost::disable_if<boost::is_void<typename result_of<F(void)>::type> >::type*); // NOLINT(whitespace/line_length)
+ typename boost::disable_if<boost::is_void<typename result_of<F()>::type> >::type*); // NOLINT(whitespace/line_length)
template <typename F>
friend Future<Nothing> async(
const F& f,
- typename boost::enable_if<boost::is_void<typename result_of<F(void)>::type> >::type*); // NOLINT(whitespace/line_length)
+ typename boost::enable_if<boost::is_void<typename result_of<F()>::type> >::type*); // NOLINT(whitespace/line_length)
#define TEMPLATE(Z, N, DATA) \
template <typename F, ENUM_PARAMS(N, typename A)> \
@@ -166,12 +166,12 @@ private:
AsyncExecutor& operator=(const AsyncExecutor&);
template <typename F>
- Future<typename result_of<F(void)>::type> execute(
+ Future<typename result_of<F()>::type> execute(
const F& f,
- typename boost::disable_if<boost::is_void<typename result_of<F(void)>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
+ typename boost::disable_if<boost::is_void<typename result_of<F()>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
{
// Need to disambiguate overloaded method.
- typename result_of<F(void)>::type(AsyncExecutorProcess::*method)(const F&, typename boost::disable_if<boost::is_void<typename result_of<F(void)>::type> >::type*) = // NOLINT(whitespace/line_length)
+ typename result_of<F()>::type(AsyncExecutorProcess::*method)(const F&, typename boost::disable_if<boost::is_void<typename result_of<F()>::type> >::type*) = // NOLINT(whitespace/line_length)
&AsyncExecutorProcess::execute<F>;
return dispatch(process, method, f, (void*) NULL);
@@ -180,10 +180,10 @@ private:
template <typename F>
Future<Nothing> execute(
const F& f,
- typename boost::enable_if<boost::is_void<typename result_of<F(void)>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
+ typename boost::enable_if<boost::is_void<typename result_of<F()>::type> >::type* = NULL) // NOLINT(whitespace/line_length)
{
// Need to disambiguate overloaded method.
- Nothing(AsyncExecutorProcess::*method)(const F&, typename boost::enable_if<boost::is_void<typename result_of<F(void)>::type> >::type*) = // NOLINT(whitespace/line_length)
+ Nothing(AsyncExecutorProcess::*method)(const F&, typename boost::enable_if<boost::is_void<typename result_of<F()>::type> >::type*) = // NOLINT(whitespace/line_length)
&AsyncExecutorProcess::execute<F>;
return dispatch(process, method, f, (void*) NULL);
@@ -225,9 +225,9 @@ private:
// Provides an abstraction for asynchronously executing a function.
template <typename F>
-Future<typename result_of<F(void)>::type> async(
+Future<typename result_of<F()>::type> async(
const F& f,
- typename boost::disable_if<boost::is_void<typename result_of<F(void)>::type> >::type*) // NOLINT(whitespace/line_length)
+ typename boost::disable_if<boost::is_void<typename result_of<F()>::type> >::type*) // NOLINT(whitespace/line_length)
{
return AsyncExecutor().execute(f);
}
@@ -236,7 +236,7 @@ Future<typename result_of<F(void)>::type> async(
template <typename F>
Future<Nothing> async(
const F& f,
- typename boost::enable_if<boost::is_void<typename result_of<F(void)>::type> >::type*) // NOLINT(whitespace/line_length)
+ typename boost::enable_if<boost::is_void<typename result_of<F()>::type> >::type*) // NOLINT(whitespace/line_length)
{
return AsyncExecutor().execute(f);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/clock.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/clock.hpp b/3rdparty/libprocess/include/process/clock.hpp
index 5875847..d7d5ff7 100644
--- a/3rdparty/libprocess/include/process/clock.hpp
+++ b/3rdparty/libprocess/include/process/clock.hpp
@@ -71,7 +71,7 @@ public:
static Timer timer(
const Duration& duration,
- const lambda::function<void(void)>& thunk);
+ const lambda::function<void()>& thunk);
static bool cancel(const Timer& timer);
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/defer.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/defer.hpp b/3rdparty/libprocess/include/process/defer.hpp
index 464aa9e..6bb79cd 100644
--- a/3rdparty/libprocess/include/process/defer.hpp
+++ b/3rdparty/libprocess/include/process/defer.hpp
@@ -32,29 +32,21 @@ namespace process {
// First, definitions of defer for methods returning void:
template <typename T>
-Deferred<void(void)> defer(
- const PID<T>& pid,
- void (T::*method)(void))
+Deferred<void()> defer(const PID<T>& pid, void (T::*method)())
{
- return Deferred<void(void)>([=]() {
- dispatch(pid, method);
- });
+ return Deferred<void()>([=]() { dispatch(pid, method); });
}
template <typename T>
-Deferred<void(void)> defer(
- const Process<T>& process,
- void (T::*method)(void))
+Deferred<void()> defer(const Process<T>& process, void (T::*method)())
{
return defer(process.self(), method);
}
template <typename T>
-Deferred<void(void)> defer(
- const Process<T>* process,
- void (T::*method)(void))
+Deferred<void()> defer(const Process<T>* process, void (T::*method)())
{
return defer(process->self(), method);
}
@@ -111,24 +103,19 @@ Deferred<void(void)> defer(
// Next, definitions of defer for methods returning future:
template <typename R, typename T>
-Deferred<Future<R>(void)>
-defer(const PID<T>& pid, Future<R> (T::*method)(void))
+Deferred<Future<R>()> defer(const PID<T>& pid, Future<R> (T::*method)())
{
- return Deferred<Future<R>(void)>([=]() {
- return dispatch(pid, method);
- });
+ return Deferred<Future<R>()>([=]() { return dispatch(pid, method); });
}
template <typename R, typename T>
-Deferred<Future<R>(void)>
-defer(const Process<T>& process, Future<R> (T::*method)(void))
+Deferred<Future<R>()> defer(const Process<T>& process, Future<R> (T::*method)())
{
return defer(process.self(), method);
}
template <typename R, typename T>
-Deferred<Future<R>(void)>
-defer(const Process<T>* process, Future<R> (T::*method)(void))
+Deferred<Future<R>()> defer(const Process<T>* process, Future<R> (T::*method)())
{
return defer(process->self(), method);
}
@@ -181,24 +168,19 @@ defer(const Process<T>* process, Future<R> (T::*method)(void))
// Finaly, definitions of defer for methods returning a value:
template <typename R, typename T>
-Deferred<Future<R>(void)>
-defer(const PID<T>& pid, R (T::*method)(void))
+Deferred<Future<R>()> defer(const PID<T>& pid, R (T::*method)())
{
- return Deferred<Future<R>(void)>([=]() {
- return dispatch(pid, method);
- });
+ return Deferred<Future<R>()>([=]() { return dispatch(pid, method); });
}
template <typename R, typename T>
-Deferred<Future<R>(void)>
-defer(const Process<T>& process, R (T::*method)(void))
+Deferred<Future<R>()> defer(const Process<T>& process, R (T::*method)())
{
return defer(process.self(), method);
}
template <typename R, typename T>
-Deferred<Future<R>(void)>
-defer(const Process<T>* process, R (T::*method)(void))
+Deferred<Future<R>()> defer(const Process<T>* process, R (T::*method)())
{
return defer(process->self(), method);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/deferred.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/deferred.hpp b/3rdparty/libprocess/include/process/deferred.hpp
index 1cb9f89..eb4739c 100644
--- a/3rdparty/libprocess/include/process/deferred.hpp
+++ b/3rdparty/libprocess/include/process/deferred.hpp
@@ -36,16 +36,16 @@ private:
// TODO(benh): Consider removing these in favor of having these
// functions return _Deferred.
template <typename T>
- friend Deferred<void(void)>
- defer(const PID<T>& pid, void (T::*method)(void));
+ friend Deferred<void()>
+ defer(const PID<T>& pid, void (T::*method)());
template <typename R, typename T>
- friend Deferred<Future<R>(void)>
- defer(const PID<T>& pid, Future<R> (T::*method)(void));
+ friend Deferred<Future<R>()>
+ defer(const PID<T>& pid, Future<R> (T::*method)());
template <typename R, typename T>
- friend Deferred<Future<R>(void)>
- defer(const PID<T>& pid, R (T::*method)(void));
+ friend Deferred<Future<R>()>
+ defer(const PID<T>& pid, R (T::*method)());
/*implicit*/ Deferred(const std::function<F>& f) : std::function<F>(f) {}
};
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/dispatch.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/dispatch.hpp b/3rdparty/libprocess/include/process/dispatch.hpp
index dca3d73..a4c35b2 100644
--- a/3rdparty/libprocess/include/process/dispatch.hpp
+++ b/3rdparty/libprocess/include/process/dispatch.hpp
@@ -77,9 +77,7 @@ void dispatch(
// First, definitions of dispatch for methods returning void:
template <typename T>
-void dispatch(
- const PID<T>& pid,
- void (T::*method)())
+void dispatch(const PID<T>& pid, void (T::*method)())
{
std::shared_ptr<std::function<void(ProcessBase*)>> f(
new std::function<void(ProcessBase*)>(
@@ -94,17 +92,13 @@ void dispatch(
}
template <typename T>
-void dispatch(
- const Process<T>& process,
- void (T::*method)())
+void dispatch(const Process<T>& process, void (T::*method)())
{
dispatch(process.self(), method);
}
template <typename T>
-void dispatch(
- const Process<T>* process,
- void (T::*method)())
+void dispatch(const Process<T>* process, void (T::*method)())
{
dispatch(process->self(), method);
}
@@ -162,9 +156,7 @@ void dispatch(
// Next, definitions of methods returning a future:
template <typename R, typename T>
-Future<R> dispatch(
- const PID<T>& pid,
- Future<R> (T::*method)())
+Future<R> dispatch(const PID<T>& pid, Future<R> (T::*method)())
{
std::shared_ptr<Promise<R>> promise(new Promise<R>());
@@ -183,17 +175,13 @@ Future<R> dispatch(
}
template <typename R, typename T>
-Future<R> dispatch(
- const Process<T>& process,
- Future<R> (T::*method)(void))
+Future<R> dispatch(const Process<T>& process, Future<R> (T::*method)())
{
return dispatch(process.self(), method);
}
template <typename R, typename T>
-Future<R> dispatch(
- const Process<T>* process,
- Future<R> (T::*method)(void))
+Future<R> dispatch(const Process<T>* process, Future<R> (T::*method)())
{
return dispatch(process->self(), method);
}
@@ -255,9 +243,7 @@ Future<R> dispatch(
// Next, definitions of methods returning a value.
template <typename R, typename T>
-Future<R> dispatch(
- const PID<T>& pid,
- R (T::*method)(void))
+Future<R> dispatch(const PID<T>& pid, R (T::*method)())
{
std::shared_ptr<Promise<R>> promise(new Promise<R>());
@@ -276,17 +262,13 @@ Future<R> dispatch(
}
template <typename R, typename T>
-Future<R> dispatch(
- const Process<T>& process,
- R (T::*method)())
+Future<R> dispatch(const Process<T>& process, R (T::*method)())
{
return dispatch(process.self(), method);
}
template <typename R, typename T>
-Future<R> dispatch(
- const Process<T>* process,
- R (T::*method)())
+Future<R> dispatch(const Process<T>* process, R (T::*method)())
{
return dispatch(process->self(), method);
}
@@ -345,9 +327,7 @@ Future<R> dispatch(
#undef TEMPLATE
-inline void dispatch(
- const UPID& pid,
- const std::function<void()>& f)
+inline void dispatch(const UPID& pid, const std::function<void()>& f)
{
std::shared_ptr<std::function<void(ProcessBase*)>> f_(
new std::function<void(ProcessBase*)>(
@@ -360,9 +340,7 @@ inline void dispatch(
template <typename R>
-Future<R> dispatch(
- const UPID& pid,
- const std::function<Future<R>()>& f)
+Future<R> dispatch(const UPID& pid, const std::function<Future<R>()>& f)
{
std::shared_ptr<Promise<R>> promise(new Promise<R>());
@@ -379,9 +357,7 @@ Future<R> dispatch(
template <typename R>
-Future<R> dispatch(
- const UPID& pid,
- const std::function<R()>& f)
+Future<R> dispatch(const UPID& pid, const std::function<R()>& f)
{
std::shared_ptr<Promise<R>> promise(new Promise<R>());
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/future.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/future.hpp b/3rdparty/libprocess/include/process/future.hpp
index a05d9e4..80f3a39 100644
--- a/3rdparty/libprocess/include/process/future.hpp
+++ b/3rdparty/libprocess/include/process/future.hpp
@@ -151,10 +151,10 @@ public:
// Type of the callback functions that can get invoked when the
// future gets set, fails, or is discarded.
- typedef lambda::function<void(void)> DiscardCallback;
+ typedef lambda::function<void()> DiscardCallback;
typedef lambda::function<void(const T&)> ReadyCallback;
typedef lambda::function<void(const std::string&)> FailedCallback;
- typedef lambda::function<void(void)> DiscardedCallback;
+ typedef lambda::function<void()> DiscardedCallback;
typedef lambda::function<void(const Future<T>&)> AnyCallback;
// Installs callbacks for the specified events and returns a const
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/metrics/gauge.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/metrics/gauge.hpp b/3rdparty/libprocess/include/process/metrics/gauge.hpp
index d5e7f5e..c5bbeaf 100644
--- a/3rdparty/libprocess/include/process/metrics/gauge.hpp
+++ b/3rdparty/libprocess/include/process/metrics/gauge.hpp
@@ -31,10 +31,8 @@ public:
// 'name' is the unique name for the instance of Gauge being constructed.
// It will be the key exposed in the JSON endpoint.
// 'f' is the deferred object called when the Metric value is requested.
- Gauge(const std::string& name,
- const Deferred<Future<double> (void)>& f)
- : Metric(name, None()),
- data(new Data(f)) {}
+ Gauge(const std::string& name, const Deferred<Future<double>()>& f)
+ : Metric(name, None()), data(new Data(f)) {}
virtual ~Gauge() {}
@@ -43,10 +41,9 @@ public:
private:
struct Data
{
- explicit Data(const Deferred<Future<double> (void)>& _f)
- : f(_f) {}
+ explicit Data(const Deferred<Future<double>()>& _f) : f(_f) {}
- const Deferred<Future<double> (void)> f;
+ const Deferred<Future<double>()> f;
};
std::shared_ptr<Data> data;
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/run.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/run.hpp b/3rdparty/libprocess/include/process/run.hpp
index 2afe8ed..d141fb0 100644
--- a/3rdparty/libprocess/include/process/run.hpp
+++ b/3rdparty/libprocess/include/process/run.hpp
@@ -28,7 +28,7 @@ template <typename R>
class ThunkProcess : public Process<ThunkProcess<R>>
{
public:
- ThunkProcess(std::shared_ptr<lambda::function<R(void)>> _thunk,
+ ThunkProcess(std::shared_ptr<lambda::function<R()>> _thunk,
std::shared_ptr<Promise<R>> _promise)
: thunk(_thunk),
promise(_promise) {}
@@ -42,7 +42,7 @@ protected:
}
private:
- std::shared_ptr<lambda::function<R(void)>> thunk;
+ std::shared_ptr<lambda::function<R()>> thunk;
std::shared_ptr<Promise<R>> promise;
};
@@ -50,10 +50,10 @@ private:
template <typename R>
-Future<R> run(R (*method)(void))
+Future<R> run(R (*method)())
{
- std::shared_ptr<lambda::function<R(void)>> thunk(
- new lambda::function<R(void)>(
+ std::shared_ptr<lambda::function<R()>> thunk(
+ new lambda::function<R()>(
lambda::bind(method)));
std::shared_ptr<Promise<R>> promise(new Promise<R>());
@@ -73,8 +73,8 @@ Future<R> run(R (*method)(void))
R (*method)(ENUM_PARAMS(N, P)), \
ENUM_BINARY_PARAMS(N, A, a)) \
{ \
- std::shared_ptr<lambda::function<R(void)>> thunk( \
- new lambda::function<R(void)>( \
+ std::shared_ptr<lambda::function<R()>> thunk( \
+ new lambda::function<R()>( \
lambda::bind(method, ENUM_PARAMS(N, a)))); \
\
std::shared_ptr<Promise<R>> promise(new Promise<R>()); \
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/sequence.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/sequence.hpp b/3rdparty/libprocess/include/process/sequence.hpp
index 296978c..78ccdb9 100644
--- a/3rdparty/libprocess/include/process/sequence.hpp
+++ b/3rdparty/libprocess/include/process/sequence.hpp
@@ -48,7 +48,7 @@ public:
// affected. The subsequent callbacks will not be invoked until the
// future is actually DISCARDED.
template <typename T>
- Future<T> add(const lambda::function<Future<T>(void)>& callback);
+ Future<T> add(const lambda::function<Future<T>()>& callback);
private:
// Not copyable, not assignable.
@@ -65,7 +65,7 @@ public:
SequenceProcess() : last(Nothing()) {}
template <typename T>
- Future<T> add(const lambda::function<Future<T>(void)>& callback)
+ Future<T> add(const lambda::function<Future<T>()>& callback)
{
// This is the future that is used to notify the next callback
// (denoted by 'N' in the following graph).
@@ -147,7 +147,7 @@ private:
template <typename T>
static void notified(
Owned<Promise<T> > promise,
- const lambda::function<Future<T>(void)>& callback)
+ const lambda::function<Future<T>()>& callback)
{
if (promise->future().hasDiscard()) {
// The user has shown the intention to discard this callback
@@ -179,7 +179,7 @@ inline Sequence::~Sequence()
template <typename T>
-Future<T> Sequence::add(const lambda::function<Future<T>(void)>& callback)
+Future<T> Sequence::add(const lambda::function<Future<T>()>& callback)
{
return dispatch(process, &SequenceProcess::add<T>, callback);
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/include/process/timer.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/include/process/timer.hpp b/3rdparty/libprocess/include/process/timer.hpp
index ff9680a..6bf7216 100644
--- a/3rdparty/libprocess/include/process/timer.hpp
+++ b/3rdparty/libprocess/include/process/timer.hpp
@@ -62,7 +62,7 @@ private:
Timer(long _id,
const Timeout& _t,
const process::UPID& _pid,
- const lambda::function<void(void)>& _thunk)
+ const lambda::function<void()>& _thunk)
: id(_id), t(_t), pid(_pid), thunk(_thunk)
{}
@@ -77,7 +77,7 @@ private:
// valid and get a refernce to it.)
process::UPID pid;
- lambda::function<void(void)> thunk;
+ lambda::function<void()> thunk;
};
} // namespace process {
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/m4/ax_pthread.m4
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/m4/ax_pthread.m4 b/3rdparty/libprocess/m4/ax_pthread.m4
index d383ad5..0b2071d 100644
--- a/3rdparty/libprocess/m4/ax_pthread.m4
+++ b/3rdparty/libprocess/m4/ax_pthread.m4
@@ -172,7 +172,7 @@ AC_MSG_CHECKING([if compiler needs -Werror to reject unknown flags])
save_CFLAGS="$CFLAGS"
ax_pthread_extra_flags="-Werror"
CFLAGS="$CFLAGS $ax_pthread_extra_flags -Wunknown-warning-option -Wsizeof-array-argument"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo(void);],[foo()])],
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([int foo();],[foo()])],
[AC_MSG_RESULT([yes])],
[ax_pthread_extra_flags=
AC_MSG_RESULT([no])])
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/clock.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/clock.cpp b/3rdparty/libprocess/src/clock.cpp
index 124d527..6c32792 100644
--- a/3rdparty/libprocess/src/clock.cpp
+++ b/3rdparty/libprocess/src/clock.cpp
@@ -264,7 +264,7 @@ Time Clock::now(ProcessBase* process)
Timer Clock::timer(
const Duration& duration,
- const lambda::function<void(void)>& thunk)
+ const lambda::function<void()>& thunk)
{
// Start at 1 since Timer() instances use id 0.
static std::atomic<uint64_t> id(1);
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/event_loop.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/event_loop.hpp b/3rdparty/libprocess/src/event_loop.hpp
index 60ec2bc..17a24a4 100644
--- a/3rdparty/libprocess/src/event_loop.hpp
+++ b/3rdparty/libprocess/src/event_loop.hpp
@@ -32,7 +32,7 @@ public:
// TODO(bmahler): Update this to use rvalue references.
static void delay(
const Duration& duration,
- const lambda::function<void(void)>& function);
+ const lambda::function<void()>& function);
// Returns the current time w.r.t. the event loop.
static double time();
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/libev.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libev.cpp b/3rdparty/libprocess/src/libev.cpp
index 91e2d81..1269bf8 100644
--- a/3rdparty/libprocess/src/libev.cpp
+++ b/3rdparty/libprocess/src/libev.cpp
@@ -37,15 +37,15 @@ std::queue<ev_io*>* watchers = new std::queue<ev_io*>();
std::mutex* watchers_mutex = new std::mutex();
-std::queue<lambda::function<void(void)>>* functions =
- new std::queue<lambda::function<void(void)>>();
+std::queue<lambda::function<void()>>* functions =
+ new std::queue<lambda::function<void()>>();
THREAD_LOCAL bool* _in_event_loop_ = NULL;
void handle_async(struct ev_loop* loop, ev_async* _, int revents)
{
- std::queue<lambda::function<void(void)>> run_functions;
+ std::queue<lambda::function<void()>> run_functions;
synchronized (watchers_mutex) {
// Start all the new I/O watchers.
while (!watchers->empty()) {
@@ -96,8 +96,8 @@ namespace internal {
void handle_delay(struct ev_loop* loop, ev_timer* timer, int revents)
{
- lambda::function<void(void)>* function =
- reinterpret_cast<lambda::function<void(void)>*>(timer->data);
+ lambda::function<void()>* function =
+ reinterpret_cast<lambda::function<void()>*>(timer->data);
(*function)();
delete function;
ev_timer_stop(loop, timer);
@@ -107,11 +107,10 @@ void handle_delay(struct ev_loop* loop, ev_timer* timer, int revents)
Future<Nothing> delay(
const Duration& duration,
- const lambda::function<void(void)>& function)
+ const lambda::function<void()>& function)
{
ev_timer* timer = new ev_timer();
- timer->data = reinterpret_cast<void*>(
- new lambda::function<void(void)>(function));
+ timer->data = reinterpret_cast<void*>(new lambda::function<void()>(function));
// Determine the 'after' parameter to pass to libev and set it to 0
// in the event that it's negative so that we always make sure to
@@ -136,7 +135,7 @@ Future<Nothing> delay(
void EventLoop::delay(
const Duration& duration,
- const lambda::function<void(void)>& function)
+ const lambda::function<void()>& function)
{
run_in_event_loop<Nothing>(
lambda::bind(&internal::delay, duration, function));
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/libev.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libev.hpp b/3rdparty/libprocess/src/libev.hpp
index 7785640..3995a2e 100644
--- a/3rdparty/libprocess/src/libev.hpp
+++ b/3rdparty/libprocess/src/libev.hpp
@@ -43,7 +43,7 @@ extern std::mutex* watchers_mutex;
// Queue of functions to be invoked asynchronously within the vent
// loop (protected by 'watchers' above).
-extern std::queue<lambda::function<void(void)>>* functions;
+extern std::queue<lambda::function<void()>>* functions;
// Per thread bool pointer. We use a pointer to lazily construct the
// actual bool.
@@ -56,7 +56,7 @@ extern THREAD_LOCAL bool* _in_event_loop_;
// Wrapper around function we want to run in the event loop.
template <typename T>
void _run_in_event_loop(
- const lambda::function<Future<T>(void)>& f,
+ const lambda::function<Future<T>()>& f,
const Owned<Promise<T>>& promise)
{
// Don't bother running the function if the future has been discarded.
@@ -70,7 +70,7 @@ void _run_in_event_loop(
// Helper for running a function in the event loop.
template <typename T>
-Future<T> run_in_event_loop(const lambda::function<Future<T>(void)>& f)
+Future<T> run_in_event_loop(const lambda::function<Future<T>()>& f)
{
// If this is already the event loop then just run the function.
if (__in_event_loop__) {
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/libevent.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent.cpp b/3rdparty/libprocess/src/libevent.cpp
index 61d056b..c787fa9 100644
--- a/3rdparty/libprocess/src/libevent.cpp
+++ b/3rdparty/libprocess/src/libevent.cpp
@@ -33,8 +33,8 @@ event_base* base = NULL;
static std::mutex* functions_mutex = new std::mutex();
-std::queue<lambda::function<void(void)>>* functions =
- new std::queue<lambda::function<void(void)>>();
+std::queue<lambda::function<void()>>* functions =
+ new std::queue<lambda::function<void()>>();
THREAD_LOCAL bool* _in_event_loop_ = NULL;
@@ -45,7 +45,7 @@ void async_function(int socket, short which, void* arg)
event* ev = reinterpret_cast<event*>(arg);
event_free(ev);
- std::queue<lambda::function<void(void)>> q;
+ std::queue<lambda::function<void()>> q;
synchronized (functions_mutex) {
std::swap(q, *functions);
@@ -59,7 +59,7 @@ void async_function(int socket, short which, void* arg)
void run_in_event_loop(
- const lambda::function<void(void)>& f,
+ const lambda::function<void()>& f,
EventLoopLogicFlow event_loop_logic_flow)
{
if (__in_event_loop__ && event_loop_logic_flow == ALLOW_SHORT_CIRCUIT) {
@@ -124,7 +124,7 @@ namespace internal {
struct Delay
{
- lambda::function<void(void)> function;
+ lambda::function<void()> function;
event* timer;
};
@@ -141,7 +141,7 @@ void handle_delay(int, short, void* arg)
void EventLoop::delay(
const Duration& duration,
- const lambda::function<void(void)>& function)
+ const lambda::function<void()>& function)
{
internal::Delay* delay = new internal::Delay();
delay->timer = evtimer_new(base, &internal::handle_delay, delay);
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/libevent.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/libevent.hpp b/3rdparty/libprocess/src/libevent.hpp
index 61129b3..4d0647e 100644
--- a/3rdparty/libprocess/src/libevent.hpp
+++ b/3rdparty/libprocess/src/libevent.hpp
@@ -41,7 +41,7 @@ enum EventLoopLogicFlow
void run_in_event_loop(
- const lambda::function<void(void)>& f,
+ const lambda::function<void()>& f,
EventLoopLogicFlow event_loop_logic_flow = ALLOW_SHORT_CIRCUIT);
} // namespace process {
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/tests/process_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/process_tests.cpp b/3rdparty/libprocess/src/tests/process_tests.cpp
index df388ed..df1c7b3 100644
--- a/3rdparty/libprocess/src/tests/process_tests.cpp
+++ b/3rdparty/libprocess/src/tests/process_tests.cpp
@@ -541,8 +541,8 @@ TEST(ProcessTest, Discard3)
class SpawnProcess : public Process<SpawnProcess>
{
public:
- MOCK_METHOD0(initialize, void(void));
- MOCK_METHOD0(finalize, void(void));
+ MOCK_METHOD0(initialize, void());
+ MOCK_METHOD0(finalize, void());
};
@@ -572,7 +572,7 @@ TEST(ProcessTest, Spawn)
class DispatchProcess : public Process<DispatchProcess>
{
public:
- MOCK_METHOD0(func0, void(void));
+ MOCK_METHOD0(func0, void());
MOCK_METHOD1(func1, bool(bool));
MOCK_METHOD1(func2, Future<bool>(bool));
MOCK_METHOD1(func3, int(int));
@@ -639,7 +639,7 @@ TEST(ProcessTest, Defer1)
ASSERT_FALSE(!pid);
{
- Deferred<void(void)> func0 =
+ Deferred<void()> func0 =
defer(pid, &DispatchProcess::func0);
func0();
}
@@ -647,21 +647,21 @@ TEST(ProcessTest, Defer1)
Future<bool> future;
{
- Deferred<Future<bool>(void)> func1 =
+ Deferred<Future<bool>()> func1 =
defer(pid, &DispatchProcess::func1, true);
future = func1();
EXPECT_TRUE(future.get());
}
{
- Deferred<Future<bool>(void)> func2 =
+ Deferred<Future<bool>()> func2 =
defer(pid, &DispatchProcess::func2, true);
future = func2();
EXPECT_TRUE(future.get());
}
{
- Deferred<Future<bool>(void)> func4 =
+ Deferred<Future<bool>()> func4 =
defer(pid, &DispatchProcess::func4, true, 42);
future = func4();
EXPECT_TRUE(future.get());
@@ -1622,7 +1622,7 @@ TEST(ProcessTest, Defers)
std::bind(baz, std::placeholders::_1));
Future<string>().then(std::function<int(string)>());
- Future<string>().then(std::function<int(void)>());
+ Future<string>().then(std::function<int()>());
Future<int> future11 = Future<string>().then(
defer(std::bind(bam, std::placeholders::_1)));
@@ -1680,10 +1680,10 @@ TEST(ProcessTest, Defers)
// }
{
- std::function<Future<int>(void)> f =
+ std::function<Future<int>()> f =
defer(std::bind(baz, "42"));
- std::function<Future<int>(void)> f2 =
+ std::function<Future<int>()> f2 =
defer([]() { return baz("42"); });
}
http://git-wip-us.apache.org/repos/asf/mesos/blob/05f9fb2f/3rdparty/libprocess/src/tests/sequence_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/tests/sequence_tests.cpp b/3rdparty/libprocess/src/tests/sequence_tests.cpp
index f7e84b9..566393f 100644
--- a/3rdparty/libprocess/src/tests/sequence_tests.cpp
+++ b/3rdparty/libprocess/src/tests/sequence_tests.cpp
@@ -71,7 +71,7 @@ TEST(SequenceTest, Serialize)
Future<Nothing> bar = FUTURE_DISPATCH(_, &TestProcess::bar);
- lambda::function<Future<Nothing>(void)> f;
+ lambda::function<Future<Nothing>()> f;
f = defer(process, &TestProcess::foo);
sequence.add(f);
@@ -103,9 +103,9 @@ class DiscardProcess : public Process<DiscardProcess>
public:
Future<Nothing> func0() { return promise.future(); }
- MOCK_METHOD0(func1, Nothing(void));
- MOCK_METHOD0(func2, Nothing(void));
- MOCK_METHOD0(func3, Nothing(void));
+ MOCK_METHOD0(func1, Nothing());
+ MOCK_METHOD0(func2, Nothing());
+ MOCK_METHOD0(func3, Nothing());
Promise<Nothing> promise;
};
@@ -119,7 +119,7 @@ TEST(SequenceTest, DiscardOne)
Sequence sequence;
- lambda::function<Future<Nothing>(void)> f;
+ lambda::function<Future<Nothing>()> f;
f = defer(process, &DiscardProcess::func0);
Future<Nothing> f0 = sequence.add(f);
@@ -169,7 +169,7 @@ TEST(SequenceTest, DiscardAll)
Sequence* sequence = new Sequence();
- lambda::function<Future<Nothing>(void)> f;
+ lambda::function<Future<Nothing>()> f;
f = defer(process, &DiscardProcess::func0);
Future<Nothing> f0 = sequence->add(f);
@@ -250,7 +250,7 @@ TEST(SequenceTest, Random)
Sequence sequence;
for (int i = 0; i < 100; i++) {
- lambda::function<Future<Nothing>(void)> f;
+ lambda::function<Future<Nothing>()> f;
// We randomly do 'pulse' and 'verify'. The idea here is that: if
// sequence is not used, a 'verify' may see an intermediate
[3/3] mesos git commit: Removed `void` parameters in stout.
Posted by mp...@apache.org.
Removed `void` parameters in stout.
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/93a57082
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/93a57082
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/93a57082
Branch: refs/heads/master
Commit: 93a5708294d6d66a5e1350a0bb1c8fe87605ee1d
Parents: 037e0f8
Author: Michael Park <mp...@apache.org>
Authored: Wed Jan 20 14:14:39 2016 -0800
Committer: Michael Park <mp...@apache.org>
Committed: Wed Jan 20 15:29:05 2016 -0800
----------------------------------------------------------------------
.../stout/include/stout/os/posix/fork.hpp | 22 ++++++++++----------
.../3rdparty/stout/tests/os_tests.cpp | 2 +-
2 files changed, 12 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/93a57082/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
index 11557e3..8d8ed0b 100644
--- a/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
+++ b/3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp
@@ -112,7 +112,7 @@ struct Wait {};
struct Fork
{
// -+- parent.
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Exec& _exec)
: function(_function),
exec(_exec) {}
@@ -121,14 +121,14 @@ struct Fork
// -+- parent
// \--- child.
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1)
: function(_function)
{
children.push_back(fork1);
}
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Exec& _exec)
: function(_function),
@@ -137,7 +137,7 @@ struct Fork
children.push_back(fork1);
}
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Wait& _wait)
: function(_function),
@@ -150,7 +150,7 @@ struct Fork
// -+- parent
// |--- child
// \--- child.
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Fork& fork2)
: function(_function)
@@ -159,7 +159,7 @@ struct Fork
children.push_back(fork2);
}
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Fork& fork2,
const Exec& _exec)
@@ -170,7 +170,7 @@ struct Fork
children.push_back(fork2);
}
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Fork& fork2,
const Wait& _wait)
@@ -186,7 +186,7 @@ struct Fork
// |--- child
// |--- child
// \--- child.
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Fork& fork2,
const Fork& fork3)
@@ -197,7 +197,7 @@ struct Fork
children.push_back(fork3);
}
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Fork& fork2,
const Fork& fork3,
@@ -210,7 +210,7 @@ struct Fork
children.push_back(fork3);
}
- Fork(const Option<void(*)(void)>& _function,
+ Fork(const Option<void(*)()>& _function,
const Fork& fork1,
const Fork& fork2,
const Fork& fork3,
@@ -440,7 +440,7 @@ public:
}
private:
- Option<void(*)(void)> function;
+ Option<void(*)()> function;
Option<const Exec> exec;
Option<const Wait> wait;
std::vector<Fork> children;
http://git-wip-us.apache.org/repos/asf/mesos/blob/93a57082/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
index e0a898d..dc8cf74 100644
--- a/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
+++ b/3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
@@ -564,7 +564,7 @@ TEST_F(OsTest, Processes)
}
-void dosetsid(void)
+void dosetsid()
{
if (::setsid() == -1) {
ABORT(string("Failed to setsid: ") + os::strerror(errno));